Errors flashing on macOS

Hi there,

I am having some trouble getting a basic Arduino setup to work on macOS Sequoia 15.6.1 on my M1 Ultra Mac Studio (Apple silicon, not Intel). I am able to compile simple firmware but flashing does not work - I always get an error from avrdude, both in Arduino IDE and if I try via CLI:

avrdude: jtagmkII_getsync(): sign-on command: status -1

Here's my simple test program, debug.ino:

#include <Arduino.h>

void setup() {
  Serial.begin(9600);  
  while (!Serial) {
  }
  Serial.println("Setup complete. Starting loop...");
}

void loop() {
  unsigned long ms = millis(); 
  Serial.print("Uptime: ");
  Serial.print(ms);
  Serial.println(" ms");
  delay(1000);
}

Here's what I did:

  1. Buy a 6-pack of Arduino Nano Every boards off Amazon from the official Arduino store (rules out funky issues with clones/knockoff boards)
  2. Download and install Arduino IDE v2.3.6 from Arduino.cc directly (again, not funky clones/forks)
  3. Connect the board to the Mac Studio via USB C cable and USB C-to-micro USB adapter. To rule out any setup issues, I've confirmed the exact same hardware works to connect another peripheral.

When I connect the board, I see it show up in CLI:

>> arduino-cli board list
Port                            Protocol Type              Board Name         FQBN                     Core
/dev/cu.Bluetooth-Incoming-Port serial   Serial Port       Unknown
/dev/cu.debug-console           serial   Serial Port       Unknown
/dev/cu.usbmodem4101            serial   Serial Port (USB) Arduino Nano Every arduino:megaavr:nona4809 arduino:megaavr
/dev/cu.usbmodemM4AE1A561J6     serial   Serial Port (USB) Unknown

In the Arduino IDE, I see the board settings that all appear to be correct:

  • Board: Arduino Nano Every
  • Port: /dev/cu.usbmodem4101
  • Registers emulation: None (ATMEGA4809)

Compiling works great:

FQBN: arduino:megaavr:nona4809:mode=off
Using board 'nona4809' from platform in folder: /Users/zach/Library/Arduino15/packages/arduino/hardware/megaavr/1.8.8
Using core 'arduino' from platform in folder: /Users/zach/Library/Arduino15/packages/arduino/hardware/megaavr/1.8.8

Detecting libraries used...
/Users/zach/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino5/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega4809 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_NANO_EVERY -DARDUINO_ARCH_MEGAAVR -DMILLIS_USE_TIMERB3 -DNO_EXTERNAL_I2C_PULLUP -I/Users/zach/Library/Arduino15/packages/arduino/hardware/megaavr/1.8.8/cores/arduino/api/deprecated -I/Users/zach/Library/Arduino15/packages/arduino/hardware/megaavr/1.8.8/cores/arduino -I/Users/zach/Library/Arduino15/packages/arduino/hardware/megaavr/1.8.8/variants/nona4809 /Users/zach/Library/Caches/arduino/sketches/618A8B0444B1589EF0F2D15036B6D60A/sketch/debug.ino.cpp -o /dev/null
Generating function prototypes...
/Users/zach/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino5/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega4809 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_NANO_EVERY -DARDUINO_ARCH_MEGAAVR -DMILLIS_USE_TIMERB3 -DNO_EXTERNAL_I2C_PULLUP -I/Users/zach/Library/Arduino15/packages/arduino/hardware/megaavr/1.8.8/cores/arduino/api/deprecated -I/Users/zach/Library/Arduino15/packages/arduino/hardware/megaavr/1.8.8/cores/arduino -I/Users/zach/Library/Arduino15/packages/arduino/hardware/megaavr/1.8.8/variants/nona4809 /Users/zach/Library/Caches/arduino/sketches/618A8B0444B1589EF0F2D15036B6D60A/sketch/debug.ino.cpp -o /private/var/folders/7h/c0sfqmmj3m1ggbpb_9t0zskw0000gn/T/2120120421/sketch_merged.cpp
/Users/zach/Library/Arduino15/packages/builtin/tools/ctags/5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives /private/var/folders/7h/c0sfqmmj3m1ggbpb_9t0zskw0000gn/T/2120120421/sketch_merged.cpp

