cancel
Showing results for 
Search instead for 
Did you mean: 

Adding a variable breaks the build - Is it possible to see the memory boundaries of individual RTOS tasks?

Chandler
Associate II

I am assuming this is a memory boundary issue, but maybe it is something else: I have an application that runs just fine, using a simple push button interrupt serviced by its own Free RTOS task, which is suspended until triggered. For some reason, when I add a completely unrelated variable to the Touch GFX model class **larger than a bool type**, the task throws a hard fault. It's like I'm on a boundary; I've increased task sizes beyond anything reasonable to expect, but still adding that one variable to the .hpp file breaks the build. Any similar experiences to share are appreciated.

5 REPLIES 5
KnarfB
Principal III

FreeRTOS has a config for Stack checking, see https://www.freertos.org/Stacks-and-stack-overflow-checking.html. This may help validating that you have allocated enough stack space for each task.

hth

KnarfB

mattias norlander
ST Employee

Are you using C library functions like printf/strtok/...? If so, are have you added the thread-safe solution?

In the CubeIDE User Guide you find a lot of info on how to compile FreeRTOS to use the FreeRTOS debug views. These views may give you a clue.

Chandler
Associate II

Thank you for that advice. I will investigate.

Thank you

Thanks for the advice. I will investigate.