Two avr-gcc versions and Ardunio IDE 2.0 uses the wrong one

Hello,

I got the following problem:

  • In the …AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\ folder are two versions of avr-gcc
    • 4.8.1-arduino5
    • 7.3.0-atmel3.6.1-arduino5
  • I need when the project is compiled for Arduboy that Arduino IDE (2.0.0-beta.8) use version from 7.3.0-atmel3.6.1-arduino5 folder, not from the 4.8.1-arduino5 folder, otherwise the build fails (I see the error cc1.exe: error: -fno-fat-lto-objects are supported only with linker plugin )
  • The only way I found it can fixed is to change in platform.txt file the line compiler.path={runtime.tools.avr-gcc.path}/bin/ and instead of {runtime.tools.avr-gcc.path} use there the full path, i.e. I need to change the line to compiler.path=c:\Users\petr.mazanec\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino5\bin\

Why is that happening in the first place?
Is there a better way how to fix it than my workaround? Any advice please?

Thanks a lot
STeN

Arduino IDE 2.0 is beta software. No effort has yet been made to support it for Arduboy sketches.

I suggest you use the latest stable IDE release (currently 1.8.15) for Arduboy development and compiling.

Arduino IDE 2.0 is beta software. No effort has yet been made to support it for Arduboy sketches.

I suggest you use the latest stable IDE release (currently 1.8.15) for Arduboy development and compiling.

@MLXXXp Thanks for the answer, now it is clear. The problem is that IDE 2.0 is much better than the classic (previous) Arduino IDE and I cannot help myself stopping using it and reverting back :wink:

Two suggestions:


1:

Does IDE 2.0 work if you select board type “Arduino Leonardo”? A sketch compiled for a Leonardo should upload and work on an Arduboy.


2:

If it’s the new editor in 2.0 that you like, you can set the 1.8 IDE to use an external editor and only use the IDE to compile and upload.

Select this by using the Arduino IDE menus:
File → Preferences
In the Settings tab select the Use external editor checkbox and then click on the OK box at the bottom right.

With Use external editor selected, you will still be able to load sketches into the IDE, in the normal way, but the code will be grayed out and you won’t be able to edit it. From the IDE menus you can select:
Sketch → Show Sketch Folder (or press Ctrl+K)
to open the folder containing that sketch’s files.

You can edit these files with the editor of your choice. That should include the Arduino 2.0 IDE if you can open both 2.0 and 1.8 at the same time. (With Ubuntu Linux I can just right click on a file in the sketch’s folder and choose Open With > … )

When you save a file and then switch back to the Arduino IDE, the changes made to the file will automatically be loaded in for compiling and uploading.

3 Likes

Personally I recommend trying VSCode (or VSCodium) with the Arduino plugin. It’s a great editor, and with the plugin it does everything the Arduino IDE does.

And a whole lot more (like proper folder support, auto completion, Git integration, …).

1 Like

@Pharap @filmote Thanks all for great comments.

1 Like