If i use “workspace_dir” in combination with “upload_protocol = dfu” and “upload_port = anything”
platformio 4.0.0 concatenates the working directory with the “workspace_dir” when try to upload the binary.
Example:
working directory:
“/Users/user/Documents/PlatformIO/Projects/190711-160535-arduino-blink” and
“workspace_dir = /tmp/pio-build/$PROJECT_HASH”
I had to add -v to that to get it to show up… without that, it doesn’t show the concatonated path. I just used your platformio.io against an empty project, on a Ubuntu VM. I got exactly the same behaviour on Windows also.
ubuntu: pio run -t upload
Processing bluepill_f103c8_128k (platform: ststm32; board: bluepill_f103c8_128k; framework: arduino)
----------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/bluepill_f103c8_128k.html
PLATFORM: ST STM32 5.4.3 > BluePill F103C8 (128k)
HARDWARE: STM32F103C8T6 72MHz, 20KB RAM, 128KB Flash
DEBUG: Current (stlink) External (blackmagic, jlink, stlink)
PACKAGES: tool-stm32duino 1.0.1, framework-arduinoststm32 3.10500.190327 (1.5.0), toolchain-gccarmnoneeabi 1.70201.0 (7.2.1), tool-openocd 2.1000.190422 (10.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 7 compatible libraries
Scanning dependencies...
No dependencies
Checking size /tmp/pio-build/arduino-blink-ac05cfc543/build/bluepill_f103c8_128k/firmware.elf
Memory Usage -> http://bit.ly/pio-memory-usage
DATA: [ ] 4.5% (used 912 bytes from 20480 bytes)
PROGRAM: [= ] 8.3% (used 10916 bytes from 131072 bytes)
Configuring upload protocol...
AVAILABLE: blackmagic, dfu, jlink, stlink
CURRENT: upload_protocol = dfu
Looking for upload port...
Use manually specified: anything
Uploading /tmp/pio-build/arduino-blink-ac05cfc543/build/bluepill_f103c8_128k/firmware.bin
/home/pfeerick/.platformio/packages/tool-stm32duino/maple_upload: line 29: /home/pfeerick/.platformio/packages/tool-stm32duino/upload-reset: No such file or directory
No DFU capable USB device found
dfu-util 0.7
Copyright 2005-2008 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2012 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org
Filter on vendor = 0x1eaf product = 0x0003
Waiting for /dev/anything serial...Done
======================================================== [SUCCESS] Took 6.97 seconds ========================================================
vs
ubuntu: pio run -t upload -v
Processing bluepill_f103c8_128k (upload_protocol: dfu; platform: ststm32; upload_port: anything; board: bluepill_f103c8_128k; framework: arduino)
----------------------------------------------------------------------------------------------------------------------------------------------
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/bluepill_f103c8_128k.html
PLATFORM: ST STM32 5.4.3 > BluePill F103C8 (128k)
HARDWARE: STM32F103C8T6 72MHz, 20KB RAM, 128KB Flash
DEBUG: Current (stlink) External (blackmagic, jlink, stlink)
PACKAGES: tool-stm32duino 1.0.1, framework-arduinoststm32 3.10500.190327 (1.5.0), toolchain-gccarmnoneeabi 1.70201.0 (7.2.1), tool-openocd 2.1000.190422 (10.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 7 compatible libraries
Scanning dependencies...
No dependencies
MethodWrapper(["checkprogsize"], ["/tmp/pio-build/arduino-blink-ac05cfc543/build/bluepill_f103c8_128k/firmware.elf"])
Memory Usage -> http://bit.ly/pio-memory-usage
DATA: [ ] 4.5% (used 912 bytes from 20480 bytes)
PROGRAM: [= ] 8.3% (used 10916 bytes from 131072 bytes)
/tmp/pio-build/arduino-blink-ac05cfc543/build/bluepill_f103c8_128k/firmware.elf :
section size addr
.isr_vector 268 134217728
.text 10088 134217996
.rodata 792 134228084
.init_array 16 134228876
.fini_array 4 134228892
.data 36 536870912
.bss 876 536870948
._user_heap_stack 1536 536871824
.ARM.attributes 41 0
.comment 126 0
.debug_frame 116 0
Total 13899
<lambda>(["upload"], ["/tmp/pio-build/arduino-blink-ac05cfc543/build/bluepill_f103c8_128k/firmware.bin"])
AVAILABLE: blackmagic, dfu, jlink, stlink
CURRENT: upload_protocol = dfu
MethodWrapper(["upload"], ["/tmp/pio-build/arduino-blink-ac05cfc543/build/bluepill_f103c8_128k/firmware.bin"])
Use manually specified: anything
maple_upload anything 2 1EAF:0003 "/home/pfeerick/Documents/PlatformIO/Projects/arduino-blink//tmp/pio-build/arduino-blink-ac05cfc543/build/bluepill_f103c8_128k/firmware.bin"
/home/pfeerick/.platformio/packages/tool-stm32duino/maple_upload: line 29: /home/pfeerick/.platformio/packages/tool-stm32duino/upload-reset: No such file or directory
No DFU capable USB device found
dfu-util 0.7
Copyright 2005-2008 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2012 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org
Filter on vendor = 0x1eaf product = 0x0003
Waiting for /dev/anything serial...Done
======================================================== [SUCCESS] Took 7.23 seconds ========================================================