This is driving me nuts.
In the IDE compilation randomly fails. Nothing is being changed, I just have to keep pressing the Verify button until it works. It fails more times than it works. Looking at the output logs the difference is in the compiler flags being used. Unfortunately the build that fails is the one that contains the compiler flags from boards.local.txt. This is the one that fails.
Code:
/home/roger/.arduino15/packages/teensy/tools/teensy-tools/1.57.2/precompile_helper /home/roger/.arduino15/packages/teensy/hardware/avr/1.57.2/cores/teensy4 /tmp/arduino-sketch-CC81A5A23484C7D95A00AD5A53FB6A62 /home/roger/.arduino15/packages/teensy/tools/teensy-compile/5.4.1/arm/bin/arm-none-eabi-g++ -x c++-header -Og -g -DGDB_DUAL_SERIAL -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=157 -DARDUINO=10607 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_DUAL_SERIAL -DLAYOUT_US_ENGLISH -I/home/roger/.arduino15/packages/teensy/hardware/avr/1.57.2/cores/teensy4 /tmp/arduino-sketch-CC81A5A23484C7D95A00AD5A53FB6A62/pch/Arduino.h -o /tmp/arduino-sketch-CC81A5A23484C7D95A00AD5A53FB6A62/pch/Arduino.h.gch
This is the one that works.
Code:
/home/roger/.arduino15/packages/teensy/tools/teensy-tools/1.57.2/precompile_helper /home/roger/.arduino15/packages/teensy/hardware/avr/1.57.2/cores/teensy4 /tmp/arduino-sketch-CC81A5A23484C7D95A00AD5A53FB6A62 /home/roger/.arduino15/packages/teensy/tools/teensy-compile/5.4.1/arm/bin/arm-none-eabi-g++ -x c++-header -O2 -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=157 -DARDUINO=10607 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_DUAL_SERIAL -DLAYOUT_US_ENGLISH -I/home/roger/.arduino15/packages/teensy/hardware/avr/1.57.2/cores/teensy4 /tmp/arduino-sketch-CC81A5A23484C7D95A00AD5A53FB6A62/pch/Arduino.h -o /tmp/arduino-sketch-CC81A5A23484C7D95A00AD5A53FB6A62/pch/Arduino.h.gch
It is difficult to make out what is going on. USB_DUAL_SERIAL appears in both but in different places. The "-Og -g -DGDB_DUAL_SERIAL" sequence comes from the boards.local.txt file.
What a mess!