Make builds portable
Packaged the ESP IDF build setup in Docker so the toolchain and its configuration travel together across development environments.
CASE STUDY · 2026
Update firmware remotely and keep a rollback path ready.
A custom ESP IDF bootloader and flash layout that downloads firmware blocks over WiFi and switches between two application slots for rollback.
OVERVIEW
This project adds a custom application bootloader to an ESP32 update flow. A containerized Docker toolchain builds the firmware, a headless Debian server provides remote image blocks over WiFi, and the device uses two application slots so it can switch execution to the alternate image instead of overwriting the only working firmware.
A remote firmware update has to survive layout mistakes, interrupted transfers, and a newly installed image that cannot boot. The flash partition map and execution pointer must agree exactly, or the device risks writing across a sector boundary or losing its last working application.
HOW I APPROACHED IT
Packaged the ESP IDF build setup in Docker so the toolchain and its configuration travel together across development environments.
Moved the active partition table offset to 0x9000 to avoid sector collisions and defined separate application slots at 0x10000 and 0x1F0000.
Built a background deployment path that downloads remote firmware blocks over WiFi from a headless Debian host.
Added explicit execution pointer switching between the two application slots, preserving the alternate image as the rollback destination.
OUTCOME
The layout and boot flow provide two explicit application destinations and a remote download path. Execution can move to the alternate slot while the previous application remains available for recovery.
BUILT WITH