MCUboot spi-nor external flash

We have developed a custom board with an external SPI flash, which I have tested and it works. 

We want to use OTA over BLE, so we have added MCUboot to the project, which should use the external flash.

We are using SDK toolchain v2.6.1

In the prj.conf file I have enabled SPI external flash and MCU boot using:

CONFIG_FLASH=y
CONFIG_FLASH_MAP=y
CONFIG_SPI=y
CONFIG_SPI_NOR=y

CONFIG_BOOTLOADER_MCUBOOT=y

I have created a folder:

The files are added here.

When I try to build i fails with the error:

zephyr/drivers/flash/libdrivers__flash.a(spi_nor.c.obj):(.rodata.spi_nor_config_0+0x0): undefined reference to `__device_dts_ord_99'

Which I think refers to the spi-nor driver, but I'm stuck here, and cannot figure out why this happens. ?

4760.mcuboot.overlay

6835.mcuboot.conf

Parents Reply
  • I suspect your external flash setting is not correct. You can check the memory layout by executing "ninja partition_manager_report" under the build folder or generate a Memory report   and provide the memory layout from the Partitions tab. 

    You should see the mcuboot_secondary located on the external memory or at least the external memory.

Children
  • external_flash (0x80000 - 512kB):
    +------------------------------------------+
    | 0x0: mcuboot_secondary (0x6de00 - 439kB) |
    | 0x6de00: external_flash (0x12200 - 72kB) |
    +------------------------------------------+

    flash_primary (0x80000 - 512kB):
    +--------------------------------------------------+
    | 0x0: mcuboot (0x10000 - 64kB) |
    +---0x10000: mcuboot_primary (0x6e000 - 440kB)-----+
    | 0x10000: mcuboot_pad (0x200 - 512B) |
    +---0x10200: mcuboot_primary_app (0x6de00 - 439kB)-+
    | 0x10200: app (0x6be00 - 431kB) |
    | 0x7c000: settings_storage (0x2000 - 8kB) |
    +--------------------------------------------------+
    | 0x7e000: userstorage (0x2000 - 8kB) |
    +--------------------------------------------------+

    sram_primary (0x10000 - 64kB):
    +-------------------------------------------+
    | 0x20000000: sram_primary (0x10000 - 64kB) |
    +-------------------------------------------+

  • Do you update the file with the same static partition? You can duplicate build/partitions.yml, place it in the app folder, and rename it to pm_static.yml to build. 

Related