mynewt-mcumgr icon indicating copy to clipboard operation
mynewt-mcumgr copied to clipboard

Incremental update support

Open sjanc opened this issue 6 years ago • 8 comments

This should allow to reduce size of uploaded new image to delta image. Tool for generating delta images should be also provided.

sjanc avatar Mar 11 '19 12:03 sjanc

delta against what?

utzig avatar Mar 11 '19 12:03 utzig

against running firmware

sjanc avatar Mar 12 '19 15:03 sjanc

sorry to ask, not sure you have implementation already or this is just an idea, but is it supposed to do delta sector by sector or the whole firmware? does the linker already stack symbols in a fixed order?

utzig avatar Mar 12 '19 16:03 utzig

I plan to use modified ('stream' friendly) version of bsdiff algorithm [1], which is kinda optimized for elfs. That way while delta is being uploaded (I've already have working stream version of bspatch library), new image in slot1 is reconstructed from delta and image in slot 0.

[1] https://github.com/mendsley/bsdiff

sjanc avatar Mar 13 '19 09:03 sjanc

Nice, I was thinking about how hard would it be to store slot1 in bsdiff form and still enable MCUBoot to updated it; If it is a sector by sector binary diff it might be feasible to swap with a normal image!

utzig avatar Mar 13 '19 10:03 utzig

sector by sector binary diff is not useful since adding even 1 byte to binary will result in rest of the image to have all sectors changed (shifted), and this is where bsdiff shines

sjanc avatar Mar 13 '19 10:03 sjanc

It would be good to refactor mcumgr to allow for streaming firmware updates over BLE as well in this patch. I don't think we'd do patched upgrades for awhile, but it will speed up downloads for everyone if we can avoid having to ACK every chunk. Also, plan to update Android/iOS libraries?

sterlinghughes avatar Mar 13 '19 14:03 sterlinghughes

yeap, I plan to work on streaming too (probably as a separate issue/PR)

As for Android support, maybe, for iOS probably not :)

sjanc avatar Mar 14 '19 08:03 sjanc