Research Careers Contact

GlossaryFirmware flashing

Firmware flashing

Firmware flashing is the step that writes a program image into a device's non-volatile memory, such as the flash inside a microcontroller or an external flash chip, so the board can run. In manufacturing, it usually happens after assembly and before or during test, and it often also writes per-board data such as a serial number or calibration values.

How it works

There are two main approaches. Offline programming writes the image into blank chips before they are placed on the board, using a programmer with sockets, often an automated handler that takes parts from tape and returns them to tape. In-system programming, or ISP, writes the image after the chip is soldered down, through a debug or programming port on the board, such as JTAG, SWD, SPI for external flash, or UART or USB to a built-in bootloader. The programmer reaches the port through a connector, test points or a test fixture, holds reset and boot mode pins, and runs the sequence below. IEEE 1532 standardized in-system configuration of programmable devices over the IEEE 1149.1 test access port, so CPLDs and FPGAs program in a standard way. Microcontrollers mostly use their makers' own protocols over JTAG, SWD or serial ports.

The trade-off between the two is timing and stock. Offline programming frees the line from programming time but needs pre-programmed parts for each firmware version. ISP lets firmware change up to the last moment and makes per-board data easy to add, at the cost of test time and pins the fixture has to reach.

A production flashing step follows the same pattern whichever path it takes:

  1. Identify the board, usually by scanning its serial number label.
  2. Select the correct image and version for that product and revision.
  3. Erase the target memory and write the image.
  4. Read back and compare the written data, or check its checksum.
  5. Write board-specific data, such as serial number, MAC address, keys or calibration.
  6. Set protection, such as locking the debug port or enabling secure boot.
  7. Record what was written, with versions and checksums, against the board's serial number.

Images for products that update in the field are often signed. A firmware update architecture such as the one in RFC 9019 describes how devices check that an image is authentic before running it. NIST SP 800-193 gives guidelines for protecting, detecting and recovering platform firmware.

Firmware flashing vs firmware update

Flashing in the factory starts from a blank or known state, with physical access to the board. A firmware update in the field replaces an existing image, usually over a network or a cable, through code already on the device. Both write an image, but a field update has to protect against interrupted power, tampered images and rollback to old versions, while factory flashing focuses on speed, correct versions and records.

Why it matters

The wrong image on a good board makes a bad product. A board flashed with an old version, the wrong product's image or a debug build behaves wrongly in ways that hardware test does not catch. Flashing is also often the slowest step after assembly, because large images take time to write through slow debug ports.

Security depends on this step too. Leaving debug ports open, using a shared key for every unit or skipping secure boot settings creates weaknesses that last for the life of the product.

How to get it right

  • Control images like parts. Store released images with version, checksum and the product revision they belong to. Flash only from the released set.
  • Tie every write to a serial number. Record which image, version and per-unit data went onto each board.
  • Read back or check every write. Confirm the written data matches the intended image.
  • Plan the port. Bring out programming pins to test points or a connector a fixture can reach, and include them in design for test. Keep reset and boot mode pins controllable from the programmer, and keep other circuitry from loading the programming lines.
  • Lock down after flashing. Apply debug locks, secure boot and unique keys as a defined step, and test that they took effect.
  • Measure time. Choose offline or in-system flashing, port speed and image size with the line's pace in mind.

Firmware flashing in robotics and drone hardware

A robot or drone often has several programmable parts: a main processor, motor controllers, sensor hubs, a radio and sometimes an FPGA. Each needs its own image, at a version that matches the others. Flashing all of them in a fixed order, with a record per board, keeps a fleet consistent and makes field issues traceable to a firmware set.

Robot and drone makers also update firmware often during development. Fast, scripted flashing and clear image control let a hardware team build boards on a new firmware release without mistakes in the version.

Learn more