Skip to main content
Harvey White
Senior III
October 19, 2026
Question

CMSIS_OS2 proper priorities when overlaid on FreeRTOS

Transitioning a working FreeRTOS project over to CMSIS_os2.  Got most of the bits and pieces to compile.  It’s not working (surprise).

At the  simplest level, the patch of code that turns on an LED, then calls osDelay does not delay.  

investigating the problem using vTaskDelayUntil (and bypassing the CMSIS_OS2 wrapper for this one call to eliminate the possibility that the error is in how the cmsis_os2 routine is somehow wrong), the problem is that the xTickCount never increments.  (HAL TICK works and increments).

This triggers an error routine because the new timetowake is computed as less that the existing time.  

Therefore, no delays.

Going through error reports suggests that the TickCount interrupt never triggers.  This seems to be true.

My thought is that the default priorities that are assigned are wrong, so in cmsis, which assigns interrupt priorities, is getting it wrong.  The main task is at priority 24 (PriorityNormal).   Tasks created for LED blinking are set at priority 26 and use osDelay (which calls vTaskDelay).

Any thoughts (code works with not using cmsis threads, so I’m blaming setups.