Default scetch build/upload fails when it tries to create DFU zip file
exec: “adafruit-nrfutil”: executable file not found in $PATH
Error compiling for board Seeed XIAO nRF52840 Sense.
Offending build line
adafruit-nrfutil dfu genpkg --dev-type 0x0052 --sd-req 0x0123 --application /tmp/arduino_build_977951/sketch_jul24a.ino.hex /tmp/arduino_build_977951/sketch_jul24a.ino.zip
adafruit-nrfutil is actually installed and is in Linux’s $PATH:
alex@Ubuntu:~$ adafruit-nrfutil version
adafruit-nrfutil version 0.5.3.post16
alex@Ubuntu:~$ which adafruit-nrfutil
/home/alex/.local/bin/adafruit-nrfutil
strong textalex@Ubuntu:~$ echo $PATH
/home/alex/.local/bin:/home/alex/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/home/alex/bin:/home/alex/.local/bin
I thought the problem is in
./.arduino15/packages/Seeeduino/hardware/nrf52/1.1.8/platform.txt
recipe.objcopy.zip.pattern="{tools.nrfutil.cmd}" dfu genpkg --dev-type 0x0052 --sd-req {build.sd_fwid} --application “{build.path}/{build.project_name}.hex” "{build.path}/{build.project_name}.zip"
whereas
tools.nrfutil.cmd=adafruit-nrfutil
So, I modified the last line(s) as following
tools.nrfutil.path=/home/alex/.local/bin
tools.nrfutil.cmd={tools.nrfutil.path}/adafruit-nrfutil
But for some reason changes in platform.txt file are not affecting Arduino build, even after full restart
What am I missing ? Is there any other configuration I need to change to point Arduino to the right path to this util ?
Hi there,
and welcome here,
Which BSP are you using as I suspect it’s not the correct one?
Which board and which BSP?
AFAIK , In linux you don’t want the path to be that long to the system. YMMV
which os is this?
HTH
GL
PJ
![:v: :v:](https://forum.seeedstudio.com/images/emoji/twitter/v.png?v=12)
Turns out I edited the wrong platform.txt
.arduino15/packages/Seeeduino/hardware/nrf52/1.1.8/platform.txt
instead of
snap/arduino/85/.arduino15/packages/Seeeduino/hardware/nrf52/1.1.8/platform.txt
But now a new error on the same line:
/home/alex/.local/bin/adafruit-nrfutil --verbose dfu genpkg --dev-type 0x0052 --sd-req 0x0123 --application /tmp/arduino_build_509375/sketch_jul24a.ino.hex /tmp/arduino_build_509375/sketch_jul24a.ino.zip
fork/exec /home/alex/.local/bin/adafruit-nrfutil: permission denied
Error compiling for board Seeed XIAO nRF52840 Sense.
The file has execution permission for everyone
alex@Ubuntu:~$ ls -l /home/alex/.local/bin/adafruit-nrfutil
-rwxrwxr-x 1 alex alex 216 Jul 24 11:34 /home/alex/.local/bin/adafruit-nrfutil
and I can invoke this from Linux trerminal
alex@Ubuntu:~$ /home/alex/.local/bin/adafruit-nrfutil
Usage: adafruit-nrfutil [OPTIONS] COMMAND [ARGS]…
Options:
–verbose Show verbose information
–help Show this message and exit.
Commands:
dfu This set of commands support Nordic DFU OTA package generation…
keys Generate keys for signing or generate public keys
version Displays nrf utility version.
alex@Ubuntu:~$
Thank you PJ !
Linux version of Arduino seem to be generally more finicky,
I tried Windows (where adafruit-nrfutil comes prebuilt) and example sketch built and uploaded right away.
I still want to get Linux going though, find it immensely more convenient
-Alex
1 Like