Embedded Systems & Firmware

In devices updated over the air (OTA), why is flash divided into two firmware slots (A and B)?

  1. ATo run the same program in both slots simultaneously for double speed
  2. BTo use one slot for storing the user's photos
  3. 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.
Practice this topic Back to topic

More Embedded Systems & Firmware questions

  1. What is the main purpose of using a microcontroller's sleep mode in a battery-powered embedded device?
  2. A sensor device runs at 10 mA for 1% of the time and sleeps at 10 µA for the remaining 99%. What is the closest average current?
  3. Why does firmware on small microcontrollers often avoid dynamic memory allocation such as malloc?
  4. On a small microcontroller without an MMU, what should be kept in mind about excessive stack use?
  5. A 12-bit A/D converter with a 3.3 V reference reads a value of 2048. What is the closest input voltage?