platformio / platform-ststm32

ST STM32: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/ststm32
Apache License 2.0
390 stars 305 forks source link

Expand stm32cube builder script to build CMSIS-RTOS2 component #481

Open maxgerhardt opened 3 years ago

maxgerhardt commented 3 years ago

Per https://community.platformio.org/t/cant-find-cmsis-rtos2-on-nucleo-l452re-with-stm32cube-framework/18713.

The current builder script only uses a few things from the Drivers/CMSIS folder of the STM32Cube package, namely "Device" and "DSP".

https://github.com/platformio/platform-ststm32/blob/a1e85ff37ced73048b23b3c99eba6b1b0c6f9dc4/builder/frameworks/stm32cube.py#L202-L227

It would be nice to also configurably be able to build the other components in there, namely CMSIS-RTOS2 (I'm ignoring the older CMSIS-RTOS here) and maybe CMSIS-NN for neural networks.

grafik

maxgerhardt commented 3 years ago

Problem: The STM32Cube package doesn't contain the actual core code (RTX) from CMSIS-RTOS2!

grafik

Compare to https://github.com/ARM-software/CMSIS_5/tree/develop/CMSIS/RTOS2, the entire RTX folder is missing.

Is this due to licensing issues? Or does STMicroelectronics just doesn't deliver these files?

tcaputi commented 3 years ago

The code that STMCubeMx generates also doesn't include that. I think that it tries to use FreeRTOS for all of the internals. I believe all the code is there, its just not setup to build that code. I could be wrong though.

valeros commented 3 years ago

For some reason they don't include that files in the official STM32Cube packages (e.g. https://github.com/STMicroelectronics/STM32CubeF4/tree/master/Drivers/CMSIS/RTOS2) even though the RTX RTOS has a permissive license.