MCUBoot: adding custom serial flash driver as secondary partition

We use spi flash with custom driver and goal is to set it to act as secondary partition for MCUBoot.

The question is how to adapt driver to be accepted by MCUBoot, maybe there is an example on how driver should look like?

As far as I understand Nordic supports mx25r64, what files have to be produced and where to place them to enable custom driver to be accepted by MCUBoot?

Parents Reply
  • mesh777 said:
    However init function is not called. In driver file the following macro is added at the end of file:

    If your custom init function is not called, maybe it is because the custom driver file is not seen by the build system and added to the executable? Have you modified the CMakeLists.txt to include the source file? Like done for spi_nor.c for example here: https://github.com/nrfconnect/sdk-zephyr/blob/v2.7.0-ncs1/drivers/flash/CMakeLists.txt#L6 (try adding your driver in-tree first, just to make sure it works). You can check that the source file is included by looking in /<sample>/build/mcuboot/zephyr/drivers/flash/CMakeFiles/drivers__flash.dir I think (or just open build folder in vscode, click ctrl+P and search for the source (.c) file).

    Again, I do think the spi_nor.c driver might support the at25x, at least it's worth checking out.

    mesh777 said:
    And spi_flash_init is not called. What I am still missing?

    Where did you find this function? I search through the whole NCS v1.8.0 (based on earlier logs, it seems like you're using this version).

Children
Related