Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Arduino not compiling - bad CPU type in executable

Recently I was attempting to upload some code on my Arduino and got this error:

****Arduino: 1.8.9 (Mac OS X), Board: "Arduino/Genuino Uno"

fork/exec /Users/Gu/Desktop/Every single yhing/coding stuff/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++: bad CPU type in executable
Error compiling for board Arduino/Genuino Uno.

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

I quickly learned that is was due to the macOS update Catalina no longer supporting 32-bit applications and the avr-g++ keychain tool is run through a 32-bit process.

If anyone has any solution to fix this problem please assist me.

like image 792
python_man Avatar asked Aug 17 '20 05:08

python_man


Video Answer


2 Answers

Had the same problem trying to get the IDE compiling for an ESP8266, I followed the thread from the Arduino Forums linked here:

https://forum.arduino.cc/index.php?topic=620175.0

Long story short, I updated the Arduino IDE to version 1.8.13 and it worked for me on Catalina.

like image 140
brooks42 Avatar answered Oct 12 '22 11:10

brooks42


For me it worked on Catalina by:

  • updating the Arduino IDE to 1.8.13
  • Inside the IDE, updating "Arduino AVR Boards" to the latest version (on a Mac, Tools -> Board: "xxxx" -> Boards Manager... -> Arduino AVR Boards)

Access to Boards Manager in the IDE Arduino AVR Boards update location

like image 29
scarrilho Avatar answered Oct 12 '22 11:10

scarrilho