Skip to content

Apollo3 forced NoPinMap toggle relies on disabled input sampling #5089

Closed

Description

@zackees

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:38 defines NoPinMap.
  • src/platforms.h:56–57 selects fastled_apollo3.h, whose line7 includes fastpin_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–74 selects 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–45 selects Apollo runtime pin API; pin_apollo3.hpp includes pin_apollo3_native.hpp unconditionally, including Arduino builds.
  • pin_apollo3_native.hpp:78–93,112 creates 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

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.

Activity

  1. added
    sanitized
    on Nov 6, 2026
  2. zackees commented on Nov 7, 2026

    @zackees
    MemberAuthor

    Status check against current master (not a fix): master's forced NoPinMap provider is fl::NoPinMapPin in src/fl/system/fastpin_no_pinmap.h. Its toggle() toggles from the last level written (sHigh ? lo() : hi()) and never calls digitalRead, so the disabled-input-sampler readback described here does not happen on master. The read/invert toggle exists only in src/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.

  3. zackees commented on Nov 10, 2026

    @zackees
    MemberAuthor

    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.

  4. moved this from Triage to Done in FastLED Trackeron Nov 10, 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

    sanitized

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions