cancel
Showing results for 
Search instead for 
Did you mean: 

Problem: If I set RTOS task priority to value higher than osPriorityNormal causes a Hard Fault when running on STM32F47xx. Has anyone else encountered this?

cjwilde
Associate II

I'm running CubeMX 5.1 with FW_F4 V1.24.0 and Atollic TrueStudio 9.3.0. I have eleven RTOS tasks defined in CubeMX, but only one is actually invoked with its StartTask routine. As long as the priority on the task is osPriorityNormal(0) or lower, the code runs on my STM32F407 Discovery board. If I assign a higher priority (AboveNormal, High, RealTime), the code halts in the Hard Fault Handler routine. The actual fault is a Bus Fault, precise data access violation. This version of CubeMX/FW_F4 requires the use of CMSIS RTOS.

Has anyone else run into this problem? As a workaround, I'm limiting the tasks to the priority levels of Idle, Low, BelowNormal and Normal.

cjwilde

1 ACCEPTED SOLUTION

Accepted Solutions

Sufficient stack?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

3 REPLIES 3
Rogers.Gary
Senior II

Curious - did you define all your tasks in CubeMX and let it generate prototypes? When you say "StartTask", are you referring to the "Default task" it creates?

Sufficient stack?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Good suggestion. I added some code to the vApplicationStackOverflowHook function, and the function is called. If I increase the Stack size from 126 to 192, I don't see the error. I was looking for an indication of Stack Overflow in the FreeRTOS Task List, like what I see in TI CCS' ROV view, but nothing flagged the error.