Error while trying to compile to Arduino Nano

Hey guys! Hope everyone is safe and secure during these uncertain and unpleasant times.

I'm facing an issue with my Nano's code not compiling.

Don't really know if this is relevant but I have recently moved from a 2012 MacBook Pro to the new M1 2020 Macbook Pro. Was running Mojave on the older machine and now the new laptop has the latest version of Big Sur installed.

The code was uploading perfectly without issues onto the Nano with my older laptop, however it is giving me issues on the new one. Find the error message posted below for your reference to help diagnose the problem.

Arduino: 1.8.13 (Mac OS X), Board: "Arduino Nano, ATmega328P"

fork/exec /Users/Taran/Library/Arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++: bad CPU type in executable
Error compiling for board Arduino Nano.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Because my new laptop does not have a USB-A port, I am using a USB-C to USB-A dongle for the arduino cable.

What could this be and how can it be resolved?

Hope to sort this out soon,

Thanks in advance,


Hi @anon91407545. I can see you're using a super old version of the "Arduino AVR Boards" platform of the Arduino Nano. Please try updating to see if that helps:

  1. Select Tools > Board > Boards Manager from the Arduino IDE's menus.
  2. Wait for the update to finish.
  3. From the list of available boards platforms, click on Arduino AVR Boards.
  4. Click the Install button.
  5. Wait for the installation to finish.
  6. Click the Close button.

Now try compiling your sketch again.


Hey! That actually did help, however now I'm stuck with the not being able to open the requisite device.

Do find below the error messages the compiler gives me.

Hope you can advise me on this as well.

Arduino: 1.8.13 (Mac OS X), Board: "Arduino Nano, ATmega328P"

Sketch uses 13340 bytes (43%) of program storage space. Maximum is 30720 bytes.
Global variables use 624 bytes (30%) of dynamic memory, leaving 1424 bytes for local variables. Maximum is 2048 bytes.
/Users/Taran/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude -C/Users/Taran/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf -v -patmega328p -carduino -P/dev/cu.usbserial-130 -b115200 -D -Uflash:w:/var/folders/2_/5p5x3bxd5q9f_5_dhm_mn7yr0000gn/T/arduino_build_283965/code-gimbal.ino.hex:i 

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean,
         Copyright (c) 2007-2014 Joerg Wunsch

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

         Using Port                    : /dev/cu.usbserial-130
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
avrdude: ser_open(): can't open device "/dev/cu.usbserial-130": No such file or directory

avrdude done.  Thank you.

Problem uploading to board.  See for suggestions.

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