common bootloader?
#13
(05-07-2020, 09:35 AM)lupyuen Wrote: Yep I'll be supporting External SPI Flash for storing the Standby Firmware Image... But first I will have to make MCUBoot work with Internal Flash :-)

MCUBoot currently supports only 2 Firmware Images: Active and Standby. The new firmware image is downloaded directly into the Standby slot. After downloading the new firmware, MCUBoot swaps the Active and Standby images.  The swap also happens when rolling back to the previous firmware.

Is this good enough? Or do we need 3 images?
Both? Big Grin
I definitely don't think any quibbles about the recovery partition should be allowed to slow down any kind of proof-of-concept development. The only thing I think that should be done at the proof-of-concept stage is to reserve the space for it in the default SPI flash layout: repartitioning flash devices always results in more pain than you think it will... so better to reserve the space early.

Nevertheless I do think it will be needed in the long term. mcuboot is based around active/standby images but they did have to accept reality and also offer a UART based loader system (the BOOT SERIAL mode) to cope with emergencies such as both images being inoperable (e.g. a bug that prevents boot but has been dormant until after the point it exists in both images). The PineTime cannot implement BOOT SERIAL mode so I think a third boot slot is useful to handle emergencies. The code should be very simple because it will nothing except copy the recovery image to the application slot overwriting whatever is there. No slot exchange, no backing up slot 0, just a couple of files from nrfx and maybe 150 lines of C. 

PS If you are getting to grips with how to write to flash then take a look at the tool I use for OTA updates to wasp-bootloader since it ends up as an example of how easy using nrfx is. Some of the nrfx drivers can't be used from a bootloader but the nrfx driver for the NVM has a liberal software license, minimal dependencies and doesn't use interrupts makes into super easy to integrate:
https://github.com/daniel-thompson/wasp-...lash.c#L31

Oh yes... and if you want to reuse anything from wasp-os (the code to put up a splash screen in the bootloader for example) then let me know. I'm happy both to clean it up for reuse and to relicense if needed.
PineTime: wasp-os and MicroPython, Pinebook Pro:  Debian Bullseye


Messages In This Thread
common bootloader? - by Jeeves - 12-05-2019, 04:36 AM
RE: common bootloader? - by lupyuen - 12-05-2019, 04:43 AM
RE: common bootloader? - by Jeeves - 12-05-2019, 05:24 AM
RE: common bootloader? - by lupyuen - 12-05-2019, 06:07 AM
RE: common bootloader? - by Jeeves - 12-05-2019, 06:17 AM
RE: common bootloader? - by Independent_Contact - 01-10-2020, 10:39 AM
RE: common bootloader? - by geoffrey.vl - 05-01-2020, 07:29 AM
RE: common bootloader? - by JF002 - 05-02-2020, 03:45 AM
RE: common bootloader? - by danielt - 05-04-2020, 03:36 AM
common bootloader? - by lupyuen - 05-02-2020, 04:17 AM
RE: common bootloader? - by geoffrey.vl - 05-02-2020, 12:51 PM
common bootloader? - by lupyuen - 05-07-2020, 09:35 AM
RE: common bootloader? - by danielt - 05-07-2020, 10:06 AM
common bootloader? - by lupyuen - 05-08-2020, 10:29 AM
common bootloader? - by lupyuen - 05-09-2020, 12:39 PM
RE: common bootloader? - by danielt - 05-11-2020, 05:34 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Lightbulb New version of MCUBoot bootloader : I need your help! JF002 15 18,091 02-01-2021, 01:50 PM
Last Post: VMMainFrame
Information PineTime Updater for Flashing New Bootloader and FreeRTOS Firmware lupyuen 2 4,711 07-31-2020, 05:10 PM
Last Post: lupyuen
  MCUBoot Bootloader for PineTime lupyuen 2 5,105 05-18-2020, 04:23 PM
Last Post: lupyuen
  wasp-bootloader: a robust SoftDevice bootloader for PineTime danielt 3 4,882 04-14-2020, 05:31 AM
Last Post: danielt

Forum Jump:


Users browsing this thread: 1 Guest(s)