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:
- Buy a 6-pack of Arduino Nano Every boards off Amazon from the official Arduino store (rules out funky issues with clones/knockoff boards)
- Download and install Arduino IDE v2.3.6 from Arduino.cc directly (again, not funky clones/forks)
- 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