Go Down

Topic: When compiling: Bad CPU type... error compiling for Uno. (Read 204 times) previous topic - next topic

estephan500

Hello everyone... I'd love any suggestions on this:

When I compile my newest version of my sketch, it fails... with this error:

Bad CPU type in executable   ... Error compiling for board Arduino/Genuino Uno.

Here is the background:

This project I am trying to work on is actually me going back to work on OLDER project from many months ago, that runs on an Uno, which I haven't edited for a long time. (Note, the actual project itself has been running happily on my desk on its own, flashing its lights and working fine, so all the hardware and devices are OK.)

In the time since I last worked on this Uno project, I was off and working on other projects... one was on an ESP8266... another was on a Mega...

So, when I did that work on those other projects, I had to change things up in the IDE's "tools" menu... which I can't remember well. I probably changed the board, the port, maybe the "programmer" ... and to be honest, I can't remember what else I must have changed.

Now today, I opened up this old project on my computer, made some very small changes to the script, and wanted to install it onto the Uno project.
* of course I connected it via USB
* Then I tried to switch the IDE settings back to what the Uno needed, by changing these:
* Changed Board to Arduino/Genuino Uno...
* Changed port to ......cu.usbmodem14301 (Arduino/Genuino Uno)

But... it gave the below errors.  I will paste the errors below. FIRST I will paste the "simple" version of the errors, and then I will paste the long errors from when I changed it to VERBOSE mode.

Any thoughts on which thing I need to change to get it to compile OK? THANKS!

=====SIMPLE VERSION OF THE ERROR=====
Arduino: 1.8.9 (Mac OS X), Board: "Arduino/Genuino Uno"

fork/exec /Users/ericstephan/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 Arduino/Genuino Uno.

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

===== VERBOSE VERSION OF THE ERROR=====



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

/Applications/Arduino.app/Contents/Java/arduino-builder -dump-prefs -logger=machine -hardware /Applications/Arduino.app/Contents/Java/hardware -hardware /Users/ericstephan/Library/Arduino15/packages -tools /Applications/Arduino.app/Contents/Java/tools-builder -tools /Applications/Arduino.app/Contents/Java/hardware/tools/avr -tools /Users/ericstephan/Library/Arduino15/packages -built-in-libraries /Applications/Arduino.app/Contents/Java/libraries -libraries /Users/ericstephan/Dropbox/L- PROGRAMMING/Arduino/libraries -fqbn=arduino:avr:uno -vid-pid=0X2A03_0X0043 -ide-version=10809 -build-path /var/folders/fs/qn6sgg0j5xs8vyp7bv60wg7w0000gn/T/arduino_build_689549 -warnings=none -build-cache /var/folders/fs/qn6sgg0j5xs8vyp7bv60wg7w0000gn/T/arduino_cache_550064 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=/Users/ericstephan/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino14 -prefs=runtime.tools.avrdude-6.3.0-arduino14.path=/Users/ericstephan/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino14 -prefs=runtime.tools.arduinoOTA.path=/Users/ericstephan/Library/Arduino15/packages/arduino/tools/arduinoOTA/1.2.1 -prefs=runtime.tools.arduinoOTA-1.2.1.path=/Users/ericstephan/Library/Arduino15/packages/arduino/tools/arduinoOTA/1.2.1 -prefs=runtime.tools.avr-gcc.path=/Users/ericstephan/Library/Arduino15/packages/arduino/tools/avr-gcc/5.4.0-atmel3.6.1-arduino2 -prefs=runtime.tools.avr-gcc-5.4.0-atmel3.6.1-arduino2.path=/Users/ericstephan/Library/Arduino15/packages/arduino/tools/avr-gcc/5.4.0-atmel3.6.1-arduino2 -verbose /Users/ericstephan/Dropbox/L- PROGRAMMING/Arduino/rcf-new10.2/rcf-new10.2.ino
/Applications/Arduino.app/Contents/Java/arduino-builder -compile -logger=machine -hardware /Applications/Arduino.app/Contents/Java/hardware -hardware /Users/ericstephan/Library/Arduino15/packages -tools /Applications/Arduino.app/Contents/Java/tools-builder -tools /Applications/Arduino.app/Contents/Java/hardware/tools/avr -tools /Users/ericstephan/Library/Arduino15/packages -built-in-libraries /Applications/Arduino.app/Contents/Java/libraries -libraries /Users/ericstephan/Dropbox/L- PROGRAMMING/Arduino/libraries -fqbn=arduino:avr:uno -vid-pid=0X2A03_0X0043 -ide-version=10809 -build-path /var/folders/fs/qn6sgg0j5xs8vyp7bv60wg7w0000gn/T/arduino_build_689549 -warnings=none -build-cache /var/folders/fs/qn6sgg0j5xs8vyp7bv60wg7w0000gn/T/arduino_cache_550064 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=/Users/ericstephan/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino14 -prefs=runtime.tools.avrdude-6.3.0-arduino14.path=/Users/ericstephan/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino14 -prefs=runtime.tools.arduinoOTA.path=/Users/ericstephan/Library/Arduino15/packages/arduino/tools/arduinoOTA/1.2.1 -prefs=runtime.tools.arduinoOTA-1.2.1.path=/Users/ericstephan/Library/Arduino15/packages/arduino/tools/arduinoOTA/1.2.1 -prefs=runtime.tools.avr-gcc.path=/Users/ericstephan/Library/Arduino15/packages/arduino/tools/avr-gcc/5.4.0-atmel3.6.1-arduino2 -prefs=runtime.tools.avr-gcc-5.4.0-atmel3.6.1-arduino2.path=/Users/ericstephan/Library/Arduino15/packages/arduino/tools/avr-gcc/5.4.0-atmel3.6.1-arduino2 -verbose /Users/ericstephan/Dropbox/L- PROGRAMMING/Arduino/rcf-new10.2/rcf-new10.2.ino
Using board 'uno' from platform in folder: /Users/ericstephan/Library/Arduino15/packages/arduino/hardware/avr/1.6.23
Using core 'arduino' from platform in folder: /Users/ericstephan/Library/Arduino15/packages/arduino/hardware/avr/1.6.23
Detecting libraries used...
/Users/ericstephan/Library/Arduino15/packages/arduino/tools/avr-gcc/5.4.0-atmel3.6.1-arduino2/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/Users/ericstephan/Library/Arduino15/packages/arduino/hardware/avr/1.6.23/cores/arduino -I/Users/ericstephan/Library/Arduino15/packages/arduino/hardware/avr/1.6.23/variants/standard /var/folders/fs/qn6sgg0j5xs8vyp7bv60wg7w0000gn/T/arduino_build_689549/sketch/rcf-new10.2.ino.cpp -o /dev/null
fork/exec /Users/ericstephan/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 Arduino/Genuino Uno.


