Home / Learn Chip Programming / Firmware Update Protocols: XMODEM, DFU and Delta Updates

Firmware Update Protocols: XMODEM, DFU and Delta Updates

How firmware images travel from the PC or cloud to the device safely.

In shortHow firmware images travel from the PC or cloud to the device safely.

Theory in plain words

Update packethost sends block 1 (128 bytes + CRC)device writes to flashACK / NAKrepeat until EOTverify image CRC, reboot
Update packet

What it is

Common transports: UART with XMODEM/YMODEM, USB DFU, SD card file, Wi-Fi OTA, BLE DFU (Nordic). Images include a header with size, version and CRC or signature. Delta updates send only differences.

Why we use it

A reliable update path is a product requirement. A broken update procedure can brick thousands of units.

How it works

Receive data in blocks, write to a secondary slot or directly to flash with page erase, verify, set a flag, reboot. Protect against power loss and reject downgrades.

Where it is used

  • Field upgrade of devices
  • Factory programming
  • BLE wearables

XMODEM packet builder

Build and verify an XMODEM blockTry it Yourself

ACK/NAK per block makes UART updates reliable even on noisy cables. Block number and its complement catch lost blocks.

MethodSpeedNeedsUse
UART XMODEM/YMODEMslow, simple2 wiresfactory, simple devices
USB DFUfastUSB deviceconsumer products
SD card fileanycard slotno tools needed in the field
Wi-Fi / HTTPS OTAfastnetwork, serverIoT
BLE DFUmediumphone appwearables
Delta updatesmall downloaddiff tool + more codecellular, LoRa
Careful:Sign every image (Ed25519 or ECDSA) and verify it in the bootloader. A CRC detects accidents; a signature stops attackers.

Quick quiz

1. What does a NAK do in XMODEM?

2. CRC vs signature?

Common questions

What does a NAK do in XMODEM?

Asks the sender to resend the block. The block is retransmitted.

CRC vs signature?

CRC detects accidents, signature stops tampering. Only signatures authenticate the sender.