Skip to main content
Graduate
January 30, 2023
Question

FreeRTOS: Stack overflow checking mechanism missing.

  • January 30, 2023
  • 1 reply
  • 2637 views

Hello,

According to https://www.freertos.org/Stacks-and-stack-overflow-checking.html, i.e. the FreeRTOS reference, one needs to set configCHECK_FOR_STACK_OVERFLOW to 1 or 2 in order to activate stack overflow checking. In case of a stack overflow FreeRTOS should call

void vApplicationStackOverflowHook(xTaskHandle xTask, signed char *pcTaskName)

I activated the mechanism in the ioc configuration file but I observe that vApplicationStackOverflowHook is called each cycle and not in case of a stack overflow i.e. the stack overflow mechanism implementations themselves are missing. The hook should be called in case of abnormalities if I understand the documentation correctly and not each cycle.

Is my analysis correct and if so, does anybody have a reference to the proper implementation of this mechanism?

    This topic has been closed for replies.

    1 reply

    Super User
    January 31, 2023

    The implementations are in stack_macros.h and used to work (not verified lately) if configCHECK_FOR_STACK_OVERFLOW is not 0.

    hth

    KnarfB