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 Reply Children
  • Hello DJ,

    djgj said:
    I see that "CONFIG_BOOT_SWAP_USING_SCRATCH" is not supported since we cannot do image reversion on netcore.

    That may be true, but from what do you draw that conclusion?

    I don't know enough about this subject at this point in time, so if you can point me to how you found that out, I can check with the developers whether it is correct or not. 

    BR,

    Edvin

Related