What is Bootloader?

A small program that runs first at power-on, verifying and starting the main firmware or updating it with new firmware.

Field: Embedded Systems & Firmware

Japanese name: ブートローダ

What happens at power-on

After reset, a processor starts executing from a fixed address, and in many embedded devices the code there is the bootloader rather than the application. It initializes the minimum hardware it needs, checks whether a valid application image is present, usually by validating a header plus a CRC or signature, and then jumps to the application's entry point, typically after setting up the stack pointer and interrupt vector table. If no valid image exists, or an update has been requested, it stays in control and waits for new firmware instead.

Field updates and protecting the bootloader

A bootloader can receive firmware over UART, USB, CAN, Ethernet or a radio link and write it into flash, so products can be fixed after shipping without a hardware programmer. Because a corrupted bootloader would leave the device unrecoverable, or "bricked", it normally sits in a write-protected flash region and is excluded from updates. Many microcontrollers also contain a vendor bootloader in ROM, selected with a boot-mode pin, which is handy for first programming and for recovering a board whose flash is blank or damaged.

A/B slots for safe OTA updates

Overwriting the running firmware in place is risky: losing power or connectivity halfway leaves no bootable image. Over-the-air (OTA) designs therefore split flash into two slots. The new image is written into the inactive slot and verified, and only then does the bootloader switch which slot it boots. If the new version fails to start or never confirms that it is healthy, the bootloader rolls back to the previous slot. The price is roughly twice the flash space for firmware.

Secure boot and the chain of trust

In secure boot, immutable ROM code verifies the digital signature of the first-stage bootloader, that stage verifies the next stage or the operating-system kernel, and so on, forming a chain of trust. A failed check stops the boot, so tampered boot code never runs. A bootloader that checks only a CRC detects accidental corruption but not deliberate modification, because an attacker can simply recompute the CRC; authenticity needs a signature verified with a key the attacker does not have.

Try it: questions about Bootloader

What is the role of a bootloader in an embedded device?

  1. AIt runs first at power-on, starting the main firmware or updating it with new firmware
  2. BA part for fixing the device's casing
  3. CIt automatically fixes bugs in the program
Show answer and explanation

Answer: A. It runs first at power-on, starting the main firmware or updating it with new firmware

A bootloader is a small program stored at a fixed location in flash or ROM that runs first at power-on. Normally it verifies the main firmware and starts it, but it can also receive new firmware over UART, USB, radio and so on and write it to flash. It is usually excluded from updates and protected so that the bootloader itself is never corrupted.

FAQ

What is the difference between a bootloader and firmware?

The bootloader is a small, rarely changed program that runs first and decides what to start; the application firmware is the main program it verifies and launches. The bootloader can also install new application firmware.

Why do OTA updates use two firmware slots?

So the new image can be written and verified while the old one stays intact. If the update is interrupted or the new version fails, the device still boots from the original slot.

Is a CRC check enough for secure boot?

No. A CRC catches accidental corruption, but anyone who modifies the image can recompute it; secure boot requires verifying a cryptographic signature.

Questions that mention Bootloader (2)

Bootloader appears in 3 practice questions across 2 topics, including Embedded Systems & Firmware, Hardware Security.

  1. In devices updated over the air (OTA), why is flash divided into two firmware slots (A and B)?
  2. Which describes secure boot?

Books on Embedded Systems & Firmware Ad

Learn hands-on: parts and kits

Building real circuits is a good way to check what you learned in the questions.

As an Amazon Associate I earn from qualifying purchases.

This page was drafted with AI and fact-checked by a separate AI review before publication. Our Editorial policy explains how we write and check content. If you spot an error, please tell us on our Contact page.

Back to the glossary