cancel
Showing results for 
Search instead for 
Did you mean: 

Why does task behavior change depending on priority in STM32 FreeRTOS?

eunoia
Associate II

I'm using an STM32G431 with FreeRTOS.

I have a total of 5 tasks, including the default task, and all of them were set to osPriorityLow.

With this configuration, the tasks did not run properly. When creating the tasks, NULL was not returned and no error occurred.

After changing all task priorities to osPriorityNormal, the problem was fixed.

I don't really understand why this happens. Each task has a reasonable osDelay(), so I don't think any specific task is blocking the others. Also, if a task were blocking, I would expect the same problem to happen even after changing the priority.

I also tried changing the heap size and the stack size, but that did not seem to be the cause.

Has anyone experienced a similar issue, or does anyone know why changing all tasks from osPriorityLow to osPriorityNormal would make a difference?

 

 

2 REPLIES 2
Andrew Neil
Super User

@eunoia wrote:

the tasks did not run properly.


What, exactly, do you mean by that ?

Please give details.

 

Note that there is a Windows port of FreeRTOS - perhaps use that to rule out anything STM32-specific?

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.
Pavel A.
Super User

osPriorityLow and osPriorityNormal are not priorities of FreeRTOS. They are defined in the CMSIS-RTOS wrapper. May be the behavior is caused by the CMSIS-RTOS wrapper that you use (provided by ST or custom).