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 got the peripheral lbs sample working, but I think I need some clarification, since I maybe don't exactly understand, how the mechanism is when using external flash.

    In my App I initialize all the BT (as the peripheral lbs) and then call smp_bt_register();.

    In the overlay files for the App and MCUboot I enable the CONFIG_SPI_NOR stuff.

    But what is is the OTA mechanism exactly ?

    1. The App connects to bluetooth, and transfers the data using the SMP protocol to the external flash.

    2. The MCU reboots, and the MCUboot copies the content from the external flash to the internal flash (App section).

    3. The MCUboot (starts) jumps to the App start vector in internal flash.

    Is my understanding correct ?

    (Note, when I debug using jtag, it looks like MCUboot is trying to boot from the external flash? )

Children
Related