Platformio help

Platformio help

Some snippets to plataformio.ini

Select Arduino Cores for Bluepill STM32F103C8 on platformio

# for using the rogerclarkmelbourne arduino stm32 core (maple)
# https://github.com/rogerclarkmelbourne/Arduino_STM32
board = genericSTM32F103C8
board_build.core = maple

# for using the stm32duino st core
# https://github.com/stm32duino/Arduino_Core_STM3
board = bluepill_f103c8

Select Upload mode on platformio

# send by usb
upload_protocol = dfu
upload_port = anything

# send by usb method 2
upload_protocol = hid
upload_port = anything
build_flags =
-D PIO_FRAMEWORK_ARDUINO_ENABLE_CDC
-D USBCON
-D USB_VID=0x0483
-D USB_MANUFACTURER=”Unknow”
-D USB_PRODUCT=”\”BLUEPILL_F103C8\””
-D HAL_PCD_MODULE_ENABLE

# send by st-link v2
upload_protocol = stlink
correct the error
# Warn : UNEXPECTED idcode: 0x2ba01477
# Error: expected 1 of 1: 0x1ba01477
upload_flags = -c set CPUTAPID 0x2ba01477
##debug_tool = stlink

# send by serial FTDI
upload_protocol = serial
##debug_tool = ftdi

Select upload port
upload_port = /dev/ttyUSB0
upload_port = /dev/ttyACM0
upload_port = anything

Serial Monitor

monitor_speed = 115200

Select the task to run

Show the message, select the task to run, and show an menu for selecting itens.

Happens sometimes. For example: when we just create a new project in platformio,

Solution

Close the vscode/platformio, and run it again.