Skip to content

Teensy 3.0 / LC link-time RAM overflow (.dmabuffers / .bss) across all examples #2406

Closed

Description

@zackees

Summary

After consuming the fbuild library-selector fix (fbuild 2.2.3 — tracked in #2403, now closed), Teensy 3.0 and Teensy LC CI builds still fail in CI, but with a new and different signature. The previous "multiple definition of FastLED" link failure is gone; these are now pure RAM-overflow link failures.

This is a code-size / static-allocation regression against the tiny Teensy 3.0 (16 KB RAM) and Teensy LC (8 KB RAM) targets, not an fbuild bug.

Failing CI runs (master, 8eb52e1)

Observed failures

Teensy 3.0 (16 KB RAM)

Every example tried fails with a .dmabuffers overflow of essentially a fixed amount (~22.4 KB — larger than the entire chip RAM):

ld: firmware.elf section `.dmabuffers' will not fit in region `RAM'
ld: region `RAM' overflowed by 22404 bytes   (AnalogOutput)
ld: region `RAM' overflowed by 22400 bytes   (AudioFftParity, BeatDetection, ParallelSPI, PinMode)
ld: region `RAM' overflowed by 22424 bytes   (RGBCalibrate)
ld: region `RAM' overflowed by 22412 bytes   (Test)

The near-constant ~22 400 byte overflow across unrelated examples strongly suggests a single fixed-size .dmabuffers static allocation that is sized for a larger Teensy (4.x) and not gated behind a per-platform size budget for Teensy 3.0.

Teensy LC (8 KB RAM)

.bss overflow, smaller and varying per example:

ld: firmware.elf section `.bss' will not fit in region `RAM'
ld: region `RAM' overflowed by 1708–2424 bytes   (across multiple examples)

Reference: passing Teensy boards

  • teensy31 (64 KB RAM): PASS
  • teensy32 (64 KB RAM): PASS
  • teensy41 board build: status differs across jobs; check_teensy41_size fails downstream of the global check_*_size breakage, but the board build itself appears healthy

This rules out a generic Teensy breakage — only the RAM-starved 3.0 / LC fail, with the 3.0 failing by a single constant amount.

Suspected root cause

A static .dmabuffers (likely inside one of the Teensy-family clockless/SPI drivers) is sized for Teensy 4.x and is linked in unconditionally for Teensy 3.0 / LC as well. The fix is likely one of:

  1. Gate the large .dmabuffers allocation behind a size-budget guard so Teensy 3.0 / LC do not instantiate it.
  2. Pick a smaller DMA buffer size on Teensy 3.x / LC (they cannot support the Teensy-4-sized buffer anyway at 16 KB / 8 KB total RAM).
  3. If the code path is genuinely unusable on Teensy 3.0 / LC, stub it out for those targets instead of carrying a dead 22 KB buffer.

Minimal repro

./compile --no-interactive --no-parallel --max-failures 1 teensy30 AnalogOutput
./compile --no-interactive --no-parallel --max-failures 1 teensyLC  Blink

Related

Exit criteria

  • teensy30 all and teensyLC all board builds pass in CI through the fbuild path
  • Any large .dmabuffers static allocation is either sized per-target or not instantiated on Teensy 3.x / LC
  • Regression coverage keeps Teensy 3.0 / LC green

Activity

  1. added
    type: bug
    type: regression
    platform: teensy
    area: ci
    on Apr 24, 2026
  2. zackees commented on Apr 24, 2026

    @zackees
    MemberAuthor

    Root cause confirmed — filed upstream

    Investigated the fbuild link failure by running symbol analysis on a local teensylc Blink build (PlatformIO backend, for comparison).

    Observed RAM footprint (teensyLC Blink, 8192 B RAM budget)

    Backend TUs compiled RAM used Notes
    fbuild (CI) 451 ~10364 B (overflows by 2172 B) link fails
    PlatformIO pio run (local) 242 4164 B (50.8 %) link OK

    Where the ~6 KB extra .bss is coming from

    fbuild compiles every libraries/<Name>/src/** under the Teensyduino framework package, regardless of reachability:

    Library fbuild TUs Referenced by FastLED?
    libraries/FNET 153 NO
    libraries/Audio 91 yes
    libraries/mbedtls 68 NO (transitive of FNET)
    libraries/SdFat 47 yes
    libraries/Snooze 44 NO
    libraries/RadioHead 35 NO
    cores/teensy3 67 yes

    → 300 of the 451 TUs are unreferenced. Their translation units contribute static-initialized data that --gc-sections can't remove (init_array references pin them), which is what overflows .bss on teensyLC and .dmabuffers on teensy30.

    Upstream issues filed

    Consumer-side escape hatch landed

    To unblock analysis and give anyone reproducing this a knob, bash compile now exposes a backend selector:

    bash compile teensylc Blink --backend=platformio   # or: --platformio / --pio
    bash compile teensylc Blink --backend=fbuild       # (default)

    This is how the above RAM numbers were collected; it can also serve as a temporary CI workaround for teensy30/LC until fbuild#204 lands.

    Exit-criteria status

    Not yet met — this issue should stay open until fbuild#204 is fixed and teensy30/teensyLC CI goes green through the fbuild path again.

  3. zackees commented on May 9, 2026

    @zackees
    MemberAuthor

    Same root cause as #2421 / #2420 in the Teensy form: every driver self-registers, so every driver's .dmabuffers / .bss allocations go into the link even when the sketch only uses one chipset. #2428 proposes compile-time Bus binding (Channel<fl::Bus::OBJECT_FLED, ClocklessChipset> etc.) — under that model only the bound driver's DMA buffers are instantiated, which should resolve the link-time RAM overflow on Teensy 3.0/LC.

  4. added a commit that references this issue on Jun 3, 2026
    223f13f
  5. moved this from Triage to Done in FastLED Trackeron Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: ciplatform: teensytype: bugtype: regression

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions