Skip to main content
Xxoyo.1
Associate III
February 26, 2021
Question

How to implement CMSIS RTOS v2 Task Notification

  • February 26, 2021
  • 1 reply
  • 6297 views

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!

This topic has been closed for replies.

1 reply

Nikita91
Lead II
February 26, 2021

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.

Piranha
Principal III
February 27, 2021

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

Xxoyo.1
Xxoyo.1Author
Associate III
March 3, 2021

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 ...