Skip to the content ForoHackers
Log inJoin

Firmware: start here

Firmware
#2949 · · Quote · Report

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

  1. Microcontroller basics: registers, interrupts, peripherals.
  2. Read a schematic and follow a signal from the pin to the connector.
  3. Write a driver for a sensor from its datasheet alone.
  4. Add a bootloader and a signed, rollback-safe update.
  5. Test on the host with mocks, then on the bench with the real board.

Related tags

#microcontrollers #bootloaders #firmware-analysis #hw-sw-integration

You are not logged in, so this goes up anonymously: no account, no name and no address is stored with it, and it may carry no link and no image. Log in or join to post under your name. Our web server's logs keep the address and time of every request for up to 14 days; to keep yours out of them, use Tor. To reach the staff in confidence, use the drop. Sign as a returning source (a key kept only in this browser)

Sending takes a few seconds here: your browser first works out a proof of work against spam.

Reply