cancel
Showing results for 
Search instead for 
Did you mean: 

Free RTOS parameter CHECK_FOR_STACK_OVERFLOW seems not to work

MauFanGilaMedical
Associate III

Hello.

 

I bought Riverdi board and start to develop my code.

I found in FREERTOS_M7 Config parameters RTOS CHECK_FOR_STACK_OVERFLOW.

 

Documentation says

 

CHECK_FOR_STACK_OVERFLOW
Parameter Description:
FreeRTOS provides two optional mechanisms that can be used to assist in stack overflow detection and debugging.
- when CHECK_FOR_STACK_OVERFLOW is set to 1 (option1), one mechanism is used
- when CHECK_FOR_STACK_OVERFLOW is set to 2 (option2), both mechanisms are used.
If CHECK_FOR_STACK_OVERFLOW is not set to 0 (Disabled), the application must provide a stack overflow hook (or callback) function: void vApplicationStackOverflowHook( xTaskHandle xTask, signed char *pcTaskName );
The kernel will call that stack overflow hook whenever a stack overflow is detected
Note: when set to 1 or 2, a function with an empty body is generated in the freertos.c file (to be completed by the user)

 

So I set CHECK_FOR_STACK_OVERFLOW = 1, trigger a stack overflow by an infinite recursive and set a bkpoint in 

MauFanGilaMedical_0-1747121130697.png

But when I run the code I just reach HardFault_Handler

 

What am I wrong ?

1 REPLY 1
TDK
Guru

See here for how this works. It only checks when tasks are switched.

FreeRTOS stack usage and stack overflow checking - FreeRTOS™

If you feel a post has answered your question, please click "Accept as Solution".