I believe I have notices a bug in the vTaskPrioritySet( TaskHandle_t xTask, UBaseType_t uxNewPriority )
The “configASSERT( ( uxNewPriority < configMAX_PRIORITIES ) )” fails when priority is set to osPriorityBelowNormal or lower due to “UBaseType_t uxNewPriority” being a "unsigned long.
My code was generated by STM CUBE for STM32L071 Cortex M0 microcontroller.
vTaskPrioritySet does not use the CMSIS priority levels defined in the enum osPriority, but numbers in the range of 0 (lowest) to (configMAX_PRIORITIES-1). There will be a CMSIS layer function that maps the CMSIS priorities to the native FreeRTOS priorities, or you can just use the number of the actual FreeRTOS priority you want.
cmsis_os.c was generated by STM CUBE as a package. I believe that the whole bundle - the freertos and HAL libraries are well written. There are things I would have done differentley but for the sake of fast developement, I have no intention to poke around the generated code, if not needed.
I only want to understand the workings behind it so I know what options I have and to be carefull of these little traps in the future projects.
Maby my post was a bit premature, but I am glad to see that the forum is very responsive!