Repository navigation
Description
Summary
Meta issue tracking the remaining follow-ups after #3428 was closed (parallel SPI driver work via FlexIO2 + ObjectFLED on Teensy 4.x). All three subtasks need physical hardware (scope + APA102/SK9822 strip) for verification, so they're user-side; this issue keeps them grouped.
State as of #3428 close
- FlexIO-SPI driver: shipped + hardware-verified DMA transmit (3/3 smoke tests pass on Teensy 4.1 at 1/6/12 MHz,
wait_ms=0). PR feat(flexio): unified clockless+SPI engine scaffolding (#3428) #3431. - ObjectFLED-SPI driver: shipped + hardware-verified DMA transmit (3/3 smoke tests at 1/6/12 MHz,
wait_ms=5= drain only). PR feat(objectfled): unified clockless+SPI engine scaffolding (#3428) #3432. DefaultBus<SpiChipsetConfig>for Teensy 4.x =Bus::FLEX_IO(per directive "single strip should not default LPSPI").- Private-namespace refactor of both drivers' internals: PR refactor(spi): wrap FlexIO/ObjectFLED internals in private namespaces #3434.
- Bring-up smoke tests + diagnostic register dump live in
ci/autoresearch/test_flexio_spi_smoke.pyandci/autoresearch/test_objectfled_spi_smoke.py.
What's hardware-confirmed: DMA cycle fires end-to-end, ISR clears, no faults, both drivers compile + transmit at the API level.
What is NOT yet confirmed: the actual bits on the MOSI wire, and a real LED strip lighting up correctly.
Follow-up checklist
1. ⏰ [#3433] FlexIO SPI: track active transfer state for accurate wire-drain timeout
Existing tracking issue. CodeRabbit heavy-lift comment from PR #3431. flexio_spi_wait() returns as soon as the DMA ISR fires, but the final byte can still be clocking out. Fast short transfers can hit this path before the caller's next flexio_spi_show(), so deinit/reinit may cut off the tail. The fixed 50 ms timeout is also based on the fastest SCLK; at the effective floor (~234 kHz) it can under-budget large frames.
Fix sketch:
- Add a
volatile bool sShifterDrainedflag set when both the DMA ISR fires AND the shifter-empty status latches. - Compute timeout as
max(50ms, num_bytes * 8 * 2 / baud_div_hz * 1.5). - Add a slow-end smoke-test case (4096 bytes @ 234 kHz) to lock in the fix.
2. 🔬 Scope-verify byte-level MOSI bit pattern (both drivers)
Files: src/platforms/arm/teensy/teensy4_common/drivers/flexio/flexio_spi_mode.cpp.hpp + src/platforms/arm/teensy/teensy4_common/drivers/objectfled/objectfled_spi_mode.cpp.hpp (search for TODO(#3428) comments).
Test: drive 0xA5 (= 1010 0101) via flexioSpiSelfTest / objectfledSpiSelfTest and scope MOSI. Expect MSB-first: high, low, high, low, low, high, low, high.
FlexIO-SPI suspects (per in-code TODO):
FLEXIO_SHIFTCTL_SHIFT_ON_FALLING_EDGE(TIMPOL=1) — if data is shifted by half a clock period, flip to rising edge.SHIFTBUFBBSvsSHIFTBUFBISfor the DMA destination — bit-order alias choice. Current pick (SHIFTBUFBBS= byte+bit swap) was cross-checked against Teensy'sFlexIOSPI.cppfor MSBFIRST mode but should be confirmed on scope.
ObjectFLED-SPI suspects:
- Bit-pattern encoder (16 words per byte, MSB-first per
encode_byte()inobjectfled_spi_mode.cpp.hpp). The QTimer3 trigger fires once per word, so each pair of words = one SCLK cycle. - Pad slew rate (currently
FL_OBJECTFLED_SPI_SPEED=0,FL_OBJECTFLED_SPI_DSE=3) — if 25 MHz transitions undershoot, bump toSPEED=2/DSE=6(the FlexIO-SPI defaults).
3. 🎄 APA102/SK9822 strip end-to-end test
Hook up an APA102 (or SK9822) strip and drive it via:
auto spi = fl::SpiChipsetConfig(/*data*/14, /*clock*/15, fl::SpiEncoder::apa102(/*6 MHz*/));
FastLED.add<fl::Bus::FLEX_IO, fl::SpiChipsetConfig>(fl::ChannelConfigOf<fl::SpiChipsetConfig>(spi, leds));
// Or: Bus::OBJECT_FLED with pins on GPIO6 bank (1, 8, 14-27, 38-41 on T4.1).
FastLED.show();What to verify:
- Colors render correctly across SK9822 + APA102 + HD108 at default + max-spec clocks (6 / 12 / 25 MHz).
- No flicker over long frames (the wire-drain fix from item 1 should land before stress-testing).
DefaultBus<SpiChipsetConfig> = Bus::FLEX_IOchoice is vindicated — auto-routing puts the strip on FlexIO without explicitBus::selection.
Why a meta issue?
The three items are independent (any one can land without the others) but share the same prerequisite (physical bench). Tracking them together lets a single bench session knock out all three.
Closing criteria
Close when: #3433 fixed AND scope verification done on both drivers AND at least one APA102 strip lit up successfully on each driver path.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTriage
Activity
zackees commentedon Aug 20, 2026
Deferred under the active bug-burn-down policy. This meta explicitly groups three physical Teensy bench tasks, and the prerequisite hardware is not currently attached.
Disposition of its checklist:
TODO(#3428)bit-order/edge assumptions remain hardware hypotheses.A fresh
fbuild port scanreports every PJRC identity (COM20/19/21/7) as phantom,present=no,selectable=no. The healthy attached boards are ESP32-C6 COM9 and RP-class COM18, neither of which can validate i.MX RT1062 FlexIO/ObjectFLED behavior.Restart criteria are exactly the meta's intended single bench session:
deferredand close only when all three closing criteria are evidenced.The meta remains open and is excluded from the actionable queue while labeled
deferred.