I installed VSCode and the PlatformIO extension to see if this board can be used with pio. It works!
Steps to reproduce:
Project setup
- in PlatformIO home tab, import Project Examples - stm32cube-hal-blink
- modify platformio.ini to have the following content (it might be ok to omit some settings, I'm not sure):
[env:demo_f030f4] ;platform = ststm32 platform = https://github.com/platformio/platform-ststm32.git framework = stm32cube board = demo_f030f4 build_flags = -DF0 ; change microcontroller board_build.mcu = stm32f030f4p6 ; change MCU frequency board_build.f_cpu = 48000000L upload_protocol = stlink
Just using "ststm32" as platform doesn't work because there's a problem with the F030F4 startup code, see issue here: https://github.com/platformio/platform-ststm32/issues/234. So we need the github platform. - Main already has blink code, but this breakout board's LED is connected to GPIO port B, pin 1. So change the port settings to (also pay attention to the clock enable macro, which needs to be changed to port B, too):
#define LED_PIN GPIO_PIN_1 #define LED_GPIO_PORT GPIOB #define LED_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
(somewhere around line 24)
Hardware setup
Connect an ST-Link to the breakout board and supply 3.3 V to VDD (the ST-Link connection will not supply power!). See here: https://hackaday.io/project/4277/gallery#52043e53586461bb2bbb51046f9c2334
Build and upload
should work out of the box. If upload fails, check udev rules and dialout group stuff as described here: https://docs.platformio.org/en/latest/plus/debug-tools/stlink.html#debugging-tool-stlink
Sometimes replugging the USB cable or a manual reset can also be helpful.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.