Skip to content

feat(arduino): Add support for fast flashing with esptool#422

Merged
hfudev merged 1 commit into
espressif:mainfrom
lucasssvaz:feat/arduino_fast_flash
Jun 3, 2026
Merged

feat(arduino): Add support for fast flashing with esptool#422
hfudev merged 1 commit into
espressif:mainfrom
lucasssvaz:feat/arduino_fast_flash

Conversation

@lucasssvaz
Copy link
Copy Markdown
Member

Description

This pull request introduces a robust "fast-flash" mechanism for Arduino-based ESP devices, enabling incremental reflashing using esptool's --diff-with feature. This approach speeds up firmware updates by flashing only changed regions and maintaining per-binary reference files. The implementation includes changes to flash argument parsing, flashing logic, reference management, and comprehensive tests to ensure correctness and reliability.

Fast-flash and flashing logic improvements:

  • Refactored the parsing of the flash_args file in ArduinoApp to extract both flash settings and a list of (address, filepath) pairs, enabling individual binary flashing instead of using a merged binary. (pytest_embedded_arduino/app.py) [1] [2] [3] [4] [5]
  • Implemented per-binary fast-flash logic in ArduinoSerial, using esptool's --diff-with with reference binaries to speed up reflashing. Added mechanisms to save and invalidate references, and ensured certain binaries (like boot_app0.bin) are always fully flashed. (pytest_embedded_arduino/serial.py) [1] [2] [3] [4]

Testing and reliability:

  • Added an extensive test suite to verify the fast-flash mechanism, including tests for reference path generation, flashing behavior with and without references, error handling, and the effect of disabling fast-flash. (pytest-embedded-arduino/tests/test_arduino.py)

Configuration and integration:

  • Added support for a fast_flash/no_fast_flash option in the DUT factory, allowing users to enable or disable the fast-flash feature via test configuration. (pytest_embedded/pytest_embedded/dut_factory.py) [1] [2] [3]

Dependency update:

  • Updated the minimum required version of esptool to 5.2 to ensure compatibility with the new fast-flash features. (pytest-embedded-serial-esp/pyproject.toml)

Testing

Tested locally

@lucasssvaz lucasssvaz force-pushed the feat/arduino_fast_flash branch from 3fe1257 to c1dad11 Compare June 1, 2026 19:15
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 1, 2026

Title Coverage Tests Skipped Failures Errors Time
Qemu Coverage 7 0 💤 0 ❌ 0 🔥 24.632s ⏱️
3.14 X64 Coverage 117 16 💤 0 ❌ 0 🔥 15m 29s ⏱️
3.10 ARM64 Coverage 117 18 💤 0 ❌ 0 🔥 12m 54s ⏱️

@lucasssvaz lucasssvaz force-pushed the feat/arduino_fast_flash branch 2 times, most recently from b2d8cac to cbba1b5 Compare June 1, 2026 21:15
Copy link
Copy Markdown
Member

@hfudev hfudev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, left a few questions.

Comment thread pytest-embedded-arduino/pytest_embedded_arduino/serial.py
Comment thread pytest-embedded-arduino/tests/test_arduino.py Outdated
Copy link
Copy Markdown
Member

@hfudev hfudev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. i think this is the last one. Also please polish the commit history. This project is using the commit message to generate the release notes.

Comment thread pytest-embedded/pytest_embedded/plugin.py Outdated
@lucasssvaz lucasssvaz force-pushed the feat/arduino_fast_flash branch from 5e9aaf2 to 7ef3196 Compare June 2, 2026 14:27
@hfudev hfudev merged commit b1ea228 into espressif:main Jun 3, 2026
6 checks passed
@hfudev
Copy link
Copy Markdown
Member

hfudev commented Jun 3, 2026

Thank you. will do a quick release today

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.

2 participants