PIO no longer works on Raspberry Pi after 4.0 upgrade

I have been using PlatformIO with a Raspberry Pi Zero W for building and uploading Arduino sketches. I was previously on a 3.x version and it was working fine, but I decided to update to the latest and greatest version 4.0. When I try and build a project now it always fails. It is always some sort of internal compiler error: Illegal instruction no matter what kind of build it is. I don’t know how to cleanly downgrade to the old version I was using and am wondering if anyone has any ideas of how to fix this. This has completely put my projects at a standstill. Any help is appreciated.

Processing arduino_build (platform: atmelsam; board: mzeroUSB; framework: arduino)
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelsam/mzeroUSB.html
PLATFORM: Atmel SAM 3.8.0 > Arduino M0
HARDWARE: SAMD21G18A 48MHz, 32KB RAM, 256KB Flash
DEBUG: Current (atmel-ice) External (atmel-ice, blackmagic, jlink)
PACKAGES: toolchain-gccarmnoneeabi 1.70201.0 (7.2.1), framework-arduinosam 4.3.190711
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 8 compatible libraries
Scanning dependencies...
No dependencies
Compiling .pio/build/arduino_build/src/main.cpp.o
Compiling .pio/build/arduino_build/FrameworkArduinoVariant/variant.cpp.o
Archiving .pio/build/arduino_build/libFrameworkArduinoVariant.a
Indexing .pio/build/arduino_build/libFrameworkArduinoVariant.a
Compiling .pio/build/arduino_build/FrameworkArduino/IPAddress.cpp.o
/home/pi/.platformio/packages/framework-arduinosam/cores/samd/IPAddress.cpp: In member function 'virtual size_t IPAddress::printTo(Print&) const':
/home/pi/.platformio/packages/framework-arduinosam/cores/samd/IPAddress.cpp:115:1: internal compiler error: Illegal instruction
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
*** [.pio/build/arduino_build/FrameworkArduino/IPAddress.cpp.o] Error 1

Hi @keerl! New toolchain introduced in 3.7.0 version might be the problem. Could you please try to roll back to the previous version of the platform?

platform = atmelsam@3.6.1
framework = arduino
board = mzeroUSB
1 Like

It worked! Thanks so much!

1 Like