Bad CPU type in executable

We have an Arduino Uno R3 and a MacBook Air running Sonoma 14.3. When I attempt to upload the Blink example sketch to the Arduino we get an error 'bad CPU type in executable.'

Reading the forums for a bit there is a suggestion that we may need to use Rosetta, however, looking at the documentation for installing Rosetta, it doesn't appear we need to.

A bit at a loss here for a way forward.

Your topic has been moved. Please do not post in "Uncategorized"; see the sticky topics in Uncategorized - Arduino Forum.

I've moved your topic to the dedicated IDE 2.x section of the forum; if you're using IDE 1.x, it can be moved to the IDE 1.x category.


I unfortunately don't know a solution.

Hi @rynsp8.

I'm going to ask you to provide the full verbose output from a compilation.


:exclamation: This procedure is not intended to solve the problem. The purpose is to gather more information.


Please do this:

  1. Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
    The "Preferences" dialog will open.
  2. Check the box next to "Show verbose output during: ☐ compile" in the "Preferences" dialog.
  3. Check the box next to Show verbose output during: ☐ upload.
  4. Click the "OK" button.
    The "Preferences" dialog will close.
  5. Attempt an upload, as you did before.
  6. Wait for the upload to fail.
  7. You will see an "Upload error: ..." notification at the bottom right corner of the Arduino IDE window. Click the "COPY ERROR MESSAGES" button on that notification.
  8. Open a forum reply here by clicking the "Reply" button.
  9. Click the <CODE/> icon on the post composer toolbar.
    This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
    Code block icon on toolbar
  10. Press the Ctrl+V keyboard shortcut (Command+V for macOS users).
    This will paste the error output from the upload into the code block.
  11. Move the cursor outside of the code block markup before you add any additional text to your reply.
  12. Click the "Reply" button to post the output.

In case the output is longer than the forum software will allow to be added to a post, you can instead save it to a .txt file and then attach that file to a reply here:

  1. Open any text editor program.
  2. Paste the copied output into the text editor.
  3. Save the file in .txt format.
  4. Open a forum reply here by clicking the "Reply" button.
  5. Click the "Upload" icon (Upload icon) on the post composer toolbar:
    Upload icon on toolbar
    The "Open" dialog will open.
  6. Select the .txt file you saved from the "Open" dialog.
  7. Click the "Open" button.
    The dialog will close.
  8. Click the "Reply" button to publish the post.

Alternatively, instead of using the "Upload" icon on the post composer toolbar as described in steps (5) - (7) above, you can simply drag and drop the .txt file onto the post composer field to attach it.

Our output is below:


FQBN: arduino:avr:uno
Using board 'uno' from platform in folder: /Users/speightfamily/Library/Arduino15/packages/arduino/hardware/avr/1.8.6
Using core 'arduino' from platform in folder: /Users/speightfamily/Library/Arduino15/packages/arduino/hardware/avr/1.8.6

Detecting libraries used...
/Users/speightfamily/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/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=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/Users/speightfamily/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino -I/Users/speightfamily/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/variants/standard /private/var/folders/l3/6lvlfl4d68g_17rcjfvvvc300000gn/T/arduino/sketches/423EC0F1E250670B97BC40A8A84DE7BC/sketch/Blink.ino.cpp -o /dev/null
fork/exec /Users/speightfamily/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++: bad CPU type in executable

Compilation error: fork/exec /Users/speightfamily/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++: bad CPU type in executable

OK, then I confirm that you do indeed need to install Rosetta 2:

The Arduino developers are tracking the request of providing a native Apple Silicon build of the avr-gcc tool here:


FQBN: arduino:avr:uno
Using board 'uno' from platform in folder: /Users/theodorbode/Library/Arduino15/packages/arduino/hardware/avr/1.8.6
Using core 'arduino' from platform in folder: /Users/theodorbode/Library/Arduino15/packages/arduino/hardware/avr/1.8.6

Verwendete Bibliotheken erkennen ...
/Users/theodorbode/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/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=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/Users/theodorbode/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino -I/Users/theodorbode/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/variants/standard /private/var/folders/yb/9n96hp0x21b5gz511c4crr140000gp/T/arduino/sketches/BB5F5E76F5BF2EE6FA60035BD7607EE3/sketch/sketch_jul31a.ino.cpp -o /dev/null
fork/exec /Users/theodorbode/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++: bad CPU type in executable

Compilation error: fork/exec /Users/theodorbode/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++: bad CPU type in executable

Hi @rodoeht24. Please install Apple Rosetta 2 on your macOS computer to fix this problem:

1 Like

How can I check wether Rosetta is already installed?

You can check by opening a terminal and then running the following command from the command prompt in the terminal:

pgrep -q oahd && echo "Rosetta 2 installed" || echo "Rosetta 2 not installed"
2 Likes

Hi! I got the same error message on a M2 Mac mini. Installing Rosetta 2 solved the problem.

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