Direct XIP + External QSPI

NCS v2.6.0, NRF5340dk

I'm trying to configure a project that uses mcuboot with direct XIP with the external QSPI flash.  I've been looking at examples in 

ncs/v2.6.0/nrf/tests/modules/mcuboot/external_flash
ncs/v2.6.0/nrf/tests/modules/mcuboot/direct_xip
ncs/v2.6.0/nrf/samples/nrf5340/extxip_smp_svr

The partition manager is having time creating partitions and throwing errors that memory regions are not aligned, so I've been using this as a guideline  Partition Manager Error w/ Direct XIP and MCUboot enabled

This is the process I've been using to build

Starting with the "external_flash" example:

1.  copy the linker script from ncs/v2.6.0/nrf/samples/nrf5340/extxip_smp_svr/linker_arm_extxip.ld

2. create a VERSION file for cmake builds

Fullscreen
1
2
3
4
5
VERSION_MAJOR = 0
VERSION_MINOR = 1
PATCHLEVEL = 11
VERSION_TWEAK = 0
EXTRAVERSION =
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

3. modify prj.conf

Fullscreen
1
2
3
4
5
6
7
8
9
10
CONFIG_ZTEST=y
CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP=y
CONFIG_FLASH=y
CONFIG_HAVE_CUSTOM_LINKER_SCRIPT=y
CONFIG_CUSTOM_LINKER_SCRIPT="linker_arm_extxip.ld"
CONFIG_XIP=y
CONFIG_NORDIC_QSPI_NOR_XIP=y
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
3. modify child_image/prj.conf
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# MCUboot requires a large stack size, otherwise an MPU fault will occur
CONFIG_MAIN_STACK_SIZE=10240
# Enable flash operations
CONFIG_FLASH=y
# This must be increased to accommodate the bigger images.
CONFIG_BOOT_MAX_IMG_SECTORS=256
# Use minimal C library instead of the Picolib
CONFIG_MINIMAL_LIBC=y
CONFIG_BOOT_DIRECT_XIP=y
CONFIG_PM_PARTITION_SIZE_MCUBOOT=0x10000
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
4. create a pm_static.yml with my custom partitions
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
nvs_storage:
address: 0xfa000
end_address: 0xfc000
region: flash_primary
size: 0x2000
settings_storage:
address: 0xfc000
end_address: 0xff000
region: flash_primary
size: 0x3000
id_storage:
address: 0xff000
end_address: 0x100000
region: flash_primary
size: 0x1000
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

5. generate a new pm_static.yml

Fullscreen
1
2
3
west build -b nrf5340dk_nrf5340_cpuapp -t partition_manager_report --pristine
cp pm_static.yml pm_static.yml.bak
cp build/partitions.yml pm_static.yml
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

6. Modify the pm_static.yml to include mcuboot_secodary_app and mcuboot_secondary_pad

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
app:
address: 0x10200
end_address: 0xfa000
region: flash_primary
size: 0xe9e00
external_flash:
address: 0xea000
end_address: 0x800000
region: external_flash
size: 0x716000
id_storage:
address: 0xff000
end_address: 0x100000
region: flash_primary
size: 0x1000
mcuboot:
address: 0x0
end_address: 0x10000
placement:
before:
- mcuboot_primary
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

7. Modify linker script with new external flash memory address

Fullscreen
1
2
3
4
5
6
MEMORY
{
EXTFLASH (wx) : ORIGIN = 0x10ea000, LENGTH = 0x716000
}
#include <zephyr/arch/arm/cortex_m/scripts/linker.ld>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

8. Build/flash using vscode


Results:

The application builds and programs, however there is no output on my terminal for either the app core or the net core

Memory report looks like what I'd expect.  I'm surprised the mcuboot_secondary_pad isn't in the correct span, but the address is correct

Any assistance debugging this would be appreciated