Merge branch 'ab_update' into main

Bring the A/B firmware slots into main, so that releases contain them.
This commit is contained in:
Matt Spencer committed 2026-11-29 01:14:32 +00:00
commit ae5ed848ad
10 files changed
+327 -8

No files matched your search

+23
View File
@@ -67,6 +67,29 @@ the partition table in `partitions.csv` and then starts the monitor. The Zigbee
network state is kept in the `storage` partition, so reflashing keeps the
light on its network.
### Firmware slots
The flash has two app slots, `ota_0` and `ota_1`, and an `otadata` partition
that tells the bootloader which to run, so a new image can be written to the
idle slot while the other keeps running. A USB flash always writes slot 0 and
clears `otadata`, which is why the runner passes `--erase-parts otadata`: without
it, a board that had switched to slot 1 would keep booting the old image.
Changing from the old single-slot partition table to this one needs one USB
flash. The network state is not touched.
The firmware logs which slot it is running from and the state of its image, and
marks a new image as valid once it has stayed up for 20 seconds. Switching
slots has no update source yet (see `TODO.md`). Two development features
exercise it without one: `ota-test` switches to the other slot 30 seconds after
every boot, and `ota-test-crash` resets without confirming the image. Set
`FW_LABEL` when building to tell images apart in the log, and write an image to
the idle slot with `espflash save-image` and `espflash write-bin`.
**There is no rollback yet.** The bootloader that `espflash` installs is not
built with rollback support, so an image that crashes after being selected will
keep being booted. Recover by flashing over USB.
To build without Zigbee, for example to test the strip and encoder on their own:
```sh