PINE64
Configure Mynewt for SPI Flash - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PineTime (https://forum.pine64.org/forumdisplay.php?fid=134)
+--- Forum: Development Discussion on PineTime (https://forum.pine64.org/forumdisplay.php?fid=136)
+--- Thread: Configure Mynewt for SPI Flash (/showthread.php?tid=9858)



Configure Mynewt for SPI Flash - lupyuen - 05-14-2020

Hi All: Here's my new article that explains how we may access PineTime's SPI Flash with Mynewt OS. 

We'll be using SPI Flash in the MCUBoot Bootloader for storing the old firmware, so that MCUBoot can roll back to the old firmware if the new firmware doesn't start.

Configure Mynewt for SPI Flash on PineTime Smart Watch (nRF52)


RE: Configure Mynewt for SPI Flash - danielt - 05-15-2020

Is there any code in your SPINOR code to manage power saving mode? I took a quick look and couldn't see it.

This issue caught me out for wasp-os (https://github.com/daniel-thompson/wasp-os/issues/6#issuecomment-599203312 ) and it will save debugging later to ensure the wakeup command is issued by mynewt and mcuboot automatically.


RE: Configure Mynewt for SPI Flash - lupyuen - 05-15-2020

(05-15-2020, 05:36 AM)danielt Wrote: Is there any code in your SPINOR code to manage power saving mode? I took a quick look and couldn't see it.

This issue caught me out for wasp-os (https://github.com/daniel-thompson/wasp-os/issues/6#issuecomment-599203312 ) and it will save debugging later to ensure the wakeup command is issued by mynewt and mcuboot automatically.

Nope sorry :-)  My code will mostly be used by the MCUBoot Bootloader, which doesn't have to worry about power issues (I think)


RE: Configure Mynewt for SPI Flash - danielt - 05-16-2020

(05-15-2020, 04:29 PM)lupyuen Wrote:
(05-15-2020, 05:36 AM)danielt Wrote: Is there any code in your SPINOR code to manage power saving mode? I took a quick look and couldn't see it.

This issue caught me out for wasp-os (https://github.com/daniel-thompson/wasp-os/issues/6#issuecomment-599203312 ) and it will save debugging later to ensure the wakeup command is issued by mynewt and mcuboot automatically.

Nope sorry :-)  My code will mostly be used by the MCUBoot Bootloader, which doesn't have to worry about power issues (I think)

You definitely will need to ensure the SPI NOR FLASH wakeup command is issued by mcuboot before trying to send commands to the flash.

If a payload puts the SPI NOR FLASH into low power mode then mcuboot will not be able to access it after a reset unless it sends the wakeup command first.

Some developers dodge this issue bcause they allow the battery to run out whilst they are working on the watch (which also disables the low poer mode) but others hit it *immediately* because the dev kits come programmed with a firmware that does put the FLASH to sleep. Obviously as the open source firmware's implement better power saving then it will also become an issue for the bootloader.