Arduino IDE 2.0

Started by tleavitt, December 30, 2021, 04:39:33 PM

tleavitt

I just downloaded the release candidate for Arduino IDE 2.0 and I really like it, but I've noticed one quirk using it with Moteinos. I when I try to compile with any of the AVR Moteino targets I get a compilation error saying bad CPU type in executable. SAMD boards seem to work just fine though I've only tried the M0. Its not slowed me down since I can use an Arduino UNO target for my regular Moteinos.

If the new debugger works it'll be awfully tempting to abandon the regular Moteinos in favor of the M0....

Felix

Thanks, and happy new year ... but ... ???
I don't see any such error with 2.0.0-rc3

In fact it produces the exact same compiled size and dynamic memory size, although the actual compiled HEX is different.
Tried with different sketches, with Moteino AVR as target.

That there is now a debugger is great. We've been used for so many years to code without a debugger so IMO having a debugger does not mean AVRs will go away. There is actually debugWire, for AVRs if you really want a debugger. I have come to appreciate the simplicity of AVRs and for what they are, they are a great tool.

tleavitt

Quote from: Felix on January 03, 2022, 11:50:07 AM
Thanks, and happy new year ... but ... ???
I don't see any such error with 2.0.0-rc3

In fact it produces the exact same compiled size and dynamic memory size, although the actual compiled HEX is different.
Tried with different sketches, with Moteino AVR as target.

That there is now a debugger is great. We've been used for so many years to code without a debugger so IMO having a debugger does not mean AVRs will go away. There is actually debugWire, for AVRs if you really want a debugger. I have come to appreciate the simplicity of AVRs and for what they are, they are a great tool.

Interesting, I must have something wrong with my set up. I'll uninstall everything and try starting fresh.

I didn't know there was a debugger for AVR too, Ive always debugged with Serial prints.

lawik

I had this problem. Since it is on an M2 Mac (Apple Silicon/ARM) I figured that was it. Going back to Arduino IDE 1.x-series did fix it though. Hope that's helpful.

Nspector5

I'm seeing the same issue on a M1 MacBook Pro with a fresh install of Arduino IDE v 2.0.3. The error is:

fork/exec /Users/username/Library/Arduino15/packages/arduino/tools/avr-gcc/4.8.1-arduino5/bin/avr-g++: bad CPU type in executable

Compilation error: fork/exec /Users/username/Library/Arduino15/packages/arduino/tools/avr-gcc/4.8.1-arduino5/bin/avr-g++: bad CPU type in executable

Felix

Can you try to make this change to the package_LowPowerLab_index.json file under your Users/username/AppData/Local/Arduino15/ folder, and let me know if it makes any difference (see the 2 lines needing change, marked with <<<<<<<<<< below):

        {
          "name": "Moteino AVR Boards",
          "architecture": "avr",
          "version": "1.6.1",
          "category": "Contributed",
          "help": { "online": "https://lowpowerlab.com/forum" },
          "url": "https://lowpowerlab.github.io/MoteinoCore/Moteino1.6.1.zip",
          "archiveFileName": "Moteino1.6.1.zip",
          "checksum": "SHA-256:E471928E519D4FA6D754BDB4B75B4F4D502BB61948D34EAB2056C4ACB5167110",
          "size": "50414",
          "boards": [
            {"name": "Moteino / Moteino-USB"},
            {"name": "MoteinoMEGA / MoteinoMEGA-USB"},
            {"name": "MightyHat"},
            {"name": "Moteino-8Mhz"}
          ],
          "toolsDependencies": [
            {
              "packager": "arduino",
              "name": "avr-gcc",
              "version": "7.3.0-atmel3.6.1-arduino7"           <<<<<<<<<<<<
            },
            {
              "packager": "arduino",
              "name": "avrdude",
              "version": "6.3.0-arduino17"                 <<<<<<<<<<<
            }
          ]
        },

XTreM3

Hey Felix,
I had the same Error using an M1 Mac and can confirm that your recommended changes in the package_LowPowerLab_index.json did fix the problem.

Thank you very much  :D

BenCranston

I can confirm the same issue with arduino IDE 2.0.3 on archliunx on both the distro based package and the AppImage from foundation.  It chooses the older 4.8.1 avr-gcc package for compiling ( guess per the .json file ).  Interesting enough, the same .json file in the 1.8.19 IDE and it chooses the newer 7.3.0 avr-gcc compiler..  Why I don't understand.  I made the suggested edits you provided to a local copy of the .json packages file and I can properly compile on the 2.0.3 IDE now... 

Interestingly enough, this problem does not occur on the win10 side of the fence with either of the IDEs.

-Ben

Felix

Thanks for all the feedback and patience, there is now a Moteino AVR 1.6.2 package release which can be upgraded to in the Boards Manager, this has the proposed changes and that should take care of this.
Let me know of any other issues.