Skip to content

AVRDude Programming Issue - Apple Silicon #1

Description

@AliBarber

Despite following the instructions, with the latest version of Arduino - I ran into an issue programming the board with the Arduino IDE. Here is a workaround I found in case it helps anyone else out.

Evironment
Processor: Apple M2
OS: 14.1 (23B74)
Arduino: IDE Version 2.3.6 - Also verified with 1.8.19 / Teensyduino 1.57
Rosetta 2 Installed

Problem
After verifying, uploading the sketch to the board fails with:
Failed uploading: cannot execute upload tool: fork/exec /Users/alastair/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino9/bin/avrdude: bad CPU type in executable

It appears that this version of avrdude is unsupported. I could not get it to run from the terminal, file reports: Mach-O executable i386, i.e. a 32-bit executable that would not be supported on a 64 bit system.

Workaround

  • Install the latest avrdude separately from Arduino. Using homebrew run:
    brew install avrdude from the terminal.
  • Enable 'verbose' mode in the Arduino UI: Preferences -> Show Verbose Output During [check both]
  • Set up board and port as per the instructions in this repository's README
  • Attempt to upoad sketch
  • In the output, copy the line before the error, in this case it looked like:
    "/Users/alastair/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino9/bin/avrdude" "-C/Users/alastair/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino9/etc/avrdude.conf" -v -v -patmega2560 -cstk500v2 -P/dev/cu.usbmodem004D1 -b57600 "-Uflash:w:/Users/alastair/Library/Caches/arduino/sketches/9EAA7D4F5B7AB865341029D6E41AD076/LightAPRS-2-vehicle.ino.hex:i"
  • Paste this command into the terminal, then delete the path to the executable and replace it with simply avrdude Important also delete the first argument (with the avrdude.conf file specified)
  • Run this command, AVR dude should run sucessfully:
Image

🎉 Your device is now flashed, you can go back to the Arduino IDE and use the Serial Monitor normally to view the output.

It's unlikely that the developers of this repository can change anything here to solve this issue - as it appears to be caused by the versions of the tooling used for this version of the Arduino board. Hopefully this helps anyone stuck with the same issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions