Skip to content

nRF52 board variants native FastPin definitions bypass forced software pin selection #5070

Closed

Description

@zackees

Parent: #5024. Related native optimization child: #5048. Its GPIO store/race/timing acceptance remains unchanged; this functional selection defect is a separate prerequisite and cannot close that optimization task.

FASTLED_FORCE_SOFTWARE_PINS chooses the primary FastPin<PIN> : detail::ForcedSoftwarePin<PIN> in src/fl/system/fastpin_base.h. The selected platform route below still defines explicit native specializations, which override that primary. Safe fallback methods from #5056 cannot fix selection of a different type.

Source checkpoint: b6935e7b1311ce182a71138c6ee6ca479b188bc2.

  • Conditional route: NRF52_SERIES plus recognized board/TARGET variant.
  • Dispatch chain: platforms.h NRF52_SERIES→fastled_arm_nrf52.h→fastpin_arm_nrf52.h→thisvariantsheader171; nativeexplicitmacrosfl::FastPin unexcluded.
  • Source SHA-256: d1874d37698c26ce1bd1f1954097dd093e18efba15391a4235b4d4cbe3d3605e.
  • src/platforms/arm/nrf52/fastpin_arm_nrf52_variants.h:42: template<> class fl::FastPin<ARDUINO_PIN> : \
  • src/platforms/arm/nrf52/fastpin_arm_nrf52_variants.h:51: #define _FL_DEFPIN(ARDUINO_PIN, BOARD_PIN, BOARD_PORT) \

Source-confirmed conditional finding only: no new forced SDK build, runtime waveform or physical timing measurement is claimed.

The generated audit records all query results, 103 inspected source paths, 35 definition sites, guards and include edges. Its source positives were independently reviewed. Local audit: .build/spi-force-selection-audit/report.json, SHA-256 ebb780d4d10fc2a0981f505e5c355dedb5636dfa9fe313b5650a6f96bf42407b. No filename/string-absence heuristic alone establishes this finding.

Required acceptance:

  • Exercise every recognized board/TARGET branch and raw fallback in fastpin_arm_nrf52_variants.h, P0/P1 legal pins, NFC/user-LED options and user-target overrides. Do not infer all-board coverage from one Feather build.
  • Use actual SDK selected-type and executed-route controls with force off/on, mapped and NO_PINMAP configurations. Include-only and real generic software-SPI producers must compile in the intended modes; independent MY9221 users must remain compatible where supported. A macro appearing in a producer or a successful native build is not forced-fallback evidence.
  • Preserve native defaults and applicable pin validity, logical mapping and user exclusions. Prove ordering, initialization LOW, single-bit/byte/bulk GPIO behavior and subsequent pin reuse on the actual selected implementation. Keep native store-count/timing optimization controls separate.
  • Restore the old unguarded-specialization defect and require the same type/route gate to fail for the intended reason. An unrelated compiler/setup failure is insufficient. Bind source, SDK/compiler/configuration, commands and actual artifacts in the managed gate.
  • Recheck actual fallback callees and code/data placement for timing-sensitive consumers. Native IRAM/SRAM receipts cannot certify a newly selected software fallback. No GPIO latency credit or physical-speed claim is authorized by this selection fix.

This issue is unresolved. Closing it must not close the related optimization issue or imply electrical/timing validation.

Activity

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

    @zackees
    MemberAuthor

    Additional source-derived acceptance requirement for the future forced-NoPinMap route; this does not claim that route currently executes.

    Recognized nRF52 variant specializations still override FASTLED_FORCE_SOFTWARE_PINS, which is this issue's prerequisite. Once fixed, cover FASTLED_FORCE_SOFTWARE_PINS=1 plus explicit FASTLED_NO_PINMAP (not the nRF52 default). The actual runtime adapter is src/platforms/arm/nrf52/pin_nrf52.hpp: output calls nrf_gpio_cfg_output() at41–42; read calls nrf_gpio_pin_read() at61–62.

    A concrete core version admitted by the configured framework-arduinoadafruitnrf52@^1.10601.0 range is Adafruit1.6.1. Its bundled Nordic HAL disconnects input in cfg_output; input-read documentation requires input connected, and the implementation reads IN. Its Arduino digitalRead control instead reads OUT for an output pin. This is an admitted source version, not proof of the actually resolved release package, SDK headers, or Mbed legacy HAL.

    After the selector fix, qualify the actual production forced provider and selected runtime/HAL route with an output-latch/readback oracle: both initial HIGH/LOW states, two successive toggles, strobe returning to its initial state, and unrelated GPIO preservation. Distinguish the input sampler from the output latch; a fake shared port or selected-type assertion alone is insufficient. Bind the actual package/headers/flags and mapping. Require focused GREEN, restoration of the disabled-input/input-read path to produce controlled behavioral RED, and restored GREEN. Preserve all existing variant/provider-selection and native optimization requirements; do not treat this comment as completing #5048 or broadening evidence to every SDK.

    This remains a latent source/API-contract obligation behind the current selector defect. No current forced-route execution, exact returned value, electrical waveform, timing, or physical acceptance is claimed. No new duplicate child is requested.

  3. zackees commented on Nov 7, 2026

    @zackees
    MemberAuthor

    #5149 (in the merge queue) makes FASTLED_FORCE_SOFTWARE_PINS select the software FastPin on nRF52, while the PWM/SPIM drivers keep native routing through a new always-present Nrf52HwPin. It also fixes _FL_DEFPIN ignoring BOARD_PORT, which sent the 45 short-form P1 entries to P0 PSEL.

    Still open on this issue:

    • No hardware run of PWM or SPIM output in either mode.
    • Selection is proven by real-SDK compile probes and a pin-table pytest, not by a host C++ test.
    • The shared software FastPin's toggle() writes the IN register, which does nothing on nRF52, and its hi()/lo() are non-atomic. That template is unchanged.
  4. zackees commented on Nov 22, 2026

    @zackees
    MemberAuthor

    Closing with an accepted limitation. The remaining defect moves to #5396.

    Fix: #5149 (2a8f55d). fastpin_arm_nrf52_variants.h:44-54 always emits a native Nrf52HwPin and specializes FastPin only outside forced mode, so FASTLED_FORCE_SOFTWARE_PINS now selects the software template (fastpin_arm_nrf52.h:136). The PWM and SPIM drivers keep native routing through Nrf52HwPin. _FL_DEFPIN now honors BOARD_PORT, so short-form P1 pins no longer route to P0.

    Proven by: ci/tests/test_nrf52_pin_table.py and real-SDK nRF52 compile probes in both modes.

    Accepted limitations:

    The #5031 binding is replaced by a rescoped host-side gate, tracked in #5031.

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