Compiling sketch...
/Users/zach/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino5/bin/avr-g++ -c -g -Os -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega4809 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_NANO_EVERY -DARDUINO_ARCH_MEGAAVR -DMILLIS_USE_TIMERB3 -DNO_EXTERNAL_I2C_PULLUP -I/Users/zach/Library/Arduino15/packages/arduino/hardware/megaavr/1.8.8/cores/arduino/api/deprecated -I/Users/zach/Library/Arduino15/packages/arduino/hardware/megaavr/1.8.8/cores/arduino -I/Users/zach/Library/Arduino15/packages/arduino/hardware/megaavr/1.8.8/variants/nona4809 /Users/zach/Library/Caches/arduino/sketches/618A8B0444B1589EF0F2D15036B6D60A/sketch/debug.ino.cpp -o /Users/zach/Library/Caches/arduino/sketches/618A8B0444B1589EF0F2D15036B6D60A/sketch/debug.ino.cpp.o
Compiling libraries...
Compiling core...
Using previously compiled file: /Users/zach/Library/Caches/arduino/sketches/618A8B0444B1589EF0F2D15036B6D60A/core/variant.c.o
Using precompiled core: /Users/zach/Library/Caches/arduino/cores/arduino_megaavr_nona4809_mode_off_5a4345d348bcc81195674df0759f8b41/core.a
Linking everything together...
/Users/zach/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino5/bin/avr-gcc -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -Wl,--section-start=.text=0x0 -mmcu=atmega4809 -o /Users/zach/Library/Caches/arduino/sketches/618A8B0444B1589EF0F2D15036B6D60A/debug.ino.elf /Users/zach/Library/Caches/arduino/sketches/618A8B0444B1589EF0F2D15036B6D60A/sketch/debug.ino.cpp.o /Users/zach/Library/Caches/arduino/sketches/618A8B0444B1589EF0F2D15036B6D60A/core/variant.c.o /Users/zach/Library/Caches/arduino/sketches/618A8B0444B1589EF0F2D15036B6D60A/../../cores/arduino_megaavr_nona4809_mode_off_5a4345d348bcc81195674df0759f8b41/core.a -L/Users/zach/Library/Caches/arduino/sketches/618A8B0444B1589EF0F2D15036B6D60A -lm -Wl,-Map,/Users/zach/Library/Caches/arduino/sketches/618A8B0444B1589EF0F2D15036B6D60A/debug.ino.map
/Users/zach/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino5/bin/avr-objcopy -O binary -R .eeprom /Users/zach/Library/Caches/arduino/sketches/618A8B0444B1589EF0F2D15036B6D60A/debug.ino.elf /Users/zach/Library/Caches/arduino/sketches/618A8B0444B1589EF0F2D15036B6D60A/debug.ino.bin
/Users/zach/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino5/bin/avr-objcopy -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 /Users/zach/Library/Caches/arduino/sketches/618A8B0444B1589EF0F2D15036B6D60A/debug.ino.elf /Users/zach/Library/Caches/arduino/sketches/618A8B0444B1589EF0F2D15036B6D60A/debug.ino.eep
/Users/zach/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino5/bin/avr-objcopy -O ihex -R .eeprom /Users/zach/Library/Caches/arduino/sketches/618A8B0444B1589EF0F2D15036B6D60A/debug.ino.elf /Users/zach/Library/Caches/arduino/sketches/618A8B0444B1589EF0F2D15036B6D60A/debug.ino.hex
/Users/zach/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino5/bin/avr-size -A /Users/zach/Library/Caches/arduino/sketches/618A8B0444B1589EF0F2D15036B6D60A/debug.ino.elf
Sketch uses 3009 bytes (6%) of program storage space. Maximum is 49152 bytes.
Global variables use 177 bytes (2%) of dynamic memory, leaving 5967 bytes for local variables. Maximum is 6144 bytes.

