7

According to ST's user manual UM1722 "Developing wireless applications on STM32Cube with RTOS" there are two APIs available:

  • Generic CMSIS-RTOS API (v1 or v2)
  • FreeRTOS API

The CMSIS-RTOS API located in the CMSIS_RTOS_V2 folder generated by CubeMX is a collection of wrapper functions for FreeRTOS API. The CMSIS-RTOS functions are used in the examples shipped with STM32Cube FW package.

My question is when one should use CMSIS-RTOS API and when FreeRTOS API?

Fedor Chervyakov
  • 71
  • 1
  • 1
  • 3

2 Answers2

3

This is almost 100% opinion based answer. I personally do not like CMSIS wrappers. There is to much silly (IMO) macros and hidden objects created by them. I actually prefere freeRTOS API if I use freeRTOS.

It makes also debugging more difficult.

0___________
  • 2,458
  • 10
  • 25
1

CMSIS-RTOS is a standarized RTOS abstraction from ARM. You can us it for example with FreeRTOS or Keil RTX.

A oversimplified analogy may be POSIX - you can basically compile the same code on Linux, BSD and MacOS.

A good use case can be migration. If you eventually want to migrate (on ARM CPUs) from FreeRTOS to a different RTOS, then use the CMSIS API. If you want to migrate from ARM CPUs to a different architecture (eg. RISC-V), then use FreeRTOS API.

filo
  • 8,801
  • 1
  • 25
  • 46