Close

Updater ("OTA") lightning fast

A project log for KNXduino

KNX-compatible device based on STM32 MCU with Arduino flavour

pavel-krizPavel Kriz 02/14/2020 at 15:260 Comments

The tool to update KNXduino firmware Over-the-Air, well, Over-the-Wire actually, is called knxduino-updater. Until today, it supported the full image update only. It took 7 minutes to update full 25kB firmware 😞.

Now the updater can perform "diff" update in case it has the old firmware that is currently in device. Only different bytes are sent over KNX bus thus the update is much faster when there are minor changes in the firmware eg. 30 seconds 😀. See the log below.

java -jar knxduino-updater-1.0-SNAPSHOT-all.jar -nat 192.168.0.100 -fileName "/tmp/arduino_build_369255/KNXduinoBlinkOverKNX.ino.hex" -uid 05:B0:01:02:E9:80:AC:AE:E9:07:47:55 -device 15.15.208
Restart device in programming mode...
Unlock device... done (0).
Hex file parsed: starting at 0x8008000, length 25984 bytes
Old firmware's descriptor from MCU: startAddr=0x8008000 endAddr=0x800e580 crc=0x82a71ef8
Olf firmware found in cache (switching to diff upload mode): /home/pavkriz/.cache/knxduino-updater/0.4/image-8008000-25984-82a71ef8.bin
Sending application data (116 diff bytes) 
..........
Program device next page diff, CRC32 0x55fcba92 ... done (0).
Sending application data (5 diff bytes) 
.
Program device next page diff, CRC32 0xe368b554 ... done (0).
Sending application data (5 diff bytes) 
.
Program device next page diff, CRC32 0x538968ed ... done (0).
Sending application data (5 diff bytes) 
.
Program device next page diff, CRC32 0x36258d52 ... done (0).
Sending application data (5 diff bytes) 
.
Program device next page diff, CRC32 0x792de65c ... done (0).
Sending application data (5 diff bytes) 
.
Program device next page diff, CRC32 0x4e2ea853 ... done (0).
Sending application data (5 diff bytes) 
.
Program device next page diff, CRC32 0x1dd01214 ... done (0).
Sending application data (5 diff bytes) 
.
Program device next page diff, CRC32 0x2d459147 ... done (0).
Sending application data (5 diff bytes) 
.
Program device next page diff, CRC32 0x8d70ed87 ... done (0).
Sending application data (5 diff bytes) 
.
Program device next page diff, CRC32 0x8793dcbc ... done (0).
Sending application data (5 diff bytes) 
.
Program device next page diff, CRC32 0x92f7da61 ... done (0).
Sending application data (5 diff bytes) 
.
Program device next page diff, CRC32 0x62fe847a ... done (0).
Sending application data (5 diff bytes) 
.
Program device next page diff, CRC32 0x1e370c38 ... done (0).
Compressed (diffed) stream length = 186
Preparing boot descriptor with start address 0x8008000 end address 0x800e580 with CRC32 0x98fe67cd APP_VERSION pointer 0x0 ... 
..
Update boot descriptor ... done (0).
Restarting device ... 

Discussions