Need support in FreeRTOS related In-sufficient stack isuue

Dear Team,

I'm facing the issue of insufficient stack or stack overflow when I enabled configCHECK_FOR_STACK_OVERFLOW and configUSE_MALLOC_FAILED_HOOK. If i am not enable those macros i can able to run device and able to work all the functionalities.

Why is this issue coming when I enable those macros? what might be the reason for this?

  • Hi,

    As you write that the issue is insufficient stack, then I assume this is not related to configUSE_MALLOC_FAILED_HOOK and only configCHECK_FOR_STACK_OVERFLOW? If you did not do any other changes simultaniously, then you likely have a stack overflow occuring that you did not notice before (a stack overflow may not always trigger an observable issue if the memory below the stack that get's overwritten is unused or is written to before it is used.

    If you are seeing a stack overflow you can incrase the stack size for the task/thread with the overflow, as long as you have enough available RAM. Alternatively, you may need to do somethign to optimzie the stack usage (for isntance avoid large variables or arrays on the stack).

Related