Hi Richard Barry,
(not to get mixed up. )
I am already using these:
#define configCHECK_FOR_STACK_OVERFLOW 1
#define configUSE_RECURSIVE_MUTEXES 1
#define configUSE_MALLOC_FAILED_HOOK 1
void vApplicationStackOverflowHook(TaskHandle_t pxTask, char *pcTaskName)
{
(void) pcTaskName;
(void) pxTask;
/**
* 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.
*/
taskDISABLE_INTERRUPTS();
for (;;);
}
void vApplicationMallocFailedHook(void)
{
/**
* vApplicationMallocFailedHook()
* will only be called if configUSE_MALLOC_FAILED_HOOK
* is set to 1 in FreeRTOSConfig.h.
* It is a hook function that will get called if a call
* to pvPortMalloc() fails.
*
* pvPortMalloc() is called internally by the kernel
* whenever a task, queue, timer or semaphore is created.
* It is also called by various parts of the demo
* application.
*
* If heap_1.c or heap_2.c are used, then the heap size
* available to pvPortMalloc() is defined by
* configTOTAL_HEAP_SIZE in FreeRTOSConfig.h
* and the xPortGetFreeHeapSize() API function can be
* used to query the remaining free heap size.
* (although it does not provide information on
* how the remaining heap might be fragmented).
*/
taskDISABLE_INTERRUPTS();
for (;;);
}
Now that you’ve mentioned it, noticed the hook functions
Maybe there is an overflow and it is in the indefinite loop…
Once the stack overflow hook is triggered, what would be the best possible thing to do, while developing ?
Thanks,
Manu