How to configure the stack so that stack overflow triggers a fault ?
Hello,
First of all, I am using a STM32F446 with Keil IDE. I used CubeMX to generate the Keil project.
I recently encoutered a problem that seems to be some kind of stack overflow: the static variables that were located just before the stack in the RAM address space were modified without being accessed in the code. This seemed to happen randomly, generally after a couple of minutes.
Increasing the size of the stack in the startup file seems to have solved the problem. However, diagnosing the issue took me a while, especially because there was no way to trigger it, and the behavior of the code with these random values could have damaged the machine I am controlling. So I am looking for a way to configure the stack that would make sure a hard fault is triggered when the stack is full.
Moreover, I am really confused about the direction the stack fills up...
I already started a thread and posted the details on the Keil discussion forum : http://www.keil.com/forum/64363/
Thank you
