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.
Theory in plain words
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
ACK/NAK per block makes UART updates reliable even on noisy cables. Block number and its complement catch lost blocks.
| Method | Speed | Needs | Use |
|---|---|---|---|
| UART XMODEM/YMODEM | slow, simple | 2 wires | factory, simple devices |
| USB DFU | fast | USB device | consumer products |
| SD card file | any | card slot | no tools needed in the field |
| Wi-Fi / HTTPS OTA | fast | network, server | IoT |
| BLE DFU | medium | phone app | wearables |
| Delta update | small download | diff tool + more code | cellular, LoRa |
Quick quiz
1. What does a NAK do in XMODEM?
The block is retransmitted.
2. CRC vs signature?
Only signatures authenticate the sender.
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.