I am new to Arduido and cannot upload to the Digispark Rev3 Attiny85 from my 2023 MacBook Air M1 running IDE 2.3.4 I get the following error:
fork/exec /Users/ajbx2022/Library/Arduino15/packages/arduino/tools/avr-gcc/4.8.1-arduino5/bin/avr-g++: bad CPU type in executable
Compilation error: fork/exec /Users/ajbx2022/Library/Arduino15/packages/arduino/tools/avr-gcc/4.8.1-arduino5/bin/avr-g++: bad CPU type in executable
Has anyone overcome this for a Mac M1 and if so how? Thanks for your help.
Thanks sonofcy . I was sure I had the Apple Silicon version but reinstalled anyway but I get exactly the same error messages as before.
If anyone has overcome this for the Mac M1 I would appreciate the advice. Thanks.
The error is very specific. I have a Mac Silicon. Do you kow if you have Rosetta installed?
But first, a sanity check: find the ArduinoIDE app and do a GetInfo. It should look like the attached pic. Also make sure Rosetta is installed in the Applications folder. 2nd pic
Apple has created a "binary translator" named Rosetta 2 that allows x86 applications to run on Apple Silicon machines. So the problem can be solved by simply installing Rosetta 2. You can do that by following these instructions:
There is no point. If @ajbx was using the "Intel" build of Arduino IDE, it wouldn't have even started. If you look closely at the error message, you can see that it is about the g++ CPP compiler executable from avr-gcc (GCC for the AVR architecture), not about the Arduino IDE application:
So the problem is that avr-gcc is only available in an "Intel" build:
and that @ajbx doesn't have Rosetta 2 installed on their computer.
@ajbx a correction to what I wrote in my previous reply. I'm sure that page previously contained instructions for triggering Rosetta from the command line, but now I see that it only contains instructions for triggering it by opening an "Intel" application. That won't work in this case.
Please instead follow the instructions provided here:
Rosetta is a simple and intuitive temperature conversion tool. You can convert between Celsius, Fahrenheit, and Kelvin.
You must use the procedure documented in the Arduino Help Center article I linked in my previous reply to install Rosetta 2. It is unfortunate that there isn't a more user friendly way to install it such as via the App Store, but this is the only way to do it in this case.
When a user who doesn't already have Rosetta 2 installed starts an "Intel" application directly, macOS displays a friendly dialog explaining the situation and offering to install:
However, in this case where the "Intel" application (g++) is being invoked indirectly via Arduino IDE, macOS doesn't show that dialog and instead only produces this cryptic "bad CPU type in executable" error message. It would be nice if Apple provided a way for the user to trigger the installation of Rosetta 2 via the GUI, but it seems they assume that their "automagical" system will take care of everything, and didn't consider this specific use case.
I remember seeing that prompt a while ago. O also saw the mention of temp conversion but I thought it was a mistake or some sort of Apple insider joke. I apparently have it installed and just clicked it to indeed see it is a temp conversion tool.
I have installed Rosetta 2 via using the terminal window and Apple instructions. I got the Rosetta successfully installed message. Then I reinstalled the IDE 2.3.4 restarted then loaded the Digispark (Default - 16.5MHz) board. The error messages remain the same. I'm not sure what to try next!
The "Digistump" boards platform has not been maintained for many years and is no longer functional. You should use the reasonably well maintained ATTinyCore boards platform instead, which also provides support for the Digispark board: