Skip to content

fix(esp32-s3): LCD_CLOCKLESS multi-chunk ISR re-arm corrupts chunks after first #2693

Closed

Description

@zackees

Context

#2647 reported an ESP32-S3 LCD_CLOCKLESS interrupt watchdog panic for 8/16 lanes x 256 WS2812 LEDs. #2648 fixed that reported case by making the ISR-linked path IRAM/ISR-safe, using ISR-safe semaphore handling, setting LCD I80 trans_queue_depth = 2, forcing equal chunk sizes, and raising kDefaultChunkInputBytes to 1024 so typical frames fit in one chunk.

The original 16 lanes x 256 LEDs WS2812 frame is 768 source bytes per lane, so it now stays in a single chunk. That path was hardware-verified in #2648 with:

bash autoresearch esp32s3 --lcd --upload-port COM<x> --lanes 16 --strip-sizes 256 --skip-lint
TEST LCD_CLOCKLESS lanes=16 leds=4096 PASS 1694ms
Tests: 4/4 passed

Problem

The remaining limitation documented during #2647/#2648 is that the chunked-streaming ISR re-arm path still corrupts data after the first chunk. This affects frames that exceed the 1024-byte default source chunk size per lane, or tests that force a lower chunk size via setChunkInputBytesForTest().

Observed during the #2647 investigation:

  • First chunk encoded/submitted from beginTransmission() in task context is correct.
  • Later chunks encoded/submitted from isrChunkDone() show roughly 87-92% byte corruption in RX-loopback captures.
  • The IWDT panic is gone after trans_queue_depth = 2, but multi-chunk wire data remains incorrect.

Likely Areas

  • Inter-chunk gap may exceed the WS2812 reset window when each esp_lcd_panel_io_tx_color() call re-enters the LCD I80 command/data phase.
  • ChannelData::getData() and related virtual dispatch happen in the ISR-side encode path and may not be suitable while flash cache is suspended.
  • Ring buffer reuse should be audited with trans_queue_depth = 2 and three encode buffers.
  • PARLIO's worker-task pattern is likely the cleaner long-term model: ISR signals a high-priority task, and the task encodes/submits the next chunk.

Acceptance Criteria

Related

Activity

  1. added a commit that references this issue on Jun 3, 2026
    fa79f3f
  2. moved this from Triage to Done in FastLED Trackeron Jun 3, 2026
  3. added a commit that references this issue on Jun 4, 2026
    65c95b2
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