This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

F29H850TU: Best approach to detecting Stack overflow for implementing System Traps in a FreeRtos based application on F29H850TU

Part Number: F29H850TU

Tool/software:

Hello,

I am currently investigating different approaches for setting stack overflow detection for implementing System Traps on F29H850TU platform.

Is there a guide or tutorial available on this topic?

  • Hi Mrinali,

    For detection of overflow on FreeRTOS stacks, you can use kernel provided functionality like the configCHECK_FOR_STACK_OVERFLOW  macro and stack overflow hooks. More information can be found on this page in the FreeRTOS official website

    For the main system software stack (which will be used before the scheduler starts, as well as for INTs), you can use standard methods such as filling it with a known value. You can also leverage the ERAD IP to detect stack overflow, example code for this can be found in the examples/driverlib/single_core/erad folder of the F29H85x SDK. (RTINTs have built in stack overflow warning systems, check out WARNRTISP)

    Regards,

    Arnav 

  • Thanks for sharing the link Arnav. The link primarily addresses FreeRtos based detection.

    Are there HW based mechanisms (using SSU/ ECC / MPU ) that can enable stack overflow detection in F29H850TU?

    Similar to circular buffer registers (allowing stack overflow detection) on certain DSP platforms?

  • In terms of hardware-based solutions, the aforementioned ERAD IP provides a direct method to check for stack overflows. More information on this can be found in the TRM 

    The SSU is a comprehensive safety sub-system for enabling memory protection, code isolation, debug and firmware update permission accesses etc. It may be possible to implement a form of overflow protection using these features, but this would mean enabling most of the other safety & security functionality as well, so it is not recommended for this use-case unless explicitly required.

    Regards,

    Arnav