Home / Learn Embedded C / What Is a Bootloader?
What Is a Bootloader?
A small program that runs first and can load or update the main application firmware.
Breaking it down
The basic idea
A bootloader is a small, separate program that runs immediately after reset, before the main application — its job is to decide whether to run the existing application or load a new one (over UART, USB, or another channel) first.
Why this comes up
Without a bootloader, updating firmware on a deployed device would require physically reprogramming it with a dedicated programmer tool — a bootloader enables field updates through a simple, ordinary communication channel instead.
The mechanics
A bootloader typically occupies a small, fixed region of flash memory, separate from the application's own flash region, and is itself rarely (if ever) updated once deployed, since it is the fallback mechanism that must always remain reliable.
Where it is used
- Field firmware updates
- Product update infrastructure
- Recovery from a bad firmware image
Try it
A real bootloader checks a hardware pin or stored flag for update_requested, and a CRC (next lessons) for current_image_valid.
Try it: a bootloader checking a dedicated "enter update mode" pin
Many real bootloaders check a physical pin (like a held button) at boot time as one common way of requesting update mode, alongside or instead of a software-set flag.
Quick check
1. What is the primary purpose of a bootloader?
A bootloader's core job is the decision point at startup: run what's there, or receive and install new firmware — the foundation of field-updatable devices.