I was trying to use HID upload protocol with these build configs on PlatformIO 4.3.1 :
[env:bluepill_f103c8]
platform = ststm32
board = bluepill_f103c8
framework = arduino
upload_protocol = hid
upload_port = /dev/cu.usbmodem*
build_flags =
-D PIO_FRAMEWORK_ARDUINO_ENABLE_CDC
-D USBCON
-D USBD_VID=0x0483
-D USB_MANUFACTURER="Unknown"
-D USB_PRODUCT="\"BLUEPILL_F103C8\""
-D HAL_PCD_MODULE_ENABLED
And this error keep showing up :
> Auto-detected: /dev/cu.usbmodem8784376954571
> Uploading .pio/build/bluepill_f103c8/firmware.bin
> sh: hid-flash: command not found
> *** [upload] Error 127
After i copied “/.platformio/packages/framework-arduinoststm32-maple/tools/macosx/hid-flash” into “/.platformio/packages/tool-stm32duino” the problem was solved !