Is there a direct method in which the values of the stack_start and stack_end symbols can be referenced in a 'C' function? I can do this using a bit of assembler to read each symbol and place it to a variable that has been given the 'used' attribute. For example.
static __attribute__((used)) UI_32 StkStart;
__asm__
(
"LDR R0, =__stack_start__ \n"
"LDR R1, =StkStart\n"
"STMIA.W R1, {R0}\n"
);
Is there a way to avoid the use of assember here?
The reason that I need to do this is that my stack region is initialised to a particular pattern in the startup module and in order to determine how much of the stack has been used I can walk through the stack memory checking for changes to the original pattern.