Embedded Systems & Firmware
In devices updated over the air (OTA), why is flash divided into two firmware slots (A and B)?
- ATo run the same program in both slots simultaneously for double speed
- BTo use one slot for storing the user's photos
- CSo new firmware can be written to the other slot, and if anything fails the device can still boot from the original slot
Show answer and explanation
Answer: C. So new firmware can be written to the other slot, and if anything fails the device can still boot from the original slot
Writing directly over the running firmware leaves the device unbootable if power or communication is lost midway. With two slots, the new firmware is written to the unused slot, verified, and only then is the boot slot switched. If the new version fails to boot, the bootloader reverts to the original slot. It needs twice the flash, but updates become safe.
- A. They do not run simultaneously.
- B. Both slots are for firmware.
- C. Correct. It keeps a failed update from bricking the device.