We are using SDK 2.4.0 and have enabled MCUBoot to support OTA updates using the dual slot method. I have reviewed many posts and existing tickets and have not been able to get this to work. There seams to be many things that are SDK dependent here. We are using hardware similar to the nRF5340DK so for this we can assume we are running on it
One example that looks closely is this ticket:
devzone.nordicsemi.com/.../how-to-put-mcuboot-secondary-slot-in-external-qspi-flash-on-nrf5340-dk
with a link to
A smp_svr_external_ncs+2.1.3_working.zip example project
/cfs-file/__key/communityserver-discussions-components-files/4/7823.smp_5F00_svr_5F00_external_5F00_ncs_5F00_2.1.3_5F00_working.zip
this does not build in the 2.4.0 SDK with undefined symbols in the proj.conf
D:/Software/Stanford/hello_world_mcuboot_qspi_nrf53/prj.conf:7: warning: attempt to assign the value 'y' to the undefined symbol PM_EXTERNAL_FLASH
D:/Software/Stanford/hello_world_mcuboot_qspi_nrf53/prj.conf:8: warning: attempt to assign the value '"MX25R64"' to the undefined symbol PM_EXTERNAL_FLASH_DEV_NAME
D:/Software/Stanford/hello_world_mcuboot_qspi_nrf53/prj.conf:10: warning: attempt to assign the value '0x100000' to the undefined symbol PM_EXTERNAL_FLASH_SIZE
It looks like to get this to work, it requires a combination of configuration setting in prj.conf, an addition to the overlay to define flash, and a properly constructed pm_static.yml. I have been unable to find a combination to get it to work but think I am close.
I have this added to my overlay:
&mx25r64 {
status = "okay";
};
/ {
chosen {
nordic,pm-ext-flash = &mx25r64;
};
};
I have a number of defenitions related to this in the prj.conf
CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_MCUMGR=y
CONFIG_IMG_MANAGER=y
CONFIG_PM_EXTERNAL_FLASH_BASE=0x0
I define this
CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y
but it shows an error
CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY was assigned the value y, but got the value n. Missing dependencies:
n || MCUBOOT
I tried to set it
CONFIG_MCUBOOT=y
But an error shows it is a hidden prompt and not user settable
Based on a comment from a post, I started my pm_static.yml from partitions.yml in the build folder.
It does build and run with these settings swichign the secondary to the external flash but as soon as I change the size over to the larger commented out ones, execution does not reach main.
#start of program in the primary slot
mcuboot_primary_app:
address: 0xc200
end_address: 0x84000
orig_span: &id002
- app
region: flash_primary
size: 0x77e00 #479.5 KB
#size: 0xefe00 #959.5 KB
span: *id002
#secondary slot, does not run from here
mcuboot_secondary:
address: 0x0
device: mx25r64
region: external_flash
share_size:
- mcuboot_primary
size: 0x78000 #480 KB
#size: 0xf0000 #960 KB
#nv storage
nvs_storage:
address: 0xfe000
end_address: 0x100000
placement:
after:
- settings_storage
region: flash_primary
size: 0x2000
So far, I have not been able to downloaded firmware using the external flash and have it copied to the primary slot even when using the smaller size.
Is there a working example of using the external flash for the secondary slot using the V2.4.0 SDK? Is there something else that needs to be done? I know of the lessons, but they use newer SDKs which do not support V2.4.0. We already have this device in use and do not want to switch SDKs, we just need more space in our firmware so need to put the secondary slot on the external flash.
Thank you
MCUBoot using external flash for secondary partition
We are using SDK 2.4.0 and have enabled MCUBoot to support OTA updates using the dual slot method. I have reviewed many posts and existing tickets and have not been able to get this to work. There seams to be many things that are SDK dependent here. We are using hardware similar to the nRF5340DK so for this we can assume we are running on it
One example that looks closely is this ticket:
devzone.nordicsemi.com/.../how-to-put-mcuboot-secondary-slot-in-external-qspi-flash-on-nrf5340-dk
with a link to
A smp_svr_external_ncs+2.1.3_working.zip example project
/cfs-file/__key/communityserver-discussions-components-files/4/7823.smp_5F00_svr_5F00_external_5F00_ncs_5F00_2.1.3_5F00_working.zip
this does not build in the 2.4.0 SDK with undefined symbols in the proj.conf
D:/Software/Stanford/hello_world_mcuboot_qspi_nrf53/prj.conf:7: warning: attempt to assign the value 'y' to the undefined symbol PM_EXTERNAL_FLASH
D:/Software/Stanford/hello_world_mcuboot_qspi_nrf53/prj.conf:8: warning: attempt to assign the value '"MX25R64"' to the undefined symbol PM_EXTERNAL_FLASH_DEV_NAME
D:/Software/Stanford/hello_world_mcuboot_qspi_nrf53/prj.conf:10: warning: attempt to assign the value '0x100000' to the undefined symbol PM_EXTERNAL_FLASH_SIZE
It looks like to get this to work, it requires a combination of configuration setting in prj.conf, an addition to the overlay to define flash, and a properly constructed pm_static.yml. I have been unable to find a combination to get it to work but think I am close.
I have this added to my overlay:
&mx25r64 {
status = "okay";
};
/ {
chosen {
nordic,pm-ext-flash = &mx25r64;
};
};
I have a number of defenitions related to this in the prj.conf
CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_MCUMGR=y
CONFIG_IMG_MANAGER=y
CONFIG_PM_EXTERNAL_FLASH_BASE=0x0
I define this
CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y
but it shows an error
CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY was assigned the value y, but got the value n. Missing dependencies:
n || MCUBOOT
I tried to set it
CONFIG_MCUBOOT=y
But an error shows it is a hidden prompt and not user settable
Based on a comment from a post, I started my pm_static.yml from partitions.yml in the build folder.
It does build and run with these settings swichign the secondary to the external flash but as soon as I change the size over to the larger commented out ones, execution does not reach main.
#start of program in the primary slot
mcuboot_primary_app:
address: 0xc200
end_address: 0x84000
orig_span: &id002
- app
region: flash_primary
size: 0x77e00 #479.5 KB
#size: 0xefe00 #959.5 KB
span: *id002
#secondary slot, does not run from here
mcuboot_secondary:
address: 0x0
device: mx25r64
region: external_flash
share_size:
- mcuboot_primary
size: 0x78000 #480 KB
#size: 0xf0000 #960 KB
#nv storage
nvs_storage:
address: 0xfe000
end_address: 0x100000
placement:
after:
- settings_storage
region: flash_primary
size: 0x2000
So far, I have not been able to downloaded firmware using the external flash and have it copied to the primary slot even when using the smaller size.
Is there a working example of using the external flash for the secondary slot using the V2.4.0 SDK? Is there something else that needs to be done? I know of the lessons, but they use newer SDKs which do not support V2.4.0. We already have this device in use and do not want to switch SDKs, we just need more space in our firmware so need to put the secondary slot on the external flash.
Thank you