Firmware is the software that lives in a device's non-volatile memory and makes the hardware work: in a keyboard, a disk, a phone's modem, a car's controller. It is written close to the hardware, it is hard to update, and its bugs outlive its authors.
Key concepts
- Hardware first: datasheets, schematics and errata decide what the code must do.
- Startup: vectors, clock setup, memory initialisation, then
main. - Robustness: watchdogs, brown-out handling, defensive defaults and a safe state.
- Updates: signed images, rollback protection and a recovery path when an update fails.
- Testing on and off target: unit tests on the host, hardware-in-the-loop on the bench.
Vocabulary
- Image: the binary written to flash, often with a header, a version and a signature.
- Errata: the vendor's list of how the chip differs from its datasheet.
- OTA: over-the-air update.
- Option bytes, fuses: one-time or protected settings such as read-out protection.
What to study, in order
- Microcontroller basics: registers, interrupts, peripherals.
- Read a schematic and follow a signal from the pin to the connector.
- Write a driver for a sensor from its datasheet alone.
- Add a bootloader and a signed, rollback-safe update.
- Test on the host with mocks, then on the bench with the real board.
Related tags
#microcontrollers #bootloaders #firmware-analysis #hw-sw-integration