WiFive wrote: ↑Wed Jun 26, 2019 5:35 pmthis has to be platform specific on the tool sideinject a bundle of data into RAMthis has to be platform specific on the device sidestores in the appropriate way for the particular platform
So is it really just sleight of hand to force the process to appear consistent across platforms?
Given inevitable differences in hardware, I suppose all cross-platform portability is just "sleight of hand" at some level.
In this case, however, it is still valuable that many aspects of the implementation are common, even if some aren't. For example, the code for encoding and decoding the data bundle is the same, and leverages existing code, on both the host and device, that serves other purposes as well. Similarly, the code on the device that writes the data to persistent storage uses a cross-platform key-value storage abstraction that already exists for each platform and is used in the normal operation of the device.
Effectively, the only significant platform-dependent code that is unique to the provisioning process is the code that injects the data bundle into RAM and reboots the device. On the Nordic nRF52840, this is implemented in a few dozen lines of python code and a call out to a single Nordic-supplied command line tool. If I can figure out the reboot issue, the implementation for the ESP32 will be nearly as simple.