This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

MCUBoot Secondary Slot in QSPI External Flash

I am trying to set up a project that uses MCUBoot and puts the secondary slot into QSPI External Flash.  I'm using NCS 1.7.1 with VS Code.  I've followed numerous posts on these forums asking the same thing to no avail.  I've modified my CMakeLists.txt file to specify mcuboot_DTC_OVERLAY_FILE and mcuboot_CONF_FILE files.

My mcuboot.conf file has this:

CONFIG_NORDIC_QSPI_NOR=y
CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16
CONFIG_MULTITHREADING=y
CONFIG_BOOT_MAX_IMG_SECTORS=256

My project's config file has this:

# nothing here

CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_IMG_MANAGER=y
CONFIG_MCUBOOT_IMG_MANAGER=y

CONFIG_PM_EXTERNAL_FLASH=y
CONFIG_PM_EXTERNAL_FLASH_DEV_NAME="MX25R64"
CONFIG_PM_EXTERNAL_FLASH_BASE=0x0
CONFIG_PM_EXTERNAL_FLASH_SIZE=0x100000

# SPI Flash
CONFIG_NORDIC_QSPI_NOR=y
CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16

# Enable flash operations.
CONFIG_FLASH=y
CONFIG_FLASH_MAP=y
CONFIG_FLASH_PAGE_LAYOUT=y

I've added a pm_static.yml file with the following:

external_flash:
  address: 0xf4000
  device: mx25r6435f
  end_address: 0x00100000
  region: external_flash
  size: 0x0c000

mcuboot_secondary:
  address: 0x0
  device: mx25r6435f
  end_address: 0xf4000
  placement:
    align:
      start: 0x000
  region: external_flash
  size: 0xf4000

When I build, I get a slew of errors once it gets to the child image, the first of which is:

error: 'PM_MCUBOOT_SECONDARY_ID' undeclared (first use in this function); did you mean 'PM_MCUBOOT_SECONDARY_SIZE'?

If I open the generated build/pm.config, I can verify that while there is a PM_MCUBOOT_PRIMARY_ID=2 defined, there is no definition for PM_MCUBOOT_SECONDARY_ID.  What am I missing?

Parents Reply Children
Related