2018-12-01 12:08 AM
I am using Stm32f207....i am Suspecting there is stack overflow happening in my code.how to Check it actually?
2018-12-01 01:30 AM
Although not entirely reliable, the easiest method is to fill the memory with a easily recognizable pattern, run the program and observe in the debugger how far the stack has reached.
A more rigorous method is a static analysis, but that needs to have support from the toolchain, and also it gets complicated as soon as indirect calls (known as function pointers) are called, and/or stack usage changes dynamically e.g when using alloca().
RTOS pose a whole new group of problems in this regard.
JW
2018-12-01 01:32 AM
is there any Memory Mapping we can use t check it?
2018-12-01 03:16 AM
I don't know what do you mean by Memory Mapping.
JW
2018-12-01 04:12 AM
You can have your own code check how much of the pattern remains in memory.
You could put the stack at the bottom of memory so it hard faults as you drive it through the floor.
You might be able to use the MPU settings to Mem Fault in a similar manner. Review the chip TRM.