From 0ef4b007dc711cf0b5df96d43765e5b1473d3500 Mon Sep 17 00:00:00 2001 From: per1234 Date: Tue, 7 Feb 2023 02:33:25 -0800 Subject: [PATCH] Add article re: "bad CPU type in executable" error We saw a spike in reports of this error following the recent release of the native Apple Silicon build of Arduino IDE. Investigation showed that the affected users did not have the Rosetta 2 translation software required to run executables built for x86 (AKA "Intel") host architecture on Apple Silicon machines. Previously, this condition was not likely to occurr because macOS shows a dialog when the user starts an x86 application if Rosetta 2 is not already installed. But it turns out macOS doesn't do that if the x86 executable is run by a subprocess. So users of the Apple Silicon build of Arduino IDE do not get the dialog when starting Arduino IDE, since the application itself does not require Rosetta 2, but when Arduino IDE executes one of the helper tools (e.g., avr-gcc) that is not built for Apple Silicon, the process fails with the "bad CPU in executable" error. The solution is for the user to manually install Rosetta 2. Instructions for that are provided here. The article is intended to be a comprehensive guide to solving the "bad CPU type in executable" error. This error may occur under other conditions than the one described above, so instructions for the resolution of the error as it occurs under those other conditions are also included. --- ...ror-bad-CPU-type-in-executable-on-macOS.md | 51 ++++++++++++++++++ .../img/symbol_install-rosetta.png | Bin 0 -> 1307 bytes 2 files changed, 51 insertions(+) create mode 100644 content/Software Support/Installation/Error-bad-CPU-type-in-executable-on-macOS.md create mode 100644 content/Software Support/Installation/img/symbol_install-rosetta.png diff --git a/content/Software Support/Installation/Error-bad-CPU-type-in-executable-on-macOS.md b/content/Software Support/Installation/Error-bad-CPU-type-in-executable-on-macOS.md new file mode 100644 index 00000000..d6dc3639 --- /dev/null +++ b/content/Software Support/Installation/Error-bad-CPU-type-in-executable-on-macOS.md @@ -0,0 +1,51 @@ +--- +title: 'Error "bad CPU type in executable" on macOS' +--- + +Under certain conditions, startup or other operations of the Arduino development software might fail with a "`bad CPU type in executable`" error. + +This problem can be solved by one of the methods described below: + +## If your Mac computer has an Apple Silicon processor + +Some of the tools used by the Arduino development software are built for use on x86-64 processors, like those in Intel-based Macs. These can still be used on the [Apple Silicon](https://support.apple.com/en-us/HT211814) Mac computers thanks to a program named **Rosetta** that Apple provides. + +**Rosetta** is not pre-installed with macOS. If you have not already installed **Rosetta**, the tools built for use on x86-64 processors processors will fail to run with a "`bad CPU type in executable`" error. + +The solution is to install **Rosetta** by one of the following methods: + +### Installation Dialog + +When you start an application that requires it, macOS will show [a dialog offering installation of **Rosetta**](https://support.apple.com/en-us/HT211861). If you are presented with this dialog when starting the Arduino development software, click the ![Install button](img/symbol_install-rosetta.png) button and complete the installation. + +### Manual Installation + +If the tool requiring it is run by the Arduino development software as a subprocess, macOS does not show a dialog offering installation of **Rosetta**. In this case you must manually install **Rosetta**: + +1. Open **Terminal** (instructions [here](https://support.apple.com/en-ca/guide/terminal/apd5265185d-f365-44cb-8b09-71a064a42125/mac#trml663c6997)). +1. Type the following command in the **Terminal** window: + + ```text + softwareupdate --install-rosetta + ``` + +1. Press the **Enter** key. +1. Accept the license agreement with Apple. +1. Wait for the installation to finish. + + + +## If your computer has a different processor or Rosetta is already installed + + + +Tools used by the Arduino development software may not be compatible with the processor on your computer. In this case, when the Arduino development software attempts to use the tool it will fail with a "`bad CPU type in executable`" error. + +This type of incompatibility is usually caused by using a very old version of a tool. This is often the result of having an outdated version of the platform for your board installed. If so, the solution is to update to the latest version using the Arduino IDE **Boards Manager**: + +1. Select **Tools > Board > Boards Manager...** from the Arduino IDE menus to open the "**Boards Manager**" view. +1. Scroll down through the list of boards platforms until you see the entry for the platform of the board you are using. +1. Check to see whether there is a newer version listed in the menu at the bottom of the entry. If so, proceed with the rest of the steps in these instructions. +1. Click the "**INSTALL**" button at the bottom of the entry. +1. Wait for the update to finish. +1. Close the "**Boards Manager**" view. diff --git a/content/Software Support/Installation/img/symbol_install-rosetta.png b/content/Software Support/Installation/img/symbol_install-rosetta.png new file mode 100644 index 0000000000000000000000000000000000000000..4c82f9a40b09754e938841bdeeb290bf582995f8 GIT binary patch literal 1307 zcmV+$1?2jPP)000&U1^@s6h+bjC00004b3#c}2nYxW zdG^hxJ z#MG6nGq;_8_P_SO*V<=~>S=E`0LCb^VbJ9sBg$0qM*)@+R|=GpKsX?Q3N-9Hy9M5STH3#|3HE_lgGhR4?t@d{M2@1 zIAuwAYn23Q{nyZP;ji1L5>TF&!Ad2-v80m6QOyGbg+LJ+g%g3s0c;VsOL^GZ1lbB`oDNHB zpyM(up9RyaVAFSya$!-81aapPxPKC$;L`)}TPM8qAk=1I^A8e)=Ne(nLU?U!>3v2I zJCA`AAhPFHDXVxi1}^u*=Z9e3S1@ZbRE>ta$HABsgrT@Lu>CN6_&v1uf)~Q79+_(2 z9F=?T?SjvmWLl0&iu&%EAk+IQWf?%-8cro;#ZWnn8Zw&2k zVcQ|790e;HL@6ga;N2b2bVdTLihZ+<1ZVYp3C=(OR6lJXla$Js9Rm;7L01mm*#Rdz z;O%FnjTe-Xd6bBw^IM~=7^`8_;V3w!_+XHLmSeUYo?j$WY1eV6NJC#ia#_z6QQkv! z@I-^;t?nF59S`%T!{f6h@gF~b?J5{2r$J)GoZz(*Qq5=K!ez*NaHLI$8x6UBQH3AE zv2*b8kFdHC7SEJC^<}eocMiU2g0UHxGZnTSgb(&f+XXd(xBoP>bV9*{6YUagKM>rc zBZCrGf{%i(+FCo!(hZe#^jYyB|3kBskPEd0Z1^)v71vV85+vnHfP%Ox-F4Wqx&rG~ z^x-H4Hl{fhTE8w zVOnK~rND7)SYBV?;F$z17wr+hmo?Nvk9jDJ_&nkXZ`Kl7^b9 zfF(5^^>_KC6GryqqYoC^C