Skip to content

Teensy 4.x build fails with Arm GNU 15.2 on WireIMXRT.cpp #176

Description

@zackees

Summary

FastLED's Teensy 4.1 Blink build now gets past the earlier missing-framework-library issue, but still fails under fbuild before linking. The failure is in PlatformIO's cached framework-arduinoteensy 1.160.0 WireIMXRT.cpp when fbuild compiles it with Arm GNU 15.2.1.

This looks like a fbuild Teensy toolchain compatibility issue, not a FastLED source/file-layout issue: the same generated PlatformIO project builds successfully when run through PlatformIO, using the same Teensy framework version but PlatformIO's Teensy-pinned GCC 11.3.1 toolchain.

Related previous issue: #163, which was closed for the missing SPI/OctoWS2811 library-resolution problem. This appears to be the next blocker after that fix.

Reproduction

From FastLED master on Windows, April 22, 2026:

bash compile teensy41 --examples Blink

FastLED routes teensy41 through fbuild because ci/compiler/fbuild_boards.py includes teensy40 and teensy41.

Observed fbuild invocation:

C:\Users\niteris\dev\fastled10\.venv\Scripts\fbuild.EXE C:\Users\niteris\dev\fastled10\.build\pio\teensy41 build -e teensy41

fbuild version:

fbuild 2.2.0

Failure

Board: Teensy 4.1 / IMXRT1062 @ 600MHz
Memory: 7.75MB Flash, 512.00KB RAM
Toolchain: arm-none-eabi-gcc 15.2.1
...
build error: build failed: compilation failed for C:\Users\niteris\.fbuild\prod\cache\platforms\dl-framework-arduinoteensy-1.160.0\1b0675c97b0fd8d7\1.160.0\libraries\Wire\WireIMXRT.cpp:
...
cores/teensy4/imxrt.h:1356:35: error: 'reinterpret_cast' from integer to pointer
#define IMXRT_CCM (*(IMXRT_REGISTER32_t *)IMXRT_CCM_ADDRESS)
...
libraries/Wire/WireIMXRT.cpp:425:9: note: in expansion of macro 'CCM_CCGR2'
        CCM_CCGR2, CCM_CCGR2_LPI2C1(CCM_CCGR_ON),
...
libraries/Wire/WireIMXRT.cpp:448:9: note: in expansion of macro 'CCM_CCGR6'
        CCM_CCGR6, CCM_CCGR6_LPI2C4_SERIAL(CCM_CCGR_ON),

The failing source is defining constexpr TwoWire::I2C_Hardware_t objects initialized with CCM_CCGR2 / CCM_CCGR6, which expand through IMXRT_CCM in the Teensy core headers.

Control: PlatformIO succeeds

Using the same generated project:

uv run pio run --project-dir .build\pio\teensy41 -e teensy41

Result:

SUCCESS Took 196.77 seconds

PlatformIO package set:

framework-arduinoteensy @ 1.160.0 (1.60)
toolchain-gccarmnoneeabi-teensy @ 1.110301.0 (11.3.1)

So the important observed difference is fbuild's generic Arm GNU 15.2.1 toolchain versus PlatformIO's Teensy toolchain 11.3.1.

Suspected Cause

The fbuild Teensy orchestrator currently uses the generic ArmToolchain:

  • crates/fbuild-build/src/teensy/orchestrator.rs calls fbuild_packages::toolchain::ArmToolchain::new(...)
  • crates/fbuild-packages/src/toolchain/arm.rs hard-codes Arm GNU Toolchain 15.2.Rel1

Teensyduino framework-arduinoteensy 1.160.0 appears to expect the PlatformIO/PJRC-compatible Teensy GCC 11.3.1 package. GCC 15 rejects code that GCC 11.3.1 accepts in WireIMXRT.cpp / imxrt.h.

Expected Behavior

fbuild build -e teensy41 should compile the same generated FastLED Blink project that PlatformIO compiles, or fbuild should clearly pin/use a Teensy-compatible toolchain for Teensy 4.x instead of the generic newest Arm GNU toolchain.

A likely fix is to add/use a Teensy-specific ARM GCC package matching PlatformIO's toolchain-gccarmnoneeabi-teensy @ 1.110301.0, at least for framework-arduinoteensy 1.160.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions