PlatformIO stm32cube framework isn't complete


I am using PlatformIO to program the STM32 F7 discovery board. The STM32Cube package is in the PlatformIO’s framework registry and HAL&CMSIS drivers are working out of the box without problems.

Since I am not using any RTOS and only trying small examples at the moment, I noticed that the PlatformIO version of stm32cube is not complete. It (for example) doesn’t include BSP drivers and it doesn’t include STemWin library.
Why is that? At the moment I am using manually downloaded STM32CubeF7 package and including BSP drivers manually and unsucessfully including STemWin library manually as well. It involves a lot of “hacking” around (include paths, compilation options etc.), which doesn’t make sense- since the stm32cube (and PIO library manager) was designed to “make developer’s life easier”

It’s confusing that the PIO version of stm32cube is not the same as the “official” one. If there’s some reason I missed in all this? Would it be possible to make BSP and Middlewares (STemWin) “official” libraries, so you could add them via PIO Library Manager?

Also, the official PIO version of the BSP library is compatible only with mbed framework. Why couldn’t one use it only with stm32cube framework (HAL)…? I could find and official or complete STemWin library in the PlatformIO library registry.

Thank you for help,


Same issue with the STM32F3 Discovery board. It is very inconvenient that the packages supplied by STM32Cube officially are not in the PIO framework that is installed.


@valeros could you help here?


PlatformIO build script for stm32cube doesn’t cover build logic for third-party software like STemWin and other so that part was stripped out from the original package. Additionally, that helped us make the package much smaller in size. As a workaround, you could extract required parts from the original package and add them to your PlatformIO project as separate libraries (with individual build logic).


Thanks for the reply @valeros

Would adding the BSP folder from the original package to the ~/.platformio/packages/framework-stm32cube/f3/Drivers folder work as well? I wouldn’t want to keep adding the library to every single project individually if possible.


You can put them to global storage

If you need custom build logic per a library/component, please take a look at library.json and “build” field.