STM32CubeMX porting to PlatformIO’s STM32Cube framework

Maruti Muthu
2 min readJul 11, 2021

If VSCode feels like home, Platform.io is currently one of the more developer friendly platform for embedded development. It offers support to program a variety of micro-controllers and micro-processors and comes with Integrated Debugger.

Photo by Alexandre Debiève on Unsplash

Following steps will work with the STM32 F1, F4 and L0 series. (Check on PlatformIO for full list.)

STEP 1:

Configure the chip on STM32CubeMX as required and save the project.

Tip: Turn on Serial Wire Debug!

Project Structure:

After saving the project folder should look something like this.

STEP 2: Create a STM32Cube Project on PlatformIO

Open PlatformIO on VSCode and create New Project

Enter name and select board and framework

PlatformIO project structure should look like this

STEP 3: Copy Inc and Src Contents of CUBEMx into PlatformIO src folder

STEP 4: Build the project (ctrl + alt + B)

The project should now build successfully!

--

--