Flashing times out though:

Global variables use 177 bytes (2%) of dynamic memory, leaving 5967 bytes for local variables. Maximum is 6144 bytes.
Performing 1200-bps touch reset on serial port /dev/cu.usbmodem4101
"/Users/zach/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude" "-C/Users/zach/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf" -v  -patmega4809 -cjtag2updi -P/dev/cu.usbmodem4101  -b115200 -e -D "-Uflash:w:/Users/zach/Library/Caches/arduino/sketches/618A8B0444B1589EF0F2D15036B6D60A/debug.ino.hex:i" "-Ufuse2:w:0x01:m" "-Ufuse5:w:0xC9:m" "-Ufuse8:w:0x00:m" {upload.extra_files}

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/Users/zach/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf"
         User configuration file is "/Users/zach/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/cu.usbmodem4101
         Using Programmer              : jtag2updi
         Overriding Baud Rate          : 115200
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: jtagmkII_getsync(): sign-on command: status -1

If I try to flash via arduino-cli, the same problem happens:

Command:

arduino-cli upload  -b arduino:megaavr:nona4809:mode=off -p /dev/cu.usbmodem4101 ~/code/laserwall/firmware/debug --verbose

Output:

>> arduino-cli upload  -b arduino:megaavr:nona4809:mode=off -p /dev/cu.usbmodem4101 ~/code/laserwall/firmware/debug --verbose
Performing 1200-bps touch reset on serial port /dev/cu.usbmodem4101
"/Users/zach/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude" "-C/Users/zach/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf" -v -V -patmega4809 -cjtag2updi -P/dev/cu.usbmodem4101  -b115200 -e -D "-Uflash:w:/Users/zach/Library/Caches/arduino/sketches/618A8B0444B1589EF0F2D15036B6D60A/debug.ino.hex:i" "-Ufuse2:w:0x01:m" "-Ufuse5:w:0xC9:m" "-Ufuse8:w:0x00:m" {upload.extra_files}

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/Users/zach/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf"
         User configuration file is "/Users/zach/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/cu.usbmodem4101
         Using Programmer              : jtag2updi
         Overriding Baud Rate          : 115200
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: jtagmkII_getsync(): sign-on command: status -1

Is there a known working order of events that an out-of-the-box Arduino Nano Every has to go through in order to flash correctly from an Apple silicon Mac?

Thanks,
Zach

