PineTime SD MCUBoot

From PINE64
Revision as of 16:47, 10 August 2020 by Lupyuen (talk | contribs) (Adding solution)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

The Problem:

- PineTime ships with the MCUBoot Bootloader which boots to the InfiniTime Firmware

- This assumes that the firmware (InfiniTime, Mynewt, Zephyr, ...) has its own Bluetooth LE (BLE) stack and can handle firmware updates (DFU)

- But some firmware (wasp-os, ATCwatch) require Nordic SoftDevice to be installed to support the BLE and DFU functions

- InfiniTime Firmware does not support flashing of SoftDevice as firmware update, because SoftDevice needs to be flashed at address 0x0, which is used by the MCUBoot Bootloader

- How do we allow SoftDevice-based firmware to be flashed to PineTime via DFU?

Preferred Solution:

- We will use DFU to flash a SoftDevice Loader Firmware, which will boot and replace MCUBoot by SoftDevice

- Thereafter, when PineTime boots, it will start SoftDevice and will be ready to accept SoftDevice-based firmware for DFU: wasp-os, ATCWatch

- When we need to switch back to MCUBoot-based firmware (InfiniTime, Mynewt, Zephyr, ...), we will run an MCUBoot Loader to replace SoftDevice by MCUBoot plus a Minimal DFU Firmware that accepts DFU commands

- After rebooting, MCUBoot starts the Minimal DFU Firmware, which will accept MCUBoot-based firmware for flashing

- The MCUBoot-based firmware replaces the Minimal DFU Firmware

- SoftDevice Loader, https://github.com/daniel-thompson/wasp-reloader

Alternative Solution:

- Custom MBR: https://forum.pine64.org/showthread.php?tid=9779&pid=65203#pid65203