Trouble compiling on macOS Catalina?



  • Hi there, I'm having trouble getting the default FlightController sketch uploaded to my new CoDrone Pro controller. After configuring my Arduino environment and installing the USB driver, I'm getting the following error:

    avr-g++: bad CPU type in executable
    Error compiling for board Rokit-SmartInventor-mega32_v2.
    

    Any clues on how to proceed? Here is some more debug info on my setup.

    OS: macOS Catalina 10.15.2
    Arduino IDE: 1.8.12 (I also tried the 1.8.10 patch provided from this post).

    Controller PCB: Smart Inventor V2+, Rokit_Line_2.20 Rev5 2019-07

    Library: CoDrone by Robolink Version 2.2.1
    Board package: rokit by ROBOLINK version 1.0.3

    Board > Rokit-SmartInventor-mega32_v2
    Port > /dev/cu.SLAB_USBtoUART

    Full (verbose) build error on Arduino 1.8.12.

    /Applications/Arduino.app/Contents/Java/arduino-builder -dump-prefs -logger=machine -hardware /Applications/Arduino.app/Contents/Java/hardware -hardware /Users/daltonb/Library/Arduino15/packages -tools /Applications/Arduino.app/Contents/Java/tools-builder -tools /Applications/Arduino.app/Contents/Java/hardware/tools/avr -tools /Users/daltonb/Library/Arduino15/packages -built-in-libraries /Applications/Arduino.app/Contents/Java/libraries -libraries /Users/daltonb/Documents/Arduino/libraries -fqbn=rokit:avr:SmartInventor-mega32_v2 -vid-pid=10C4_EA60 -ide-version=10812 -build-path /var/folders/ct/zm_r0fxd7859yvcw7r_fk88m0000gn/T/arduino_build_955951 -warnings=none -build-cache /var/folders/ct/zm_r0fxd7859yvcw7r_fk88m0000gn/T/arduino_cache_744638 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=/Users/daltonb/Library/Arduino15/packages/arduino/tools/avr-gcc/4.8.1-arduino5 -prefs=runtime.tools.avr-gcc-4.8.1-arduino5.path=/Users/daltonb/Library/Arduino15/packages/arduino/tools/avr-gcc/4.8.1-arduino5 -prefs=runtime.tools.avrdude.path=/Users/daltonb/Library/Arduino15/packages/arduino/tools/avrdude/6.0.1-arduino5 -prefs=runtime.tools.avrdude-6.0.1-arduino5.path=/Users/daltonb/Library/Arduino15/packages/arduino/tools/avrdude/6.0.1-arduino5 -verbose /Users/daltonb/Documents/Arduino/libraries/CoDrone/examples/Controller/FlightController/FlightController.ino
    /Applications/Arduino.app/Contents/Java/arduino-builder -compile -logger=machine -hardware /Applications/Arduino.app/Contents/Java/hardware -hardware /Users/daltonb/Library/Arduino15/packages -tools /Applications/Arduino.app/Contents/Java/tools-builder -tools /Applications/Arduino.app/Contents/Java/hardware/tools/avr -tools /Users/daltonb/Library/Arduino15/packages -built-in-libraries /Applications/Arduino.app/Contents/Java/libraries -libraries /Users/daltonb/Documents/Arduino/libraries -fqbn=rokit:avr:SmartInventor-mega32_v2 -vid-pid=10C4_EA60 -ide-version=10812 -build-path /var/folders/ct/zm_r0fxd7859yvcw7r_fk88m0000gn/T/arduino_build_955951 -warnings=none -build-cache /var/folders/ct/zm_r0fxd7859yvcw7r_fk88m0000gn/T/arduino_cache_744638 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=/Users/daltonb/Library/Arduino15/packages/arduino/tools/avr-gcc/4.8.1-arduino5 -prefs=runtime.tools.avr-gcc-4.8.1-arduino5.path=/Users/daltonb/Library/Arduino15/packages/arduino/tools/avr-gcc/4.8.1-arduino5 -prefs=runtime.tools.avrdude.path=/Users/daltonb/Library/Arduino15/packages/arduino/tools/avrdude/6.0.1-arduino5 -prefs=runtime.tools.avrdude-6.0.1-arduino5.path=/Users/daltonb/Library/Arduino15/packages/arduino/tools/avrdude/6.0.1-arduino5 -verbose /Users/daltonb/Documents/Arduino/libraries/CoDrone/examples/Controller/FlightController/FlightController.ino
    Using board 'SmartInventor-mega32_v2' from platform in folder: /Users/daltonb/Library/Arduino15/packages/rokit/hardware/avr/1.0.3
    Using core 'atmega32' from platform in folder: /Users/daltonb/Library/Arduino15/packages/rokit/hardware/avr/1.0.3
    Detecting libraries used...
    /Users/daltonb/Library/Arduino15/packages/arduino/tools/avr-gcc/4.8.1-arduino5/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -E -CC -mmcu=atmega32 -DF_CPU=7372800L -DARDUINO=10812 -DARDUINO_AVR_SMARTINVENTOR-MEGA32_V2 -DARDUINO_ARCH_AVR -I/Users/daltonb/Library/Arduino15/packages/rokit/hardware/avr/1.0.3/cores/atmega32 -I/Users/daltonb/Library/Arduino15/packages/rokit/hardware/avr/1.0.3/variants/SmartInventor /var/folders/ct/zm_r0fxd7859yvcw7r_fk88m0000gn/T/arduino_build_955951/sketch/FlightController.ino.cpp -o /dev/null
    fork/exec /Users/daltonb/Library/Arduino15/packages/arduino/tools/avr-gcc/4.8.1-arduino5/bin/avr-g++: bad CPU type in executable
    Error compiling for board Rokit-SmartInventor-mega32_v2.
    

    Full build error on Arduino 1.8.10 (Catalina patch).

    /Applications/Arduino.app/Contents/Java/arduino-builder -dump-prefs -logger=machine -hardware /Applications/Arduino.app/Contents/Java/hardware -hardware /Users/daltonb/Library/Arduino15/packages -tools /Applications/Arduino.app/Contents/Java/tools-builder -tools /Applications/Arduino.app/Contents/Java/hardware/tools/avr -tools /Users/daltonb/Library/Arduino15/packages -built-in-libraries /Applications/Arduino.app/Contents/Java/libraries -libraries /Users/daltonb/Documents/Arduino/libraries -fqbn=rokit:avr:SmartInventor-mega32_v2 -vid-pid=10C4_EA60 -ide-version=10810 -build-path /var/folders/ct/zm_r0fxd7859yvcw7r_fk88m0000gn/T/arduino_build_157681 -warnings=none -build-cache /var/folders/ct/zm_r0fxd7859yvcw7r_fk88m0000gn/T/arduino_cache_856219 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=/Users/daltonb/Library/Arduino15/packages/arduino/tools/avr-gcc/4.8.1-arduino5 -prefs=runtime.tools.avr-gcc-4.8.1-arduino5.path=/Users/daltonb/Library/Arduino15/packages/arduino/tools/avr-gcc/4.8.1-arduino5 -prefs=runtime.tools.avrdude.path=/Users/daltonb/Library/Arduino15/packages/arduino/tools/avrdude/6.0.1-arduino5 -prefs=runtime.tools.avrdude-6.0.1-arduino5.path=/Users/daltonb/Library/Arduino15/packages/arduino/tools/avrdude/6.0.1-arduino5 -verbose /Users/daltonb/Documents/Arduino/libraries/CoDrone/examples/Controller/FlightController/FlightController.ino
    /Applications/Arduino.app/Contents/Java/arduino-builder -compile -logger=machine -hardware /Applications/Arduino.app/Contents/Java/hardware -hardware /Users/daltonb/Library/Arduino15/packages -tools /Applications/Arduino.app/Contents/Java/tools-builder -tools /Applications/Arduino.app/Contents/Java/hardware/tools/avr -tools /Users/daltonb/Library/Arduino15/packages -built-in-libraries /Applications/Arduino.app/Contents/Java/libraries -libraries /Users/daltonb/Documents/Arduino/libraries -fqbn=rokit:avr:SmartInventor-mega32_v2 -vid-pid=10C4_EA60 -ide-version=10810 -build-path /var/folders/ct/zm_r0fxd7859yvcw7r_fk88m0000gn/T/arduino_build_157681 -warnings=none -build-cache /var/folders/ct/zm_r0fxd7859yvcw7r_fk88m0000gn/T/arduino_cache_856219 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=/Users/daltonb/Library/Arduino15/packages/arduino/tools/avr-gcc/4.8.1-arduino5 -prefs=runtime.tools.avr-gcc-4.8.1-arduino5.path=/Users/daltonb/Library/Arduino15/packages/arduino/tools/avr-gcc/4.8.1-arduino5 -prefs=runtime.tools.avrdude.path=/Users/daltonb/Library/Arduino15/packages/arduino/tools/avrdude/6.0.1-arduino5 -prefs=runtime.tools.avrdude-6.0.1-arduino5.path=/Users/daltonb/Library/Arduino15/packages/arduino/tools/avrdude/6.0.1-arduino5 -verbose /Users/daltonb/Documents/Arduino/libraries/CoDrone/examples/Controller/FlightController/FlightController.ino
    Using board 'SmartInventor-mega32_v2' from platform in folder: /Users/daltonb/Library/Arduino15/packages/rokit/hardware/avr/1.0.3
    Using core 'atmega32' from platform in folder: /Users/daltonb/Library/Arduino15/packages/rokit/hardware/avr/1.0.3
    Detecting libraries used...
    /Users/daltonb/Library/Arduino15/packages/arduino/tools/avr-gcc/4.8.1-arduino5/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -E -CC -mmcu=atmega32 -DF_CPU=7372800L -DARDUINO=10810 -DARDUINO_AVR_SMARTINVENTOR-MEGA32_V2 -DARDUINO_ARCH_AVR -I/Users/daltonb/Library/Arduino15/packages/rokit/hardware/avr/1.0.3/cores/atmega32 -I/Users/daltonb/Library/Arduino15/packages/rokit/hardware/avr/1.0.3/variants/SmartInventor /var/folders/ct/zm_r0fxd7859yvcw7r_fk88m0000gn/T/arduino_build_157681/sketch/FlightController.ino.cpp -o /dev/null
    fork/exec /Users/daltonb/Library/Arduino15/packages/arduino/tools/avr-gcc/4.8.1-arduino5/bin/avr-g++: bad CPU type in executable
    Error compiling for board Rokit-SmartInventor-mega32_v2.
    


  • Ok great— thanks Leila!


  • administrators

    @daltonb This is very strange! I will connect you with someone who is using Arduino on Catalina on our support team to help you out. You will be receiving an email shortly with a link to set up a call. Thank you for your patience.



  • Thanks for the suggestion. I updated to Catalina 10.15.4, and for good measure I deleted the Arduino application folder, the ~/Library/Arduino15 folder, and the ~/Documents/Arduino folder, and reinstalled the patched Arduino version you linked to earlier. Still getting the same compiler error.

    I also tried compiling for Arduino Uno just to check if something weird was going on with the AVR toolchain, and that worked just fine.


  • administrators

    @daltonb Can you update Catalina to the latest release? 10.15.3? I think the previous update had an issue where you had to manually enable a lot of things and it might be blocking Arduino in the background. Hopefully this works!



  • It's an issue with compiling, even before the compiler gets to the source code. I did try your test code for good measure, but I get the same "bad CPU type" issue from the detailed error message above:

    fork/exec /Users/daltonb/Library/Arduino15/packages/arduino/tools/avr-gcc/4.8.1-arduino5/bin/avr-g++: bad CPU type in executable
    Error compiling for board Rokit-SmartInventor-mega32_v2.
    

    Since this happens at compile time, I don't think it matters which board is actually connected, but my board does say "Smart Inventor V2+" on it. Not sure about a green sticker.



  • This post is deleted!

  • administrators

    @daltonb Is this an issue uploading or just compiling?
    Try with a basic code such as this:

    #include <CoDrone.h>
    void setup() {
      // put your setup code here, to run once:
      CoDrone.begin(115200);
      CoDrone.pair(Nearest);
    }
    
    void loop() {
      // put your main code here, to run repeatedly:
    
    }
    

    I'm wondering if there's a mistake in the default code. Also, are you sure you are using a SmartInventor V2? There should a green sticker on your board if it is. If not, try uploading by selecting the V1 board. I know that Arduino works with Catalina so these are the last few things I would try.



  • Thanks Leila! I tried to respond earlier, but have been getting a persistent "connection lost" message in the forums whether I'm logged in/out or try a different browser. The forum went down earlier today, so I'm guessing it was fixed then.

    Anyhow, it looks like the build you linked to is the same one I tried above (i.e. "the 1.8.10 patch provided from this post"). Any thoughts on what to try next?


  • administrators

    @daltonb Hm..I'm not on Catalina but I did some research and I think I found a build that might work for you. ⬇http://downloads.arduino.cc/javaide/pull_requests/arduino-PR-8976-BUILD-869-macosx.zip
    Could you try this one and then let me know?


Log in to reply
 

Looks like your connection to Robolink community was lost, please wait while we try to reconnect.