Partitions with XIP

My boot code is from 0x0 to 0x18000, mcu pad is from 0x18000 to 0x18200. The running code in the internal flash is from 0x18200 to 0xf8000. The address from 0xf8000 to 0x100000.
The XIP code executes from external flash from physical address 0x600000 to 0x680000. New image for upgrade will be downloaded as a single image(internal+XIP) in external flash
from 0xa000 to 0x16a000 address.

for this my pm_static.yml file is:

# Bootloader (96KB)
mcuboot:
  address: 0x0
  end_address: 0x18000
  placement:
    before:
    - mcuboot_pad
  region: flash_primary
  size: 0x18000

# MCUboot padding (512B)
mcuboot_pad:
  address: 0x18000
  end_address: 0x18200
  placement:
    before: [mcuboot_primary]
  region: flash_primary
  size: 0x200

mcuboot_primary_app:
  address: 0x18200
  end_address: 0xf8000
  region: flash_primary
  size: 0xdfe00

mcuboot_primary:
  address: 0x18200
  end_address: 0xf8000
  region: flash_primary
  size: 0xdfe00

app:
  address: 0xf8000
  region: flash_primary
  size: 0x8000

dci_nv:
  address: 0x0000
  device: MX25R64
  end_address: 0xa000
  region: external_flash
  size: 0xa000

mcuboot_secondary_app:
  address: 0xa000
  device: MX25R64
  end_address: 0x16a000
  region: external_flash
  size: 0x160000

EMPTY_0:
  address: 0x16a000
  end_address: 0x600000
  size: 0x496000
  device: MX25R64
  region: external_flash

mcuboot_secondary:
  address: 0x600000
  device: MX25R64
  end_address: 0x680000
  region: external_flash
  size: 0x80000

EMPTY_1:
  address: 0x680000
  size: 0x3980000
  device: MX25R64
  region: external_flash

sram_primary:
  address: 0x20000000
  end_address: 0x20070000
  region: sram_primary
  size: 0x70000

rpmsg_nrf53_sram:
  address: 0x20070000
  end_address: 0x20080000
  placement:
    before:
    - end
  region: sram_primary
  size: 0x10000


Configs that are enabled are:
CONFIG_CODE_DATA_RELOCATION=y
CONFIG_XIP=y
CONFIG_HAVE_CUSTOM_LINKER_SCRIPT=y
CONFIG_CUSTOM_LINKER_SCRIPT="./src/xip_linker.ld"
CONFIG_BUILD_NO_GAP_FILL=y
CONFIG_FLASH_INIT_PRIORITY=40
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_NRFX_QSPI=y
CONFIG_NORDIC_QSPI_NOR_XIP=y
CONFIG_BOOT_BUILD_DIRECT_XIP_VARIANT=y
CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP=y
CONFIG_XIP_SPLIT_IMAGE=y
CONFIG_PM_SINGLE_IMAGE=n

with the above configuration when I am building the code I am getting the below error:
-- Found partition manager static configuration: /app/pm_static.yml
Partition 'rpmsg_nrf53_sram' is not included in the dynamic resolving since it is statically defined.
*****Running Vuln_Check*****
-- Configuring done (34.7s)
-- Generating done (0.2s)
-- Build files have been written to: /home/cls/GA3_Dev/workspace/ga-ga3/app/build
-- west build: building application
ninja: error: 'modules/mcuboot/mcuboot_primary_app_hex', needed by 'zephyr/qspi_flash_signed.hex', missing and no known rule to make it
  • Hi,

    Could you please state which NCS version you're using as well as providing the full build log. It says that it has been configuring for 34.7 seconds, so there are multiple other potential causes that I would like to investigate. Let me know if you want to convert the ticket to private before uploading the build log if you're not comfortable with sharing it in a public environment.

    Kind regards,
    Andreas

  • yeah, please convert it into private ticket. Thanks

  • let me know once you convert this to private ticket

  • After making some changes to pm_static.yml, I am getting the below error message:

    ./zephyr/subsys/dfu/boot/mcuboot.c:56:10: error: #error Missing partition definitions.
    56 | #error Missing partition definitions.
    | ^~~~~
    ./zephyr/subsys/dfu/boot/mcuboot.c: In function 'boot_write_img_confirmed':
    ./zephyr/subsys/dfu/boot/mcuboot.c:60:35: error: 'ACTIVE_SLOT_ID' undeclared (first use in this function)
    60 | #define ACTIVE_SLOT_FLASH_AREA_ID ACTIVE_SLOT_ID
    | ^~~~~~~~~~~~~~
    ./zephyr/subsys/dfu/boot/mcuboot.c:248:29: note: in expansion of macro 'ACTIVE_SLOT_FLASH_AREA_ID'
    248 | if (flash_area_open(ACTIVE_SLOT_FLASH_AREA_ID, &fa) != 0) {
    | ^~~~~~~~~~~~~~~~~~~~~~~~~
    ./zephyr/subsys/dfu/boot/mcuboot.c:60:35: note: each undeclared identifier is reported only once for each function it appears in
    60 | #define ACTIVE_SLOT_FLASH_AREA_ID ACTIVE_SLOT_ID
    | ^~~~~~~~~~~~~~
    ./zephyr/subsys/dfu/boot/mcuboot.c:248:29: note: in expansion of macro 'ACTIVE_SLOT_FLASH_AREA_ID'
    248 | if (flash_area_open(ACTIVE_SLOT_FLASH_AREA_ID, &fa) != 0) {
    | ^~~~~~~~~~~~~~~~~~~~~~~~~
    [472/641] Building C object zephyr/drivers/usb/device/CMakeFiles/drivers__usb__device.dir/usb_dc_nrfx.c.obj
    ninja: build stopped: subcommand failed.

Related