bloombloombloom / Bloom

A debug interface for AVR-based embedded systems development on GNU/Linux.
https://bloom.oscillate.io/
Other
64 stars 3 forks source link

Delta programming (restrict uploads to changes only) #95

Open navnavnav opened 7 months ago

navnavnav commented 7 months ago

Currently, when programming the target, we upload the entire program to the target.

But how often does the entire program change between uploads? I think it's safe to say that in most cases, only relatively small changes are made between uploads. This means that we're wasting time updating parts of program memory that hasn't changed.

I believe we could drastically improve upload performance by generating a diff of the current binary and the new binary provided by GDB, and then only applying the changes to program memory whilst ignoring the rest.

First few points that come to mind:

More to follow

navnavnav commented 7 months ago

Thinking about this some more: This will only work for debugWire targets, because there's no requirement for a chip/section erase before programming. For other targets (PDI, UPDI and JTAG), we must perform a chip/section erase before we can program the target. So we'll have to write the whole program binary for every programming session.

This is not worth the effort if it only works on debugWire targets.

I'm going to leave this open for the time-being, as it may be appropriate for a new target family I'm looking to support at some point.

navnavnav commented 7 months ago

This is appropriate for the RISC-V targets that I plan to support in the next feature release (see https://github.com/bloombloombloom/Bloom/issues/96).

With those targets, we're able to perform partial page writes to program memory without having to erase the entire chip. This means we can perform 'delta programming' on these targets.

Not sure when I'll get to this, or if it will be included in the next release, with the initial RISC-V support. Will keep the ticket updated,