Skip to content

Test flashing speed improvements - #1060

Open
SergioGasquez wants to merge 5 commits into
esp-rs:mainfrom
SergioGasquez:feat/flashing-speed
Open

Test flashing speed improvements#1060
SergioGasquez wants to merge 5 commits into
esp-rs:mainfrom
SergioGasquez:feat/flashing-speed

Conversation

@SergioGasquez

Copy link
Copy Markdown
Member
  • Update all flasher stubs to https://github.com/espressif/esptool/tree/master/esptool/targets/stub_flasher/2
    • The newer stubs improve buffering, support asynchronous flash operations and blank-sector handling, and boost the flash clock on supported chips.
  • Switch to the requested baud rate before uploading the larger stub
  • Fall back to an uncompressed flash transfer when deflate output would be larger than the original data
  • Add regression coverage for the 32-bit FLASH_END and FLASH_DEFL_END payloads required by current stubs

Benchmarks

Benchmarked on an ESP32-C6 connected through a CP2102N USB-to-UART adapter, flashing the approximately 1.16 MiB
espflash/tests/data/esp_idf_firmware_c6.elf image. Times are wall-clock flash-command durations; lower is better.

Scenario Existing implementation This PR Improvement
Representative run at 921,600 baud 12.609 s 11.516 s 8.7% faster
Correctness-verified run at 921,600 baud 14.650 s 13.460 s 8.1% faster
Pre-erased flash at 921,600 baud 11.317 s 10.495 s 7.3% faster

At 115,200 baud, the new implementation was 0.9% slower because the newer stub is larger and cannot benefit from the early baud-rate change. Most of the improvement is therefore visible at higher baud rates, 921,600 baud is recommended when supported by the adapter and target.

After benchmarking, the flashed contents were checked using target-side MD5 verification and the temporary flash region was cleaned.

@SergioGasquez SergioGasquez changed the title Feat/flashing speed Test flashing speed improvements Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant