nRF5340 Netcore firmware update using external flash

I am using NCS 1.7.0 and latest nRF5340 DK

I am trying to update netcore firmware using the process defined here: 
https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.7.0/nrf/ug_nrf5340.html#fota-upgrades

I am able to update the appcore and netcore using the smp_svr sample as documented  here: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.7.0/zephyr/samples/subsys/mgmt/mcumgr/smp_svr/README.html#smp-svr-sample

I used west tool for building the smp_svr sample

`west build -b nrf5340dk_nrf5340_cpuapp -- -DCONFIG_BOOTLOADER_MCUBOOT=y -Dmcuboot_CONFIG_PCD=y -DOVERLAY_CONFIG=overlay-bt.conf`

I also enabled logging in hci_rpmsg and modified some dummy logging message to confirm that update has happened successfully in the netcore

This sample does not use QSPI external flash for the FOTA so i modified the sample to use external flash by adding an overlay and also CONFIG_NORDIC_QSPI_NOR=y.

This modified sample works for the updating application core but does not work for network core. I am able to upload the network core binary but once i issue image test and reset commands it takes sometime to reboot but still network core has the old firmware. 

I had to use the following configs in mcuboot child image configurations to come to this state:

```
CONFIG_PCD=y
CONFIG_PCD_APP=y
CONFIG_PCD_NET=y

# # CONFIG_UPDATEABLE_IMAGE_NUMBER=2
# # CONFIG_FLASH_SIMULATOR=y
# # CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES=y
# # CONFIG_FLASH_SIMULATOR_STATS=n
# # CONFIG_BOOT_UPGRADE_ONLY=y
CONFIG_BOOT_SWAP_USING_SCRATCH=y

CONFIG_NORDIC_QSPI_NOR=y
CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16
```

if i use the commented options above then during FOTA process device reboots continuously with a fatal error seen on network core.

I was facing a similar issue on my nRF5340 based product development (where i wanted to use CONFIG_BOOT_SWAP_USING_SCRATCH) and hence i thought it will work in devkit but i see the same issue here too on smp_svr sample application.

Kindly help me with this as I don't know what else is missing from my configurations that will enable me to update the network core using external flash QSPI.

Regards,

Dhananjay

Parents
  • Hello,

    The short answer is that you can't update the network core via QSPI out of the box. The reason for this is that the network core doesn't have access to the QSPI, and hence, it is not able to fetch the image from the external flash. However, if your application on the app_core can move the image from the QSPI into the flash, it will be possible to do what you describe. 

    Is there room in your flash to fit the network core update for the DFU?

    BR,

    Edvin

Reply
  • Hello,

    The short answer is that you can't update the network core via QSPI out of the box. The reason for this is that the network core doesn't have access to the QSPI, and hence, it is not able to fetch the image from the external flash. However, if your application on the app_core can move the image from the QSPI into the flash, it will be possible to do what you describe. 

    Is there room in your flash to fit the network core update for the DFU?

    BR,

    Edvin

Children
  • Hello Edvin,
          Thanks for the reply. Just to clarify few things

    • By QSPI do you mean External Flash?
    • By Flash, do you mean Internal code memory of the nRF53?

    I assumed MCUboot on the appcore takes care of informing netcore (via netboot and PCD) to indicate and moving new firmware update for netcore. is that right? or probably only indicate from your reply.

    We can allocate some internal flash memory on the appcore for this purpose which means we have to allocate around (256 KB - netboot size - PCD library size). If so, what should be done?

    If we do this we cannot use this code space on appcore in future right?

    Regards,

    DJ

Related