Skip to main content
cjwilde
Associate II
April 30, 2019
Solved

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?

  • April 30, 2019
  • 3 replies
  • 1754 views

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

This topic has been closed for replies.
Best answer by Tesla DeLorean

Sufficient stack?

3 replies

Rogers.Gary
Senior II
April 30, 2019

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?

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
April 30, 2019

Sufficient stack?

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
cjwilde
cjwildeAuthor
Associate II
April 30, 2019

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.