ArduinoCore-avr installation problem (v1.6.22 and v1.6.23) ?

Hi,

I experience weird problems when installing the latest releases of the "Arduino AVR boards (built-in by Arduino).
Programs no more compile/link correctly. :angry:
After investigations, it look like that the ArduinoCore-avr no more safely install on my system.
And as far as I can see on the Web/forums, I'm not alone in this situation.

Context/symptoms:
Arduino IDE 1.8.8 (Windows Store 1.8.19.0) - OS : Windows 10 64 bits

  • I try to compile two separate projects : one is a personal dev., while the second is the "Marlin" firmware (commonly used on 3D printers).
    My project use an ATMega 2560 board, and "MARLIN" use an AT1284 board (Sanguino).
    Of course, both needs the "Arduino AVR boards" installed in the board management menu.
  • When compiling with the v1.6.21 release, all works like a charm, compilation and execution are fine
  • When compiling with the releases v1.6.22 or v1.6.23, I got a nice "segmentation fault" for my project.
    And I got a ".text overflow" for the MARLIN (as if the CPU/board has not enough flash memory).

So, I decide to change the compiler/linker options to identify the problem. My idea was to add an extra option "-Wl, Map, essai.map" in the compiler/linker to see the CPU-address mapping generated. I first suspected a bug in the avr-gcc toolchain, but I now believe that it's not the case.

Indeed, using the v1.6.21, I change the compiler options has described in the Arduino documentation :

On my system, it is located here : C:\Users\Thierry\Documents\ArduinoData\packages\arduino\hardware\avr\1.6.21
OK, with the v1.6.21, no problem to locate the "platform.txt" and add extra option to the compiler. This works perfectly, I get a listing of the mapping addresses as expected.

Now, using the board management, I upgrade the "Arduino AVR boards" to release 1.6.22 (or 1.6.23).
Then try to locate the "platform.txt" file... no way ! :o
When I look at the expected directory : C:\Users\Thierry\Documents\ArduinoData\packages\arduino\hardware\avr\1.6.22, it doesn't exist !!!
The "avr" directory is here, but empty.

So I suspect an installation problem with the v1.6.22/v1.6.23.

I've also take a look at the github repository: Releases · arduino/ArduinoCore-avr · GitHub
I downloaded the zip archives and manually extract them. They look correct, not corrupted.

So the fundamental question is : Why doesn't the 1.6.22/1.6.23 install in the expected directory ?
Is this a bug in the installer, or in the archive, or in a post-installation process ?

noflip95:
When compiling with the releases v1.6.22 or v1.6.23, I got a nice "segmentation fault" for my project.

This bug is specific to the 5.4.0-atmel3.6.1-arduino2 version of avr-gcc used by Arduino AVR Boards 1.6.22 and newer. It has been reported here:

Here's the traditional workaround:

  • Tools > Board > Boards Manager
  • Wait for downloads to finish.
  • When you move the mouse pointer over "Arduino AVR Boards", you will see a "Select version" dropdown menu appear. Select "1.6.21".
  • Click "Install".
  • Wait for installation to finish.
  • Click "Close".

Due to a bug, this workaround doesn't work with Arduino IDE 1.8.6, but it will work with any other version of the Arduino IDE.

If you have File > Preferences > Check for updates on startup checked, the Arduino IDE may occasionally notify you that a new version of Arduino AVR Boards is available, you'll need to refrain from updating back to the new Arduino AVR Boards version, otherwise you'll be back to seeing the segmentation fault error again.

Alternate workaround:
One of the Arduino developers recently worked on this and claims to have fixed it. There is a special beta testing hardware package you can install via the Arduino IDE's Boards Manager that has the fix:

  • (In the Arduino IDE) File > Preferences
  • In the "Additional Boards Manager URLs" field, enter: http://downloads.arduino.cc/packages/package_avr_7.3.0_index.json If you already have an additional Boards Manager URL in that field, you can separate multiple URLs with commas or click the button on the right side of the field to open a dialog that allows you to add each on its own line.
  • Click "OK"
  • Tools > Board > Boards Manager
  • Wait for the downloads to finish
  • Click on "Arduino AVR Boards by Arduino"
  • Click the "Update" button.
  • Wait for the update to finish.
  • Click "Close".

noflip95:
Why doesn't the 1.6.22/1.6.23 install in the expected directory ?

The Arduino IDE comes with a copy of Arduino AVR Boards bundled. This is to allow Arduino users to get started with using the most common boards immediately after installing the Arduino IDE. If you install the bundled version of Arduino AVR Boards via Boards Manager, the Arduino IDE doesn't bother to install a duplicate version to C:\Users\Thierry\Documents\ArduinoData\packages\arduino\hardware\avr. It just removes the previously installed version from that location and goes back to using the bundled version. The bundled version of Arduino AVR Boards for Arduino IDE 1.8.8 is 1.6.23. So your experience when installing that Arduino AVR Boards 1.6.23 is expected. However, Arduino AVR Boards 1.6.22 should indeed be installed to C:\Users\Thierry\Documents\ArduinoData\packages\arduino\hardware\avr. I just did a test and it works as expected for me. However, I don't use the Windows Store version of the Arduino IDE. I can't imagine its behavior would be so different from the regular IDE though.

The bundled version of the Arduino IDE is located in the hardware/arduino/avr subfolder of the Arduino IDE installation folder. Unfortunately, Windows likes to prevent you from messing about in the folder where it installs apps. If you want to play around with that sort of thing. I recommend you use the "Windows Installer, for Windows XP and up" or "Windows ZIP file for non admin install" versions of the Arduino IDE, which you can download here:

Thanks for this quick and detailed reply.

Sure, the v1.6.21 works fine and the best/faster workaround is to revert to this version.
Thanks.
Thierry.

You're welcome. I'm glad if I was able to be of assistance. Enjoy!
Per

When is a fix that incorporates the working version of the compiler going to be available in board manager?

Like, seriously, this is the sort of thing that makes me lose respect for the Arduino team. Any professional team, if they realized they released a bad version that sometimes segfaulted, would PULL THE BAD VERSION. Arduino, which is supposed to be newbie friendly, leaves buggy versions with traps for the unwary up on the top of the download page with no warning or anything.

Well, if you add the url http://downloads.arduino.cc/packages/package_avr_7.3.0_index.json to your preferences you do get a working version in Boards Manager. But I know you're saying a working (and non-beta) version in Boards Manager by default.

I agree that it would be best to immediately make a new release that rolls back to the known-good compiler version. Boards Manager makes that so easy to do without needing to do a new IDE release. I understand wanting to move forward (as is the current plan) rather than backward, but if forward isn't ready to go right away then going back is the best path.