Also worth noting that ChatGPT and Gemini both suggest the "double-reset trick" where you press the Upload button, then double-press the reset button the firmware as soon as the "Performing 1200-bps touch reset on serial port..." message appears. Here is the error I get if I do this:

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/Users/zach/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf"
         User configuration file is "/Users/zach/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/cu.usbmodem4101
         Using Programmer              : jtag2updi
         Overriding Baud Rate          : 115200
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: ser_recv(): read error: Device not configured
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: ser_send(): write error: Device not configured
avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: ser_recv(): read error: Device not configured
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: ser_send(): write error: Device not configured
avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: ser_recv(): read error: Device not configured
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: ser_send(): write error: Device not configured
avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: ser_recv(): read error: Device not configured
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: ser_send(): write error: Device not configured
avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: ser_recv(): read error: Device not configured
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: ser_send(): write error: Device not configured
avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: ser_recv(): read error: Device not configured
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: ser_send(): write error: Device not configured
avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: ser_recv(): read error: Device not configured
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: ser_send(): write error: Device not configured
avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: ser_recv(): read error: Device not configured
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: ser_send(): write error: Device not configured
avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: ser_recv(): read error: Device not configured
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: ser_send(): write error: Device not configured
avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: ser_recv(): read error: Device not configured
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: ser_send(): write error: Device not configured
avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: ser_recv(): read error: Device not configured
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: ser_send(): write error: Device not configured
avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: ser_recv(): read error: Device not configured
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: ser_send(): write error: Device not configured
avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: ser_recv(): read error: Device not configured
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: ser_send(): write error: Device not configured
avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: ser_recv(): read error: Device not configured
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: ser_send(): write error: Device not configured
avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: ser_recv(): read error: Device not configured
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: ser_send(): write error: Device not configured
avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: ser_recv(): read error: Device not configured
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: ser_send(): write error: Device not configured
avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: ser_recv(): read error: Device not configured
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: ser_send(): write error: Device not configured
avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: ser_recv(): read error: Device not configured
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: ser_send(): write error: Device not configured
avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: ser_recv(): read error: Device not configured
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: ser_send(): write error: Device not configured
avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: ser_recv(): read error: Device not configured
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: ser_send(): write error: Device not configured
avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: ser_recv(): read error: Device not configured
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: ser_send(): write error: Device not configured
avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: ser_recv(): read error: Device not configured
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: ser_send(): write error: Device not configured
avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: ser_recv(): read error: Device not configured
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: ser_send(): write error: Device not configured
avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: ser_recv(): read error: Device not configured
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: ser_send(): write error: Device not configured
avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: ser_recv(): read error: Device not configured
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: ser_send(): write error: Device not configured
avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: ser_recv(): read error: Device not configured
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: ser_send(): write error: Device not configured
avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: ser_recv(): read error: Device not configured
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: ser_send(): write error: Device not configured
avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: ser_recv(): read error: Device not configured
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: ser_send(): write error: Device not configured
avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: ser_recv(): read error: Device not configured
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: ser_send(): write error: Device not configured
avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: ser_recv(): read error: Device not configured
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: ser_send(): write error: Device not configured
avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: ser_recv(): read error: Device not configured
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: ser_send(): write error: Device not configured
avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: ser_recv(): read error: Device not configured
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: jtagmkII_getsync(): timeout/error communicating with programmer (status -1)

avrdude done.  Thank you.

Failed uploading: uploading error: exit status 1

I've also tried downgrading the Arduino megaAVR Boards package and ran into the same issue on all these versions:

  • 1.8.8 (latest and consistent with GitHub tag history)
  • 1.8.7
  • 1.8.6
  • 1.8.5
  • 1.8.4
  • 1.8.3.
  • 1.8.2
  • 1.8.1

When I tried to go back to 1.6.26 (the revision before 1.8.1), I get an error because the Arduino Nano Every is not listed. But this is what I'd expect since v1.6.26 was released on March 19, 2019 per the Github history, and the Arduino Nano Every was announced for pre-order after that, on May 31, 2019 (link).

So it seems the board package version is not the issue.

Try changing your avrdude configuration or Arduino IDE settings to use jtag2updi as the programmer. I don’t have that board myself, but I remember reading that the Nano Every requires that programmer for uploads

Have you installed Rosetta2? The Apple download does NOT include some of the tool chain apps; you will need Rosetta for them.

Hi @zachrattner.

It is a "hallucination". Although other boards do go into a special mode after a double reset, the Nano Every does not. So this doesn't accomplish anything.

If you are looking for a way to put the board into the special mode used for uploads, this is done by momentarily opening the serial port at 1200 baud. You can even use the Arduino IDE Serial Monitor to do that, as described here:

That issue is about the same error you are experiencing. However, the cause of the failure reported there was understood to be specific to Linux, so I'm not sure the error you are experiencing has the same cause (a given upload error message may have multiple completely distinct causes).

Thanks folks for the input - the issue turned out to be with the USB adapter plug.

I didn't have any USB C-to-micro-USB cables so I bought this one and now the build flashes without issue.

1 Like