Skip to content

fix(esp32c6): mark USB GPIO12/13 invalid for FastLED outputs #2677

Closed

Description

@zackees

Context

During ESP32-C6 PARLIO testing, a legacy contiguous 16-lane request (baseTxPin=0, numLanes=16) configured lanes on GPIO0..15. On ESP32-C6-DevKitC-1, GPIO12/GPIO13 are the native USB D-/D+ pins, so the test reconfigured the active USB Serial/JTAG link as PARLIO outputs and Windows dropped COM9 until a physical power cycle.

The ESP32 FastPin mapping already has a per-target unusable-pin mask in src/platforms/esp/32/core/fastpin_esp32.h:

  • FASTLED_UNUSABLE_PIN_MASK
  • _FL_PIN_VALID(PIN)
  • _FL_DEFPIN(PIN)
  • FastPin<PIN>::validpin()

The ESP32-C6 branch currently masks flash-reserved pins but does not mark GPIO12/GPIO13 illegal.

Proposal

Update the ESP32-C6 FASTLED_UNUSABLE_PIN_MASK so GPIO12 and GPIO13 are invalid FastLED output pins on C6. The comments should explicitly call out that these are native USB D-/D+ pins and using them can sever USB Serial/JTAG on DevKitC boards.

Also make sure runtime PARLIO/AutoResearch pin validation cannot silently accept those pins when using ChannelConfig / RPC-driven pin selection, since FastLED.add(cfg) does not get the same compile-time static assert as templated FastLED.addLeds<..., PIN>().

Acceptance criteria

  • FastPin<12>::validpin() and FastPin<13>::validpin() are false for ESP32-C6 builds.
  • GPIO12/GPIO13 still remain unaffected on non-C6 targets except where they are already masked by that target.
  • Runtime PARLIO channel setup rejects GPIO12/GPIO13 on ESP32-C6 instead of passing them into parlio_tx_unit_config_t::data_gpio_nums[].
  • AutoResearch parlioStreamValidate reports channel creation failure for C6 pin maps containing GPIO12 or GPIO13 instead of dropping the USB serial connection.
  • A focused build/test proves the mask and validation path compile.

Related issues

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

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions