cancel
Showing results for 
Search instead for 
Did you mean: 

How to implement CMSIS RTOS v2 Task Notification

Xxoyo.1
Associate III

Hi all, 

I want to ask how to use/implement the FreeRTOS task notifications (https://www.freertos.org/RTOS-task-notifications.html)? 

I cannot find any of the CMSIS v2 API to use , even though I already enabled the USE TASK NOTIFICATION option in STM32CubeMX. I must use the v2 API since TouchGFX is using this too...

0693W000007ZXPvQAO.png 

Any helps are appreciated!

3 REPLIES 3
Nikita91
Lead II

CMSIS is necessarily limited to a few essential OS functionalities. It will never be able to provide all the specific functionalities of each OS. So use the native OS API for these functions.

Overall I do agree, but in this particular case there is a thread flag API, which should be implemented based on FreeRTOS task notifications:

https://www.keil.com/pack/doc/CMSIS/RTOS2/html/group__CMSIS__RTOS__ThreadFlagsMgmt.html

Does that mean the thread flag API is a renamed of FreeRTOSes "task notification"?

I checked that the CMSIS v2 Thread Flags API uses FreeRTOS Task Notifications

  • xTaskNotifyFromISR
  • xTaskNotifyAndQueryFromISR

If this was the case, then the naming from TaskNotify to Thread Flag is a bit different then the conventional naming in CMSIS v2.

However I am glad that I wont need to change much of the code to implement task notification.

Normally you'd find the same name in both the APIs, xSemaphoreGive and osSemaphoreRelease.

But this time its TaskNotify to ThreadFlag ...