spycatcher2k

NOT an Istallation problem. Ask for this to be moved to a more relevent section.

Do you not  think posting the code you have issues with may be of help?
Mrs Drew
-=-
http://www.uk-pcb.co.uk - UK PCB Fab Company
I will design & code for you, but I will also charge you (PM me)
If you don't like my answers, realize : I'm not being cheeky, I'm Just trying to prompt you to use your own brain/google etc.

estephan500


Thanks for your note --

1-- Wow, you said I should post the code. But to me it seemed certain that the code of the project itself is not the issue... because, when I installed it months ago, it compiled like a charm. But you definitely know more than I do! So ---  *** I am posting the full project code at the bottom of this post.

2-- I really thought this was about not the code itself but instead the drivers or IDE configurations etc,  -- but you say I shoudl request this to be placed into a different forum -- OK -- so two questions:   
(1) Sorry, but how do I request that it be moved... ---
(2) and, as you see the error messages in the first post, can you suggest which forum section to move to?  When I posted, the other forums seemed less appropriate

Thanks much!! --Eric

Here is the full code:
*** Sorry -- the sketch itself is big, and it was way over the size limit that this forum allows.
*** So, I could only put it into pastebin, which some people don't want to visit --
*** You can see it at ----- https://pastebin.com/Vns6uGhC

DrAzzy

This most definitely IS an installation and troubleshooting issue; no sketch will compile, because you upgraded to the latest version of MacOS which dropped support for 32-bit applications. The avr-gcc toolchain it's trying to use is 32-bit.

I don't know if this has been fixed yet in latest versions of Arduino IDE / Arduino AVR board package. I think the key fix can be achieved with just a board package update, since they can pull in a specified version of the compiler, but again, I don't know if they have gotten a working compiler package and incorporated it into the board package yet.
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

estephan500


Aha -- that is serious progress. Huge thanks.  I thought I did a good job of checking that I didn't have crucial 32 big apps before I upgraded to catalina... but I didn't think about little helper apps inside the arduino stuff. SO -- I will look at your thoughts and see if I can progress. 

Giant thanks -- Eric

Go Up