Hi,
I wonder what mechanism I can use to check a stack overflow. My company develops systems that should shut down if anything uncontrollable occurs. We are using the STM32F103 micro controller and dont use an RTOS or alike and write all the code ourselves. Is there some hardware guard to catch a stack overflow?
Thanks,
Henk
If you place the stack at the bottom of memory, you could perhaps have it hard fault if it ploughed though the bottom. Would perhaps work better on the STM32F4 CCM memory at 0x10000000
Alternatively place a marker at the bottom, or guard zone and check it in the SysTick
I managed to construct a function that fills the stack with dummy values and let another function check on change of a stack value at an arbitray location 10 (32-bits) dwords above the lowest stack position and it works fine.
thanks,