Thanks for your valuable input. I experienced the same: the hid-flash tool of PlatformIO is outdated and can not cope with the 2.2.1 bootloader.
After copying the executable into the platform-IO tools directory, the upload works.
But I had to use a slightly changed environment I want to share:
Code: Select all
[env:bluepill_f103c8_128k]
platform = ststm32
board = bluepill_f103c8_128k
framework = arduino
upload_protocol = hid
upload_port = COM8
build_flags =
-D PIO_FRAMEWORK_ARDUINO_ENABLE_CDC
-D USBCON
-D USB_VID=0x0483
-D USB_MANUFACTURER="Unknown"
-D USB_PRODUCT="\"BLUEPILL_F103C8\""
-D HAL_PCD_MODULE_ENABLED
lib_extra_dirs = ~/Documents/Arduino/libraries
Please be aware of "USB_VID"! That key was more or less a good guess after looking into the log files.
The upload_port depended on the port Windows (in my case) set up the device as 'STM Device'.