Repository navigation
Description
Parent: #5024. Related: #5056 (safe implementation of the primary forced-software fallback).
FASTLED_FORCE_SOFTWARE_PINS does not select that fallback for ESP32's explicitly specialized pins. This is a separate selection defect: fixing the primary fallback cannot make a specialization inherit it.
At f11e47323bcb0d9bb2c770d7112f5f86f4b053a1, src/fl/system/fastpin_base.h:73 selects FastPin<PIN> : detail::ForcedSoftwarePin<PIN> when the macro is defined. The ESP32 platform dispatch still includes src/platforms/esp/32/core/fastpin_esp32.h, whose unguarded _FL_DEFPIN declarations (269–288) explicitly specialize FastPin<0..63> using native _ESPPIN. Those specializations override the forced primary template.
Root built the actual public MY9221 producer on ESP32-C6 GPIO2/3 with both FASTLED_FORCE_SOFTWARE_PINS and FASTLED_NO_PINMAP defined before FastLED.h. The real vendor compile/link passed. Independent actual-ELF inspection found the selected callbacks still perform native GPIO MMIO at 0x60091008/0x6009100c, byte-identical to the native build, with no software-fallback digitalWrite/digitalRead route. This run is rejected as forced-fallback coverage; successful compilation and native IRAM placement cannot certify that configuration.
Retained local evidence: .build/spi-my9221-forced-c6/ contains producer, input hashes, build information, actual ELF/map and logs. The actual producer's macros are presence-based, matching the primary template's #ifdef; this is not a missing numeric macro value.
Required work:
- Preserve ESP32 pin validity and user-mask compatibility while making forced selection reach the intended software implementation. Check mapped and NO_PINMAP variants, include order, native defaults, and supported ESP32 SDK/SoC configurations.
- Prove the selected production type/route in actual SDK builds, then exercise GPIO ordering, init LOW, bit/byte/bulk output and subsequent reuse. Do not accept a macro merely appearing in a producer as evidence that it selected a branch.
- Independently restore the old unguarded-specialization defect and require the selected-route control to fail. Bind exact sources, compiler/configuration, commands and artifacts in the managed completion gate.
- Inspect actual fallback callees and code/data placement separately for MY9221 timing. Native callback IRAM evidence must not be imported as proof of forced-fallback execution or maximum phase timing.
No fix or electrical/timing compliance is claimed by this report.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
fix(esp32): honor forced GPIO selection and output policy
test(spi): prove C6 forced output mode with compiled controls
test(spi): prove ESP32 C6 forced pin selection with SDK controls
fix(esp32): validate direct FastPin output operations
zackees commentedon Nov 22, 2026
Evidence: the selection defect is fixed by fadc722 (#5241). A remaining link defect is fixed in #5391.
Baseline:
master@ 38aa8f6. Real SDK builds were made from agit archivecopy of that tree with a throwaway producer that was never committed. Board: esp32c6 (pioarduino 55.03.35, esp32-arduino 3.3.5, ESP-IDF 5.5.1, riscv32-esp-elf-gcc 14.2.0). Command:bash compile esp32c6 ForcedPinProbe.The producer is the MY9221 sketch from the report, with presence macros defined before
FastLED.h:ELFs were disassembled with the fbuild-installed
riscv32-esp-elf-objdump -d -C.Forced (
FASTLED_FORCE_SOFTWARE_PINS), sha256 5fdd73fa6151d0a4…The forced and forced +
FASTLED_NO_PINMAPELFs are byte-identical. On ESP32 the NO_PINMAP macro has no further effect.MY9221Controller<2,3,…>::sendWordand::showPixelscall onlyNoPinMapPin<2>::hi/lo,NoPinMapPin<3>::lo, andfl::digitalWrite. They contain nolui 0x60091and no GPIO MMIO stores.Native control (no macros), sha256 c6c5bb04ad121a54…
MY9221 sendWordloadslui 0x60091three times and stores directly to the GPIO registers. It makes noNoPinMapPinordigitalWritecalls.Regression control
In the build copy only, every
FL_FASTPIN_HAS_NO_PINMAPguard insrc/platforms/esp/32/core/fastpin_esp32.h(4 sites) was renamed to a macro that is never defined. That restores the pre-#5241 unguarded_ESPPINspecializations. Building withFASTLED_FORCE_SOFTWARE_PINS+FASTLED_NO_PINMAPthen produced sha256 c6c5bb04ad121a54…, byte-identical to the native ELF, with the same W1TS/W1TC stores above. That is exactly the reported defect. The header was then restored, andcmpagainst the repository copy is clean.Remaining defect, fixed in #5391
The forced route had no
BitbangPin<FastPin<PIN>>specialization. SoBitbangPinDefaults::delay()calledfl::delaycycles<N>(), which is only defined for N <= 50, and the publicSoftwareSPIOutputfailed to link on a forced ESP32.SoftwareSPIOutput<2, 3, DATA_RATE_KHZ(250)>on esp32c6 gave:#5391 shares the existing inline cycle-counter delay with the forced policy. After the fix,
GenericSoftwareSPIOutput<2,3,640>::writeByte(sha256 93ef70e5408408d4…) makes 16NoPinMapPin<2>and 16NoPinMapPin<3>calls. Its delays usecsrr 0x7e2, and it has no0x60091references.On the device (ESP32-C6,
/dev/ttyACM1)Commands:
bash autoresearch esp32c6 --upload-port /dev/ttyACM1 --define FASTLED_FORCE_SOFTWARE_PINSEach run is followed by
findConnectedPinsand the newfastPinLoopbackRPC from #5391. The board found its own jumper, TX=GPIO0 to RX=GPIO1. Spare SPI pins are 18/19.init()NoPinMapPin(softwareRoute=true, no HAS_HARDWARE_PIN_SUPPORT)_ESPPINMMIOData is checked over two writer instances in one boot, and the pin is reused between the level, data and clock phases.
Not covered here
The issue's MY9221 maximum-phase / latch timing item is tracked by #5066 (fix in #5371). This evidence covers route selection and functional output only. It makes no MY9221 electrical or timing compliance claim, and none of the native IRAM evidence is applied to the forced route.
Closing: the forced selection reaches the software fallback in actual SDK builds, the regression control fails as required, and the forced fallback drives correct GPIO and software-SPI output on hardware. The remaining link defect lands with #5391.
fix(esp32): link forced software pins in SoftwareSPIOutput; add fastP…