Differential update allows you to update your device using a differential update file (patch file) instead of a complete new binary. This can save a considerable amount of space and bandwidth while downloading the new firmware. The exact size of the patch file depends on the differences between the source and the target versions and it will usually be quite small when upgrading to a successive version.
Note: You can only perform the differential updates if your current firmware version supports this feature. The target can be any version above 1.20. You can check whether this feature is enabled in your firmware or not by calling pycom.diff_update_enabled() function.
1.20
pycom.diff_update_enabled()
The differential update files can be generated by using our DiffCreator tool which uses bsdiff. In order to generate the differential update file, you will need the following tools and files:
DiffCreator
bsdiff
Note: The binary files used for this are the .bin files generated after the firmware is built. If you have downloaded the firmware as a compressed archive, you can decompress it to find the .bin file.
make
./diff_creator source.bin target.bin patch.bin
source.bin
target.bin
patch.bin
Note: replace the .bin filenames with the actual filenames.
.bin
This will create the patch.bin file which can be used to upgrade your firmware instead of target.bin file.
To apply the differential update, use any of the methods described here by using your generated differential update file (e.g. patch.bin) as the new firmware binary.
The following message will be displayed on REPL when a differential update file is detected by the device:
Differential Update Image detected. Restart the device to apply the patch.
After this, the device must be restarted so that the patch can be applied. After restart, you should see the following messages in REPL:
Patching the binary... Patching SUCCESSFUL.
After patching is done, the device will restart again automatically and this time the updated firmware will be loaded.