Uploading firmware to Nano Every via command-line on Linux


I am currently trying to upload HEX files to my Arduino Nano Every from my headless Raspberry Pi (latest version of Raspberry Pi OS/Debian). Usually (with my other boards such as MEGA and Uno), I can use something like this...

"sudo avrdude -c linuxspi -P /dev/spidev0.0 -p m2560 -F -U flash:w:project.cpp.hex -U lfuse:w:0xFF:m -U fhuse:w:0xD8:m -U efuse:w:0xFD:m -U lock:w:0x0F:m"

Now my understanding that the Every has a different way of uploading firmware; UPDI, which is not supported by the default AVRdude config file. So, I downloaded the JTAG2UPDI config file for AVRdude and gave it another go...

"sudo avrdude -c jtag2updi -P /dev/ttyACM0 -p m4809 -F -U flash:w:v1.cpp.hex -C /home/pi/ArduinoARM32/jtag2updi-master/avrdude.conf"

I get the following output:

"avrdude: jtagmkII_recv_frame(): timeout
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: jtagmkII_recv_frame(): timeout
avrdude: jtagmkII_getsync(): sign-on command: status -1"

Does anyone know how to get this working, or has an alternative program to AVRdude that can handle this protocol? Any help/pointers would be appreciated!

EDIT: I forgot to mention:

I am trying to upload via the micro-USB interface, and can upload via this interface through the Arduino IDE, but I need to be able to upload HEX files via command-line.

I have also tried the following command that Arduino generated, with no luck:

"/home/pi/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude -C/home/pi/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf -v -patmega4809 -cjtag2updi -P/dev/ttyACM1 -b115200 -e -D -Uflash:w:/tmp/arduino_build_525165/v1.ino.hex:i -Ufuse2:w:0x01:m -Ufuse5:w:0xC9:m -Ufuse8:w:0x00:m {upload.extra_files} "


This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.