Selected work
07 / 08Firmware · Wireless updates2026

CASE STUDY · 2026

Dual Partition OTA Bootloader.

Update firmware remotely and keep a rollback path ready.

Dual slot update flow

A custom ESP IDF bootloader and flash layout that downloads firmware blocks over WiFi and switches between two application slots for rollback.

OVERVIEW

What it is
and who it helps.

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.

2 slotsIndependent app images
0x9000Partition table offset
WiFi OTARemote firmware delivery
THE CHALLENGE

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

From the first
interaction to the edge cases.

01

Make builds portable

Packaged the ESP IDF build setup in Docker so the toolchain and its configuration travel together across development environments.

02

Reserve safe flash regions

Moved the active partition table offset to 0x9000 to avoid sector collisions and defined separate application slots at 0x10000 and 0x1F0000.

03

Fetch updates from the edge

Built a background deployment path that downloads remote firmware blocks over WiFi from a headless Debian host.

04

Keep a working boot target

Added explicit execution pointer switching between the two application slots, preserving the alternate image as the rollback destination.

OUTCOME

A remote update with a second chance.

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

CESP IDFDockerFlash partitioningWiFiDebian

UP NEXT · 08

HAMi #2125: SSH Memory Limit Reproduction.

Read case study