extxip_smp_srv fails compiling for nrf5340dk non-secure target

Hello,

Working on Ubuntu 22.04 with nRF Connect SDK 2.6.1 for the target nrf5340dk_nrf5340_cpuapp_ns (= with TF-M).

My application image became too large. I want to split the app image over internal and external memory. I'm using extxip_smp_svr as example. It compiles & runs for the target nrf5340dk_nrf5340_cpuapp.

When building this sample for the nrf5340dk_nrf5340_cpuapp_ns target (with TF-M), compilation fails:

In file included from /home/dev/nrf-official/v2.6.1/bootloader/mcuboot/boot/zephyr/include/sysflash/sysflash.h:10,
                 from /home/dev/nrf-official/v2.6.1/bootloader/mcuboot/boot/bootutil/src/bootutil_priv.h:33,
                 from /home/dev/nrf-official/v2.6.1/bootloader/mcuboot/boot/bootutil/src/tlv.c:24:
/home/dev/nrf-official/v2.6.1/bootloader/mcuboot/boot/zephyr/include/sysflash/pm_sysflash.h: In function '__flash_area_ids_for_slot':
/home/dev/nrf-official/v2.6.1/bootloader/mcuboot/boot/zephyr/include/sysflash/pm_sysflash.h:49:37: error: 'PM_MCUBOOT_PRIMARY_2_ID' undeclared (first use in this function); did you mean 'PM_MCUBOOT_PRIMARY_1_ID'?
   49 | #define FLASH_AREA_IMAGE_2_SLOTS    PM_MCUBOOT_PRIMARY_2_ID, PM_MCUBOOT_SECONDARY_2_ID
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~
/home/dev/nrf-official/v2.6.1/bootloader/mcuboot/boot/zephyr/include/sysflash/pm_sysflash.h:59:29: note: in expansion of macro 'FLASH_AREA_IMAGE_2_SLOTS'
   59 |                             FLASH_AREA_IMAGE_2_SLOTS
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~
/home/dev/nrf-official/v2.6.1/bootloader/mcuboot/boot/zephyr/include/sysflash/pm_sysflash.h:67:9: note: in expansion of macro 'ALL_AVAILABLE_SLOTS'
   67 |         ALL_AVAILABLE_SLOTS
      |         ^~~~~~~~~~~~~~~~~~~

What do I need to change in this sample to make it compile for the non-secure target?

(PS my current project fails compiling with the same error when trying to add support for a split application image. That's why I looked into Nordic's sample to find how that is configured differently. Unfortunately it fails too. I saw the same error in the past when experimenting with CONFIG_BOOT_UPGRADE_ONLY=n in a multi-image build)

Thank you!

Kind regards,
francis

  • Hello Amanda,
    Did you or a colleague have time to further investigate this issue? Thank you!

    Kind regards,
    francis

  • We are currently understaffed due to the summer vacation period, so delayed replies must be expected. I am sorry about any inconvenience this might cause.

  • Hello Amanda,

    I got one step further making compilation now succeed. I added to boards/nrf5340dk_nrf5340_cpuapp_ns.conf:
    CONFIG_MCUBOOT_USE_ALL_AVAILABLE_RAM=y


    However after flashing, I see an error message from the MCUBOOT:
    *** Booting nRF Connect SDK v3.5.99-ncs1-1 ***
    I: Starting bootloader
    I: Image index: 0, Swap type: none
    I: Image index: 1, Swap type: none
    I: Image index: 2, Swap type: none
    E: Unable to find bootable image

    As a reference, when compiling without TF-M, I see the following:
    I: Starting bootloader
    I: Image index: 0, Swap type: none
    I: Image index: 1, Swap type: none
    I: Image index: 2, Swap type: none
    I: Bootloader chainload address offset: 0x10000
    *** Booting nRF Connect SDK v3.5.99-ncs1-1 ***


    uart:~$ [00:00:00.017,639] <inf> smp_sample: build time: Jul 20 2024 13:43:51
    [00:00:00.029,449] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
    [00:00:00.029,449] <inf> bt_hci_core: HW Variant: nRF53x (0x0003)
    [00:00:00.029,479] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 54.58864 Build 1214809870
    [00:00:00.031,066] <inf> bt_hci_core: Identity: E2:F6:D5:70:CD:18 (random)
    [00:00:00.031,097] <inf> bt_hci_core: HCI: version 5.4 (0x0d) revision 0x218f, manufacturer 0x0059
    [00:00:00.031,127] <inf> bt_hci_core: LMP: version 5.4 (0x0d) subver 0x218f
    [00:00:00.033,020] <inf> smp_bt_sample: Advertising successfully started
    [00:00:00.017,639] <inf> smp_sample: build time: Jul 20 2024 13:43:51
    [00:00:00.029,449] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
    [00:00:00.029,449] <inf> bt_hci_core: HW Variant: nRF53x (0x0003)
    [00:00:00.029,479] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 54.58864 Build 1214809870
    [00:00:00.031,066] <inf> bt_hci_core: Identity: E2:F6:D5:70:CD:18 (random)
    [00:00:00.031,097] <inf> bt_hci_core: HCI: version 5.4 (0x0d) revision 0x218f, manufacturer 0x0059
    [00:00:00.031,127] <inf> bt_hci_core: LMP: version 5.4 (0x0d) subver 0x218f
    [00:00:00.033,020] <inf> smp_bt_sample: Advertising successfully started

    Kind regards,
    francis
Related