Go Down

Topic: avr-g++: bad CPU type in executable (Read 25366 times) previous topic - next topic

ayucyndi

Hello,

I have a trouble using my arduino Uno.

Whatever I do, even if my program is correct (I tried with the original "blink" program as well)
when I verify my program I get this error message:

fork/exec /Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++: bad CPU type in executable

I already tried to reinstall the Arduino.app, but doesn't help.

I'm working on MacBook air 2018(MacOS 10.15 beta) and with the version 1.8.9 of the arduino app

does anybody here know what I can do?




little note: I'm a real noob with computers... you should know that before helping me!

DrAzzy

#1
Jun 07, 2019, 06:13 pm Last Edit: Jun 07, 2019, 06:19 pm by DrAzzy
The Arduino IDE (well, the toolchain) is 32-bit, Mac OS 10.15 only runs 64-bit applications. Hence, the IDE is currently not compatible with 10.15.

The Arduino developers are aware of the issue and last I checked the issue on github (when someone else asked earlier this week), they were hoping to have a 64-bit version available for mac to address this before the general release of 10.15.

As an aside, you say you are a little noob with computers; in this case, what possessed you to use a beta version of your operating system? Using beta versions should be left to experts who are better prepared to deal with the inevitable strange bugs (which, because it's new, won't have a large body of knowledge available on how to deal with them) that will be encountered with such experimental software - particularly something like the OS.
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

Gielk

I have the same problem it is because of the max beta i just installed beta 2 still same problem. I also tried the arduino 2 (beta) also not working. Is there currently any workaround ?

Gielk

Solution is download the latest build here https://github.com/arduino/Arduino/pull/8976

voor mac hier http://downloads.arduino.cc/javaide/pull_requests/arduino-PR-8976-BUILD-869-macosx.zip

thephilnord

Solution is download the latest build here https://github.com/arduino/Arduino/pull/8976

voor mac hier http://downloads.arduino.cc/javaide/pull_requests/arduino-PR-8976-BUILD-869-macosx.zip
This worked for me as well. Using Beta 3

DerekC

FYI, This issue is being tracked here: https://github.com/arduino/Arduino/issues/8626

paulhoekstra

I use NodeMCU board on Mac - with 1.8.10 compile is exponentially faster!! Couldn't help myself to donate again - thank you guys!!

skndungu

Solution is download the latest build here https://github.com/arduino/Arduino/pull/8976

voor mac hier http://downloads.arduino.cc/javaide/pull_requests/arduino-PR-8976-BUILD-869-macosx.zip
Worked for me Thanks !!!!!!!!

benmens

I had a similar issue.

For me the solution was to rename the folder "~/Library/Arduino15/packages/arduino/tools/avr-gcc" to "~/Library/Arduino15/packages/arduino/tools/avr-gcc-old". This folder contains old 32-bit binaries. After renaming this folder, arduino uses the 64-bit binaries in "/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin"

benmens

#9
Nov 09, 2019, 04:35 pm Last Edit: Nov 09, 2019, 05:21 pm by benmens
I had a similar issue.

For me the solution was to rename the folder "~/Library/Arduino15/packages/arduino/tools/avr-gcc" to "~/Library/Arduino15/packages/arduino/tools/avr-gcc-old". This folder contains old 32-bit binaries. After renaming this folder, arduino uses the 64-bit binaries in "/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin"
Never mind. This was just a temporal fix. The folder will be recreated by Arduino automatically. I fixed this by creating a custom version of package_digistump_index.json that does not depend on the 32-bit version of avr-gcc.

You can use it by uninstalling the Digistumb AVR Boards package, replace the Digistumb boardmanagers URL with https://raw.githubusercontent.com/digistump/arduino-boards-index/master/package_digistump_index.json and install Digistumb AVR Boards again.

tboutelier

