Flash Image API on Network Core

Hi,

When I try to use the Flash Image API on the Network Core I get build errors. The problem seems to be that some symbols are not defined, as there is no MCUboot bootloader on the Network Core (but there is one on the Application Core).

What is the intended way to use the Flash Image API to write image data from the Network Core to an image slot of the Application Core?

(Additional info: I tried defining the missing symbols (PM_MCUBOOT_PRIMARY_ID and PM_MCUBOOT_SECONDARY_ID) wherever they are needed, just to see if the build succeeds. Indeed it does, but the init function of the Flash Image API then fails, which is not surprising as these symbols were defined manually and seem to be missing in the project setup.)

  • Could it be that the image slot of the application core is not known in the network core because it is not defined as a flash region? If yes, how would you solve that?

  • I had a look at the underlying Stream Flash module. When the overlay file of the Nework Core is adjusted to introduce the correct address space, the flash_area_open function of the Flash Map API is able to find the correct partition. But stream_flash_init fails on the comparison of offset+size and inspect_flash_ctx.total_size.

    Any thoughts? (I already got four notifications that an engineer has been assigned to this ticket, but there's no answer yet.)

  • Hi nKost,

    I have been assigned this ticket and will look into this case, and accordingly will come back to you soon.

    Regards, 
    Naeem

  • Hi nkost,

    Thank you for your patience. 

    Coming to your query: 

    When I try to use the Flash Image API on the Network Core I get build errors. The problem seems to be that some symbols are not defined, as there is no MCUboot bootloader on the Network Core (but there is one on the Application Core).

    Well, we have two bootloaders for 5340 as it has two cores, one for the app core (called MCUboot) and other for the network-core, called b0n which is an immutable first-stage bootloader that can update the application firmware on the network core of the nRF5340 SoC.

    I suggest to look at netboot sample to see the use-case and the configurations.

    What is the intended way to use the Flash Image API to write image data from the Network Core to an image slot of the Application Core?

    Flash Image Api is specific example use. Let us talk about writing image from the network core to an image slot of the app core. For such a purpose, you need to do a multi-image build. It is well described here: Multi-Image Build

    Hope it helps,

    Regards,

    Naeem

  • Hi Naeem

    Thanks four your answer. The setup you described is the one I use. I now need to write to the "Secondary Slot" in the AppCore Flash from the "Net core app". The problem is that the address of the "Secondary Slot" is not known in the "Net core app".

    This flash should be accessible from the NetCore (according to the Product Specification of nRF5340, Section 3.2 Fig. 2 Memory Map and Section 6.4 Memory: "The network core can access application core resources (flash, RAM, and peripherals) when granted permission through the application's DCNF and SPU settings.") When I try to write to this address using the function flash_area_write, it returns with an error "invalid address" (Permissions are not the problem).

    How can I access the flash of the AppCore from the NetCore?

Related