PlatformIO for Education

Dear all,

My name is Rubén San-Segundo professor at UPM (Madrid, Spain). I am interesting on using PlatformIO in my microcontroller courses. I would like to use this board: STM32F411RE.

I’d like to ask if it is possible to work with this board but using a “naked” micro, without any precompiled library. I have worked using several Frameworks but I did not find any example without any lib.

Many thanks,

Rubén San-Segundo.

Yes, by removing the framework = ... line in the platformio.ini, PIO will not compile any framework files for the project. This is showcased e.g. in the Atmel-AVR native blink example.

When going bare-metal you should use your own linker and startup file though. For the startup file, simply copy the .S file in the source folder. The linkerscript can be selected through build_flags = -Wl,-T<path to ld file> (docs).

I actually have a baremetal example for a native blinky (just with NVIC, SysTick and direct GPIO access) for a STM32F103C8 (bluepill), I’ll see if I can upload it.

Thanks you so much for the información. I appreciate It so much. An example would be great!! Many thanks.

Best,

Rubén San Segundo

Sorry for taking so long, I kinda forgot about this.

I found my example again and uploaded it to GitHub - maxgerhardt/pio-stm32-native-blink: An example project for programming an STM32 microcontroller without any framework.

Right now it works but it’s not very well documented, regarding basic info like how the isr_vector object interacts with the used linker script, how NVIC and SysTick access is done and how pin PC13 is toggled. I’ll add some documentation later. Also has some dead unused code that needs to be removed.

No problem at all. Many thanks!!! It helps a lot.
Best