I’m still confused regarding the boards and chips you have. You mention a Blue Pill (STM32F103C8), Discovery board with STM32F100RBT6 and in platfromio.ini
you also have declared a Discovery board with a STM32F051R8.
STM32F100RBT6
If you have an STM32F100RBT6, then it’s missing in the platformio.ini
that you have post two posts ago.
I can easily get an Arduino blink sketch to compile if the board is set to disco_f100rb
with this configuration:
[env:disco_f100rb]
platform = ststm32
board = disco_f100rb
framework = arduino
STM32F041R8
If you have a STM32F051RB, then you have to resort to STM32Cube (HAL).
Given this platformio.ini
configuration:
[env:disco_f051r8]
platform = ststm32
board = disco_f051r8
framework = stm32cube
I can easily get your STM32Cube code to compile if I simplify the #include statements. Instead of all the #ifdef and #includes, I just use:
#include <stm32f0xx.h>
No need for any additional build settings.
Build Settings
I’m not sure if the build setting -DF1
is really needed. In the above working examples, I didn’t need them and I’ve nevr used them before.
If you really have an STM32F051R8 and the setting is needed, then it’s -DF0
as this chip is from the F0 family.
The combination of STM32F051R8 and -DF1
is certainly invalid.