Repository navigation
Description
Context
On the configured Apollo3 Arduino profiles, FASTLED_FORCE_SOFTWARE_PINS=1 selects the shared forced provider, and the platform sets FASTLED_NO_PINMAP by default. Its output toggle reads the input sampler then writes the inverse. The Apollo native pin API configures output with input sampling disabled, while its read API explicitly requests input state rather than output-latch state.
The exact configured version chain is important: ci/boards.py:770–780 selects Arduino_Apollo3 v2.2.0, not Ambiq HAL2.2.0. That core's cores/mbed-os gitlink is 5e7ff58f3294033b015ea12fdf1b098109b0549d in SparkFun mbed-os-ambiq-apollo3. Its HAL source identifies itself as AmbiqSuite2.4.2. This is a configured upstream source binding; the actual downloaded release archive/selected compiler headers have not yet been qualified.
Reachable source/API contract
src/led_sysdefs.h:69–71: ARDUINO_ARCH_APOLLO3 selects Apollo sysdefs;led_sysdefs_apollo3.h:38defines NoPinMap.src/platforms.h:56–57selectsfastled_apollo3.h, whose line7 includesfastpin_apollo3.h. Its force guard at line20 suppresses native FastPin specializations. Do not rely on the generic ARM fastpin dispatcher to select Apollo: it has no Apollo branch.src/fl/system/fastpin_base.h:73–74selects actual ForcedSoftwarePin; its NoPinMap mapper leaves input/output pointers null, so setOutput calls fl::pinMode and toggle uses fl::digitalRead then fl::digitalWrite.src/platforms/pin.h:44–45selects Apollo runtime pin API; pin_apollo3.hpp includes pin_apollo3_native.hpp unconditionally, including Arduino builds.pin_apollo3_native.hpp:78–93,112creates zeroed GPIO config with funcsel3, eGPInput=INPUT_NONE, push-pull output, and calls am_hal_gpio_pinconfig. Its digitalRead at134 requests AM_HAL_GPIO_INPUT_READ.- Matched HAL header maps INPUT_NONE=0 / INPUT_ENABLE=1 to PADREG.INPEN. Matched HAL implementation has funcsel3's forced-INPEN bit clear for all50pads; lines491/544 therefore leave input disabled. INPUT_READ at793–801 reads RDA/RDB; OUTPUT_READ at802–805 reads the distinct WTA/WTB output latch. It does not silently substitute output-latch readback.
No exact observed zero, waveform, or physical timing result is claimed. Zero-initialized eIntDir is LO2HI=0, not INTDIR_NONE=2; do not attribute this route to the separate interrupt-config read-zero setting.
Proposal
Provide a supported output-state/toggle contract for Apollo forced NoPinMap pins. A real output-latch or native toggle operation can avoid reliance on a disabled input sampler; preserve the public forced-provider selection and unrelated pin state. The fix must not replace this route with native FastPin specialization merely to pass tests.
Acceptance criteria
- Before implementation, reproduce the mismatch with the actual production provider and Apollo runtime adapter, using the exact release-package HAL contract or a vendor-contract-aware model that distinguishes input sampling from the output latch. Do not use a fake shared input/output port or copy the serializer/provider.
- Compile a real configured Arduino_Apollo3 release2.2.0 profile with FORCE1 and default NoPinMap. Retain release-package hashes, compiler flags/includes, selected macro/type route, and exact HAL source/header identities. Cover one supported RedBoard profile and explicitly list whether Thing Explorable was independently verified.
- Observe the output latch for both initial HIGH/LOW, two successive toggles, and strobe returning to the initial state; check all unrelated GPIO bits. Establish GREEN, restore the actual disabled-input/INPUT_READ defect, require focused behavioral RED, then restore GREEN. Incidental compile failure is insufficient.
- Preserve input-mode semantics, pin-number/pad mapping, invalid-pin behavior, normal native control, and forced NoPinMap initialization. Choose actual accessible pads and verify mapping rather than assuming all logical board numbers equal pads.
- Separate CPU/codegen evidence from physical timing, interrupt/NMI, and electrical qualification. No speed, atomicity, all-variants, or measured waveform claim follows from source/compile evidence.
Decisions
- Track the source/API readback-contract mismatch, without claiming an exact electrical result.
- This is separate from perf: replace Apollo3 software SPI half-period countdown overhead #5030, which concerns the native APOLLO3HardwareSPIOutput loop, and fix(fastpin): prevent null-register access in forced software pins without pin maps #5056, which concerns shared missing-map null safety/include order. Here the fallback deliberately calls a runtime API whose output/input contract is incompatible with read-then-invert.
- Keep investigation and implementation serial; no source fix, compiler, test, or device action was performed for this draft.
Open questions
Actual release-tarball compiler selection and exact silicon input-disable behavior remain unverified. Other Apollo versions/boards and any different HAL are not certified by this source binding.
Related issues
Parent #5024; related distinct requirements #5030 and #5056.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
zackees commentedon Nov 7, 2026
Status check against current master (not a fix): master's forced NoPinMap provider is
fl::NoPinMapPininsrc/fl/system/fastpin_no_pinmap.h. Itstoggle()toggles from the last level written (sHigh ? lo() : hi()) and never callsdigitalRead, so the disabled-input-sampler readback described here does not happen on master. The read/invert toggle exists only insrc/fl/system/forced_software_pin.h, which open PR #5058 adds. This should be fixed (or kept from regressing) in that PR, and is left open for it. No change was made.zackees commentedon Nov 10, 2026
The current-master no-map provider no longer reads the Apollo3 input sampler to toggle an output. PR #5137 / 118409a selects NoPinMapPin, whose toggle uses the level tracked by hi()/lo() and writes through the core pin API (src/fl/system/fastpin_no_pinmap.h:27-36). The shared provider regression was rerun successfully with bash test fastpin_no_pinmap (1/1). No Apollo3 electrical measurement is claimed.
The proposed replacement provider in open PR #5058 must preserve this output-level contract; its sampler-dependent proposal remains an integration concern there. Closing the current-master defect as already fixed rather than adding a duplicate provider.