Hi pert, I did what you suggested. I replaced the arduino upload command with the raw avrdude and ran the script. The script then printed the help of avrdude, as expected, and without any errors, at least that I can see…
Usage: avrdude [options]
-p <partno> Required. Specify AVR device.
-b <baudrate> Override RS-232 baud rate.
-B <bitclock> Specify JTAG/STK500v2 bit clock period (us).
-C <config-file> Specify location of configuration file.
-c <programmer> Specify programmer type.
-D Disable auto erase for flash memory
-i <delay> ISP Clock Delay [in microseconds]
-P <port> Specify connection port.
-F Override invalid signature check.
-e Perform a chip erase.
-O Perform RC oscillator calibration (see AVR053).
Memory operation specification.
Multiple -U options are allowed, each request
is performed in the order specified.
-n Do not write anything to the device.
-V Do not verify.
-u Disable safemode, default when running from a script.
-s Silent safemode operation, will not ask you if
fuses should be changed back.
-t Enter terminal mode.
-E <exitspec>[,<exitspec>] List programmer exit specifications.
-x <extended_param> Pass <extended_param> to programmer.
-y Count # erase cycles in EEPROM.
-Y <number> Initialize erase cycle # in EEPROM.
-v Verbose output. -v -v for more.
-q Quell progress output. -q -q for less.
-l logfile Use logfile rather than stderr for diagnostics.
-? Display this usage.
avrdude version 6.3-20190619, URL: <http://savannah.nongnu.org/projects/avrdude/>
To me, this suggests that avrdude can in fact run correctly but for whatever reason just doesn’t.
But I think I can do a workaround: Something I forgot to mention is, as part of the download/upload to Arduino routine I also call the Arduino CLI with the --verify option and that seems to work without problems. I know there is the option to keep the temporary files that are created. I guess I could invoke avrdude directly and pass those files as parameters, couldn’t I? I think I’ve seen the invocation, or more specifically the required parameters, in the verbose log. Can I just copy-paste that or do I need to do anything else (cd into the directory or whatever)?
Thanks fo the help so far.