Right now, you provide code to flash the board with a given hex file (or rather binary), but it always erases the whole flash and re-writes everything which is quite slow.
In MakeCode we have custom code that uploads checksum-computing code to the device, compares generated array of per-page checksums with what's expected and flashes the pages that need that, see https://github.com/Microsoft/pxt-microbit/blob/master/editor/extension.ts
There is some "analyzer" code in DapJS, but it's not used. It also seems to use CRC32, which without hardware support is quite sluggish on slow MCUs like the nrf51. Murmur3 is much faster. The source for the binary murmur3 blob is here: https://github.com/Microsoft/pxt-microbit/tree/master/external/sha (I used that to compare perf of different hashing functions on the microbit)
This seems like a fairly typical thing that one wants to do when flashing a device, and thus I believe it belongs in DapJS. This way the interface area between DapJS and MakeCode would drastically shrink.
Right now, you provide code to flash the board with a given hex file (or rather binary), but it always erases the whole flash and re-writes everything which is quite slow.
In MakeCode we have custom code that uploads checksum-computing code to the device, compares generated array of per-page checksums with what's expected and flashes the pages that need that, see https://github.com/Microsoft/pxt-microbit/blob/master/editor/extension.ts
There is some "analyzer" code in DapJS, but it's not used. It also seems to use CRC32, which without hardware support is quite sluggish on slow MCUs like the nrf51. Murmur3 is much faster. The source for the binary murmur3 blob is here: https://github.com/Microsoft/pxt-microbit/tree/master/external/sha (I used that to compare perf of different hashing functions on the microbit)
This seems like a fairly typical thing that one wants to do when flashing a device, and thus I believe it belongs in DapJS. This way the interface area between DapJS and MakeCode would drastically shrink.