When many people first start programming in an RTOS, one of the immediate challenges is figuring out how to properly size the stack for each task. This can lead to some frustration during development because when a stack is overrun, the symptoms can range from odd behavior to a full system crash.
Implementing FreeRTOS memory hooks
Keeping an eye on stack space
vApplicationStackOverflowHook provides a very simple way of eliminating most of the oddball behavior and halting the application. When enabling configCHECK_FOR_STACK_OVERFLOW #define in FreeRTOSConfig.h, any time a stack overflow is detected by FreeRTOS, vApplicationStackOverflowHook will be called.
There are two potential values for configCHECK_FOR_STACK_OVERFLOW:
- ...