I’m running a PlatformIO build under Ubuntu for a Longan Nano board.
This is the platformio.ini file:
[env:sipeed-longan-nano]
platform = gd32v
framework = gd32vf103-sdk
board = sipeed-longan-nano
monitor_speed = 115200
When I run the build it fails with the error dfu-suffix not found
:
$ $HOME/.local/bin/platformio run -d stepper -v
Processing sipeed-longan-nano (platform: gd32v; framework: gd32vf103-sdk; board: sipeed-longan-nano; monitor_speed: 115200; upload_protocol: dfu)
...
bin/dfu-suffix -v 0x28e9 -p 0x0189 -d 0xffff -a .pio/build/sipeed-longan-nano/firmware.bin
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
sh: 1: bin/dfu-suffix: not found
RAM: [= ] 7.9% (used 2574 bytes from 32768 bytes)
*** [.pio/build/sipeed-longan-nano/firmware.bin] Error 127
Flash: [= ] 6.8% (used 8884 bytes from 131072 bytes)
text data bss dec hex filename
8764 120 2454 11338 2c4a .pio/build/sipeed-longan-nano/firmware.elf
============================================== [FAILED] Took 0.78 seconds ========
I have the dfu-utils
package installed, and the dfu-suffix
command is available:
$ dpkg -l | grep dfu
ii dfu-util 0.8-1 amd64 Device firmware update (DFU) USB programmer
$ which dfu-suffix
/usr/bin/dfu-suffix
Why is the platformio
command trying to invoke the dfu-suffix
command with the relative pathname bin/dfu-suffix
? Is that intended? I found this in the file ~/.platformio/platforms/gd32v/builder/main.py
:
# Add special DFU header to the binary image
env.AddPostAction(
join("$BUILD_DIR", "${PROGNAME}.bin"),
env.VerboseAction(
" ".join([
join(platform.get_package_dir(
"tool-dfuutil") or "", "bin", "dfu-suffix"),
"-v %s" % vid,
"-p %s" % pid,
"-d 0xffff", "-a", "$TARGET"
]), "Adding dfu suffix to ${PROGNAME}.bin"))
How is the dfu-suffix
command expected to be installed so it can be invoked by the platformio
command?