Hi,
I am having a similar issue but with mBlock 5.1 only, everything works fine within the arduino IDE.
Here is the error message when I try to download my simple code (a blinking led) into my Arduino Uno:
Code: [Select]
start processing code......
processing code by middleware of pinMode
avr-toolchain/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10605 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I"/Applications/Makeblock/IdeServicePlus/app/external/arduino/avr-library/variants/standard" -I"avr-library/cores/arduino" -I"arduino-libraries/makeblock/src" -I"arduino-libraries/makeblock/src/utility/avr" -I"avr-library/libraries/Wire/utility" -I"avr-library/libraries/Wire" -I"avr-library/libraries/SoftwareSerial" -I"arduino-libraries/arduino/WiFi/src/" -I"arduino-libraries/arduino/SD/src/" -I"arduino-libraries/arduino/Bridge/src/" -I"arduino-libraries/arduino/Temboo/src/" -I"arduino-libraries/arduino/Servo/src/" -I"arduino-libraries/arduino/Ethernet/src/" -I"arduino-libraries/arduino/TFT/src/" -I"arduino-libraries/arduino/SpacebrewYun/src/" -I"arduino-libraries/arduino/LiquidCrystal/src/" -I"arduino-libraries/arduino/GSM/src/" "/Users/boutelierroca/mblock-avr/temp/build/code.cpp" -o "/Users/boutelierroca/mblock-avr/temp/build/code.o"
Command failed: avr-toolchain/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10605 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I"/Applications/Makeblock/IdeServicePlus/app/external/arduino/avr-library/variants/standard" -I"avr-library/cores/arduino" -I"arduino-libraries/makeblock/src" -I"arduino-libraries/makeblock/src/utility/avr" -I"avr-library/libraries/Wire/utility" -I"avr-library/libraries/Wire" -I"avr-library/libraries/SoftwareSerial" -I"arduino-libraries/arduino/WiFi/src/" -I"arduino-libraries/arduino/SD/src/" -I"arduino-libraries/arduino/Bridge/src/" -I"arduino-libraries/arduino/Temboo/src/" -I"arduino-libraries/arduino/Servo/src/" -I"arduino-libraries/arduino/Ethernet/src/" -I"arduino-libraries/arduino/TFT/src/" -I"arduino-libraries/arduino/SpacebrewYun/src/" -I"arduino-libraries/arduino/LiquidCrystal/src/" -I"arduino-libraries/arduino/GSM/src/" "/Users/boutelierroca/mblock-avr/temp/build/code.cpp" -o "/Users/boutelierroca/mblock-avr/temp/build/code.o" /bin/sh: avr-toolchain/bin/avr-g++:
Bad CPU type in executable
Failed to compile file code.cpp
arduino build failed.

Does anyone have an idea on how to make it work with mBlock?
Thanks!


northonheld

Hey guys!!

Im install this version IDE 1.8.10 "http://downloads.arduino.cc/javaide/pull_requests/arduino-PR-8976-BUILD-869-macosx.zip" 

Before that error 32bits. I solved other error "Multiple libraries were found for "LiquidCrystal.h" problem by downgrading "Arduino AVR Boards" to 1.6.23

After resolving "LiquidCrystal.h" I take this error:

fork/exec /Library/Arduino15/packages/arduino/tools/avr-gcc/5.4.0-atmel3.6.1-arduino2/bin/avr-g++: bad CPU type in executable
Error compiling for board Anet V1.0.

My Mac running 10.15.1 OSX version

Now I don't know what else to do to solve this 32bit problem.

Please could someone help me?

DrAzzy

I think you need the very latest version of the AVR board package to work on versions of MacOS that don't support 32-bit executables.
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

AnjinMeili

The newest 1.8.10 has all the parts that are required inside.  One simply needs to trick the Digistump config to use what is included, instead of its own old, out of date, no longer supported snowflake of the AVR tools.

I found this easy enough by simply linking the current shipping 64bit version, into the Digistump tree.

First, make sure your board includes are all setup properly. Next, shutdown the Arduino IDE completely.  Finally, from a shell prompt, you are gonna move the Digistump snowflake out of the way, and link in the current shipping version:

$ cd ~/Library/Arduino15/packages/arduino/tools/avr-gcc
$ mv 4.8.1-arduino5 orig.4.8.1
$ ln -s /Applications/Arduino.app/Contents/Java/hardware/tools/avr 4.8.1-arduino5

You could just delete the old stuff I suppose.  But that should cover it for you.  Fire up Arduino IDE as normal and get back to work :)

I tested this on Arduino IDE 1.8.10 running on macOS Catalina 10.15

Cheers
Anjin


pert

The solution may depend on which board you have selected from the Arduino IDE's Tools > Board menu when you get the error. If you're using one of the official Arduino AVR Boards (e.g. Uno, Mega, Leonardo, etc.), then the fix should be simply updating Arduino AVR Boards. If you're using a different board, then the fix might be more complicated if the hardware package of that board has not had a new release with the 64 bit version of the toolchain yet.

If you'll tell me which board you're having trouble with, I can provide detailed instructions.

Go Up