05-04-2020, 03:36 AM
(05-02-2020, 03:45 AM)JF002 Wrote: For now, I'm doing some researches on another options : The application is responsible for the download of the new firmware image and for storing it in the memory. Then, the bootloader (which does not embed the ble stack) can detect that a new image is available, swap it with the current one and provide a way to rollback the update if it fails.
The advantage is that the firmware is free to use the BLE stack of its choice, but of course, it is still possible to 'brick' the watch if you flash a firmware that does not allow to OTA another firmware...
A bootloader that doesn't embedded a BT stack doesn't necessarily have to brick on bad updates.
In addition to the relatively small internal flash there is the much larger SPI flash. This allows a bootloader to have three boot slots: main slot in internal flash and two slots in external flash for upgrade image (to replace internal flash) and recovery (simple BLE application that can download a new image and write it into the upgrade slot).
Roughly speaking the upgrade image allows progression from tested image to tested image whilst being robust (and allowing rollback) if the upgrade is broken. The recovery slot is primarily to guard against bricking if both main and upgrade slot have become damaged (e.g. 50 day bugs).