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:
    Now I have problem with device_get_binding, it returns Null for my driver. Although MCUBoot uses the same dts file when building. What else could be possibly wrong?

    There may be different reasons for the failure of device_get_binding(). I can see in the overlay you provider earlier that label="AT25XE081", so maybe you could start by putting a break point in mcuboot when device_get_binding() is called and check that it evaluates to device_get_binding("AT25XE081").

    Maybe also check the file build/mcuboot/zephyr/zephyr.dts (notice that this is a different path than build/zephyr/zephyr.dts), and check if you find the at25x node, and that it is enabled. If not, you probably need to enable it following the approaches explained in https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/nrf/ug_multi_image.html#image-specific-variables.

    If the init function of you driver fails (the function that is passed into DEVICE_DT_INST_DEFINE, like done here), the call to device_get_binding will also fail.

    In this reply I give some detailed explanations about why init function need to be successful for device_get_binding() to succeed, if you're interested. It may be a bit outdated due to an older NCS version.

    Best regards,

    Simon

Children
Related