Ask HN: What is the best way to handle OTA firmware updates on low bandwidth?

1 points by rheidiant ↗ HN
The problem All network-connected devices must support firmware updates for security reasons. This includes devices connected to LPWAN networks like LoRaWAN. For devices operating in remote locations, firmware updates can be done over the network to simplify maintenance requirements. Typical microcontroller firmware ranges from tens of kilobytes to a few megabytes, and typical LoRaWAN download speeds are on the order of 10-100 bytes per second. Thus, firmware updates deployed through a LoRaWAN network must be as small as possible.

Some solutions One way to reduce the size of the update is to modularize the firmware binary so that only part of the binary needs to be updated. For example, the networking stack could be stored in a dedicated area of the program flash and then updated independently of the rest of the firmware. The tricky part here is that the addresses of any functions called by the rest of the firmware must remain the same. This can be done using trampoline functions or by having a look-up table of function pointers. This method makes it easy to update large parts of the firmware but requires advance planning to modularize the code.

Another method, which allows easy updates to application logic, is to insert patch points into the application code. Patch points are function calls that check for the presence of binary firmware patches in a dedicate part of the flash memory. Normally these function calls return without doing anything, but if patch code is present, it will be executed.

The most general method is delta updates, in which a binary diff of the old and new firmware is used to perform a complete update with a smaller download. This is the most flexible option, but it can require a lot of memory on the microcontroller and the download size may still be unacceptably large.

Question What are some other ways to implement updates with small payloads?

0 comments

[ 0.37 ms ] story [ 11.2 ms ] thread

No comments yet.