Skip to content

fix: ESP native deploy hangs while writing partitions #379

Description

@zackees

Context
FastLED ESP32-S3 AutoResearch validation is now using fbuild exclusively. While validating LCD_CLOCKLESS on an attached ESP32-S3 (COM22), fbuild successfully built the staged AutoResearch firmware but consistently hung during native ESP flash deploy.

This blocks fbuild-only hardware validation for FastLED LCD/clockless changes even when the firmware build itself succeeds.

Reproduction
From FastLED/FastLED worktree fix/2690-2693-autoresearch-lcd:

bash autoresearch esp32s3 --lcd --upload-port COM22 --lanes 1 --strip-sizes 400 --skip-lint --skip-schema --project-dir .build/pio/esp32s3 --timeout 180 --verbose

The wrapper invokes:

.\.venv\Scripts\fbuild.exe C:\Users\niteris\dev\fastled\.claude\worktrees\fix-2690-2693-autoresearch-lcd\.build\pio\esp32s3 deploy -e esp32s3 -p COM22 -v

fbuild completes the build and produces:

  • .build/pio/esp32s3/.fbuild/build/esp32s3/release/firmware.elf
  • .build/pio/esp32s3/.fbuild/build/esp32s3/release/firmware.bin
  • bootloader.bin, partitions.bin, and boot_app0.bin

Daemon log excerpt:

build completed in 371.3s
verifying ... firmware.bin on COM22 via espflash (esp32s3)
verify-flash: device image differs; proceeding with full flash
flashing ... firmware.bin to COM22 via espflash (esp32s3)
native write: writing region port=COM22 region=Bootloader offset=0x0 size=18736
native write: progress port=COM22 region=bootloader pct=100 current=1 total=1
native write: region complete port=COM22 region=bootloader skipped=false
Binary successfully written to flash!
native write: writing region port=COM22 region=Partitions offset=0x8000 size=3072

After the partitions line, no further progress is logged and the fbuild client/daemon stay alive indefinitely.

I also retried the cached artifact with a conservative upload baud:

.\.venv\Scripts\fbuild.exe C:\Users\niteris\dev\fastled\.claude\worktrees\fix-2690-2693-autoresearch-lcd\.build\pio\esp32s3 deploy -e esp32s3 -p COM22 --skip-build -b 115200 --monitor --timeout 180 --halt-on-success TEST_COMPLETED_EXIT_(OK|ERROR) --halt-on-error panic|abort\(|TEST_FAILED|ERROR

That reproduced the same hang at the partitions region:

verifying ... firmware.bin on COM22 via espflash (esp32s3)
verify-flash: device image differs; proceeding with full flash
flashing ... firmware.bin to COM22 via espflash (esp32s3)
native write: writing region port=COM22 region=Bootloader offset=0x0 size=18736
native write: progress port=COM22 region=bootloader pct=100 current=1 total=1
native write: region complete port=COM22 region=bootloader skipped=false
Binary successfully written to flash!
native write: writing region port=COM22 region=Partitions offset=0x8000 size=3072

Historical daemon logs show the same pattern for ESP32-C6 on COM9: bootloader write completes, then the deploy stops after region=Partitions offset=0x8000.

Expected behavior

  • fbuild should finish flashing partitions and app firmware, then return success or enter monitor mode.
  • If native espflash stalls, fbuild should time out and fall back to esptool or return an actionable deploy error.
  • The fbuild client should not hang indefinitely after a successful bootloader write.

Acceptance criteria

  • ESP32 native deploy completes past the partitions region for ESP32-S3 and ESP32-C6.
  • A failed native write has a bounded timeout and reports the region/offset that failed.
  • FastLED AutoResearch can use fbuild-only deploy+monitor without PlatformIO fallback.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions