Arduino not compiling - bad CPU type in executable
Asked Answered
N

3

6

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.

Nette answered 17/8, 2020 at 5:39 Comment(0)
C
4

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.

Cheiron answered 30/8, 2020 at 22:11 Comment(1)
@Nette Can you accept this answer. It seems to be the correct step.Bohannan
U
4

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

Underling answered 15/11, 2020 at 5:11 Comment(0)
L
1

If you have updated from the 32-bit version of the arduino IDE you may have an older version of the avr-gcc still hanging about along with version 7.3.

Check this folder:

/Users/username/Library/Arduino15/packages/arduino/tools/avr-gcc

If you have a 4.3 and a 7.3 folder, delete the 4.3 one and the bad CPU error disappears.

Leeannaleeanne answered 10/8, 2023 at 8:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.