External SPI flash drivers for Mcuboot

I work on a project with nRF52833 (NRF Connect v3.0.2 currently) and I have to use an external AT45DB641E flash chip connected over SPI.

The external flash will be mainly used during DFU as a secondary slot when the update is being received over BLE.

Then, on reboot, after integrity check, the Mcuboot will copy the update on the primary slot (which is on the Internal flash on nRF52833)

The thing is that AT45 driver seem complex (in terms of primitives) and is looking for kernel primitives like "z_impl_k_sem_take" which are not available under Mcuboot (as far as I can understand)...

What driver should I use if the AT45 driver ("atmel,at45" in DTS) is not applicable for Mcuboot?

I'm looking for the easiest/fastest to implement approach as I looked for the standard driver "jedec,spi-nor" but it still uses Zephyr Kernel primitives and looks still not applicable...

/home/user/ncs/toolchains/7cbc0036f4/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/drivers/flash/libdrivers__flash.a(spi_flash_at45.c.obj): in function `k_sem_give':
/home/user/prj/broadcaster/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:1119: undefined reference to `z_impl_k_sem_give'
/home/user/ncs/toolchains/7cbc0036f4/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/drivers/flash/libdrivers__flash.a(spi_flash_at45.c.obj): in function `k_sem_take':
/home/user/prj/broadcaster/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:1102: undefined reference to `z_impl_k_sem_take'
/home/user/ncs/toolchains/7cbc0036f4/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/drivers/flash/libdrivers__flash.a(spi_flash_at45.c.obj):(.rodata.inst_0_config+0x0): undefined reference to `__device_dts_ord_106'
collect2: error: ld returned 1 exit status

Related