cancel
Showing results for 
Search instead for 
Did you mean: 

Is CMSIS-RTOS2 code generation supported in MX2?

gil_dobjanschi
Associate III

Hello,

 

Is there a way to generate code with MX2 by using the CMSIS-RTOS2 API vs the FreeRTOS API? I cannot find a setting in the FreeRTOS configuration to specify that I would like to use the CMSIS-RTOS2 API.

 

Thank you,

-GIl

1 ACCEPTED SOLUTION

Accepted Solutions
Khaled_DHIF
ST Employee

Hello @gil_dobjanschi ,

No. In the current STM32CubeMX2 flow for STM32C5, code generation exposes the native FreeRTOS kernel API directly and does not provide a CMSIS-RTOS2 abstraction layer. That’s why there is no setting to select CMSIS-RTOS2 in the FreeRTOS configuration.

Kind regards, 

DHIF Khaled

Please mark my answer as best by clicking on the “Accept as solution" button if it fully answered your question. This will help other users find this solution faster.​

View solution in original post

5 REPLIES 5
Khaled_DHIF
ST Employee

Hello @gil_dobjanschi ,

No. In the current STM32CubeMX2 flow for STM32C5, code generation exposes the native FreeRTOS kernel API directly and does not provide a CMSIS-RTOS2 abstraction layer. That’s why there is no setting to select CMSIS-RTOS2 in the FreeRTOS configuration.

Kind regards, 

DHIF Khaled

Please mark my answer as best by clicking on the “Accept as solution" button if it fully answered your question. This will help other users find this solution faster.​
Andrew Neil
Super User

As @Khaled_DHIF said, ST do not provide this.

But FreeRTOS is an independent, 3rd-party product - so there's nothing to stop you doing it yourself.

 

eg, see: Where to find if specific STM32 MCU supports specific CMSIS-RTOS version?

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.
gil_dobjanschi
Associate III

Thank you @Khaled_DHIF and @Andrew Neil !

Pavel A.
Super User

Option to generate for CMSIS-RTOS can be interesting, especially for education users.

Some people already tried to fiddle the generation templates. Maybe it still is possible with MX2.

If not - perhaps the usual AI coding things can be tasked to convert FreeRTOS code to CMSIS-RTOS?

 

gil_dobjanschi
Associate III

Hi @Pavel A. 

 

For what is worth I ended up using FreeRTOS API. In my case the benefit to have the API mapping wasn't that great because I do not expect users to switch RTOS. Additionally, I am using xQueueCreateSet which I could not map to an API in CMSIS-RTOS2 as far as I can tell.

 

Your suggestion to use AI to generate the code is a viable one. I used Claude to generate the code and it looks reasonable. I did not look at it in detail but with a bit of determination it can be done. One just needs the clear motivation.

 

Regards,

-GIl