Skip to content

fix(stm32): writeBit cannot produce start bits when hardware SPI owns the pins #5116

Closed

Description

@zackees

Found by CodeRabbit on #5115. With FASTLED_ALL_PINS_HARDWARE_SPI, STM32SPIOutput::writeBit writes GPIO while the SPI peripheral may own the data and clock pins, so FLAG_START_BIT output (for example SM16716) can fail. This predates #5115 and has not been reproduced on hardware. Part of #5024.

Activity

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

    @zackees
    MemberAuthor

    PR #5175 fixes the STM32duino HAL path. writeBit now takes the pins back as GPIO for the bit, then spi_init() restores their SPI function. Still open here:

    • The Arduino Mbed (MbedSPI, GIGA) path still drives pins that the SPI peripheral owns.
    • Not checked on hardware.
    • Separate, pre-existing problem: the HAL path sends bytes on the board's default SPI_MOSI/SPI_SCK, not on DATA_PIN/CLOCK_PIN.
  3. zackees commented on Nov 9, 2026

    @zackees
    MemberAuthor

    Verified the reported STM32 HAL writeBit ownership defect is already addressed on master by f4db884 (PR #5175). writeBit hands the HAL SPI pins to GPIO to emit the bit and restores SPI ownership afterward. This is confirmation of the merged source fix, not a new physical waveform measurement; no additional patch is needed for the tracked defect.

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