I am using nrf9160 custom board,my requirement is using external flash as secondary slot for mcuboot I have done configuration with respect to that in mcuboot and project file below are my settings
mcuboot.conf
CONFIG_MULTITHREADING=y
CONFIG_BOOT_MAX_IMG_SECTORS=512
CONFIG_PM_EXTERNAL_FLASH=y
CONFIG_PM_EXTERNAL_FLASH_DEV_NAME="MX25R64"
CONFIG_PM_EXTERNAL_FLASH_BASE=0x0
CONFIG_PM_EXTERNAL_FLASH_SIZE=0x800000
CONFIG_PM_EXTERNAL_FLASH_SUPPORT_LEGACY=y
#secondary image
CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y
CONFIG_PM_PARTITION_SIZE_MCUBOOT_SECONDARY=0xf0000
project.conf
# Bootloader
CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_IMG_MANAGER=y
CONFIG_MCUBOOT_IMG_MANAGER=y
# External Flash for secondary storage
CONFIG_FLASH=y
CONFIG_FLASH_MAP=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_PM_EXTERNAL_FLASH=y
CONFIG_PM_EXTERNAL_FLASH_DEV_NAME="MX25R64"
CONFIG_PM_EXTERNAL_FLASH_BASE=0x0
CONFIG_PM_EXTERNAL_FLASH_SIZE=0x800000
mcuboot secondary and internal flash primary size both i configured for the same size.
I am using sys_reboot(SYS_REBOOT_COLD); to reset in the current application after reset it is executing the old image only it is not taking a new image.
my questions are:
1. I am writing app_update.bin file directly to external flash from 0x0000 location by using some API's, is it correct.
2. whatever the app_update.bin we are writing into the external flash, the project setting and mcuboot setting should be the same as internal image configuration?