Programming STM32F boards
I got three versions of STM32F boards, one Cortex-M3 and two Cortex-M4’s:STM32F103C8T6 Arm Cortex-M3 MCU, 80 DMIPS, 64KB Flash / 20KB RAM, 72 MHz
STM32F401CCU6 Arm Cortex-M4 MCU+FPU, 105 DMIPS, 256KB Flash / 64KB RAM, 84 MHz
STM32F411CEU6 Arm Cortex-M4 MCU+FPU, 125 DMIPS, 512KB Flash / 128KB RAM, 100 MHz
Uploading with UART and PlatformIO
To upload a blink sketch I connected a CP2102 Serial-USB converter to the following STM32F-pins: 3V3, GND, PA9 USART1_TX and PA10 USART1_RX. The blink sketch uses the on-board led PC13 (LOW=active).
The default STM32F103C8 protocol for PlatformIO is stlink, so first add upload_protocol = serial
to platformio.ini
.
Other issue with PlatformIO: the installed version 0.4 of stm32flash.exe does not suffice for the STM32F411CEU6 and it needs to be updated to v0.5 or higher (I used v0.6) using https://sourceforge.net/projects/stm32flash/ and saved to .platformio/packages/tool-stm32duino/stm32flash/stm32flash.exe
.
Uploading with USB
To use the USB-port of the STM32F103C8, follow the instructions to upload a software-bootloader with STM32CubeProgrammer and the right bootloader binary generic_boot20_pc13.bin. My board has a 10K resistor at R10, which first needs to be replaced with an 1,5K. To be continued…
Both STM32F4’s contain a ROM-bootloader and they need no preparations. The USB can be used with upload_protocol = dfu
in platformio.ini
. With the BOOT and RESET keys the usb-port becomes available.


