for the sake of debugging, I need to check whether a stack overflow would occur in a multitasking sketch. I am using STM32FreeRTOS version 9.0.4.
In the FreeRTOS configuration I activated the option configCHECK_FOR_STACK_OVERFLOW, and I added in my sketch a function as follows:
Code: Select all
extern "C" void vApplicationStackOverflowHook( TaskHandle_t xTask,signed char *pcTaskName );
void vApplicationStackOverflowHook( TaskHandle_t xTask,signed char *pcTaskName )
{
SERIAL.print("Debordement tache ") ;
SERIAL.println(pcTaskName[0]) ;
}
I had a look at STM32FreeRTOS.c, and I found the following code:
Code: Select all
#if ( configCHECK_FOR_STACK_OVERFLOW >= 1 )
/** Blink three short pulses if stack overflow is detected.
Run time stack overflow checking is performed if
configCHECK_FOR_STACK_OVERFLOW is defined to 1 or 2. This hook
function is called if a stack overflow is detected.
\param[in] pxTask Task handle
\param[in] pcTaskName Task name
*/
void vApplicationStackOverflowHook(TaskHandle_t pxTask, char *pcTaskName) {
(void) pcTaskName;
(void) pxTask;
errorBlink(3);
}
#endif /* configCHECK_FOR_STACK_OVERFLOW >= 1 */
So,when the option configCHECK_FOR_STACK_OVERFLOW is activated, I have no other choice but rely on the predefined function?