cancel
Showing results for 
Search instead for 
Did you mean: 

CMSIS RTOS v2 projects - confusion about headers: cmsis_os.h or cmsis_os2.h ?

NickO
Associate III

Hi

 

In the past 6 months, I created a project for an STM32H755. For middleware, I selected CMSIS RTOS v2 (using FreeRTOS underneath).

I noted that the header file is cmsis_os.h, which at first seemed wrong. I (maybe naively) asked the "AI", and with it's usual confident tone, suggested I change them (however, this is hard to maintain if you change your .ioc file).

Looking at past posts on these forums, and inside cmsis_os.h, I confirmed that cmsis_os2.h is indeed included within it (despite the AI not finding this).

So, I challenged the "AI", stating what I had found. Of course, in it's somewhat complimentary way, it agreed with me, but still insisted that if I am using entirely v2 APIs, I should change the headers.

Of course, such responses derive from human content written elsewhere, and I fear it may not backed by actual facts. I have left the headers as they are for now. I have a bad feeling about changing them as ST might have reasons to do things the way they have.

 

So, is it good practise (or a bad idea) to change all #include "cmsis_os.h" to "cmsis_os2.h" ? 

 

 

 

11 REPLIES 11

Thanks for responding.

The CMSIS API appeals as it makes it easier to switch OS (e.g. as part of a strategy for adding diversity into safety critical applications).

I do appreciate what you say, but when I created the project, I specifically selected v2 of the API. However, the include headers generated by Cube IDE are the same for v1 which seemed odd at first.

The consensus is that this is not a bug as some (human and otherwise) suggested elsewhere. The suggestion to change it to cmsis_v2.h might seem sensible, but until I see a definitive statement to say this is safe and best practise from ST, I shall leave it and just check I am using the latest APIs myself.

 

 

Hi

 

Many thanks for this.

I just checked Cube IDE 1.19.0, Cube 1.12.1 for STM32H755 (maybe Cube MX is different?).

It is still using cmsis_os.h

Maybe the next version will change this. I shall look out for it.

 

Regards