This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Is there an NCS sample for storing updates in external flash?

I'm working on an nRF5340 based design and using the nRF5240DK to get started.

I would like to have an immutable first stage boot loader, an updatable MCUBoot boot loader, an updatable application (with BLE Host) on the application processor, and an updatable BLE Controller on the network processor.  I've added CONFIG_SECURE_BOOT=y and CONFIG_BOOTLOADER_MCUBOOT=y to get started (and that seems to be working for some of this, but is storing updates in internal flash for now).  I'm unclear if this setup so far includes update capability for the BLE Controller on the network processor.  What is needed to add that capability?

I would like to store all updates in external flash.  I see that there is a way to define partitions for internal and external flash using the DTS overlay.  However, it appears that those are not used when doing a multi-image build - so they end up being ignored and the partition manager python script is used instead to generate the partitions.  I've added CONFIG_PM_EXTERNAL_FLASH=y, etc, to the prj.conf.  Then the NCS documentation says "Now partitions can be placed in the external flash:"  but no indication of where that information should go and no example of what they would look like for the update images...  Are there any samples showing how to do this?  And/or pointers to more documentation?

I will have my own custom application code to store the update images into the external flash.  Is there an API to find the partition information for those update areas?  It seems like the flash map api only uses info from DTS (which is ignored)?  Ideally an API that will work even if I don't have CONFIG_SECURE_BOOT=y and CONFIG_BOOTLOADER_MCUBOOT=y defined - so that I can debug the application code that transfers the firmware easily without any boot loaders present to confuse SES?

Parents
  • There are docs around this but they are not trivial to find.

    "I also found something about the network processor update. Is there some information on how to place that update in external flash?"

    Here are the steps needed to enable network core updates.
    All update images in the system (mcuboot update, application update, network core update) will be stored in the "mcuboot_secondary" partition before they are applied to the system.
    So this is the only partition you need to move to external flash.
    There is unfortunately no way of achieving this out-of-tree at the moment.

    "In my build I only see app_update.bin and net_core_app_update.bin.  Shouldn't there be a mcuboot_update.bin also?"

    The bin files for the mcuboot update are the "signed_by_mcuboot_and_b0_" files.
    Note that you have to set `CONFIG_BUILD_S1_VARIANT=y` for all of these to be generated.
    This is described here.

    MCUboot updates are not well supported on BLE devices.
    The problem is that the MCUboot image will be executed from one of two slots, so the application must pick the correct bin file (or be dealt the correct bin file (s0 or s1) when downloading the update.
    For more details look here and here.



  • I ended up using the MCUBoot repository (not the NCS fork) and can now build a custom boot loader.

Reply Children
No Data
Related