Adapted SPI NOR driver not accepted by configuration

Hello,

for my project I need a secondary image for McuBoot on an external flash drive, so I integrated the examples in the partitions.yml, the device tree and SPI NOR configuration. With the generic spi_nor driver it compiled fine. The SPI flash we need to use in our project because of the low power requirements is not entirely compatible with this, as the commands and write-protect handling is fairly different. So I adapted the spi_nor driver for my specific use and gave it a new id: 'renesas,at25pe80'. I added this in the device tree as well.

But now it does not build anymore, it does not get to the compiling stage even:

The first error, that DT_HAS_JEDEC_SPI_NOR_ENABLED is set to no is the culprit, the error with SPI_NOR_FLASH_LAYOUT_PAGE_SIZE is just the result of the first error.

I have attached my driver and the DeviceTree and Config generated for the build. Maybe someone can find the error.

DT_HAS_JEDEC_SPI_NOR_ENABLED is not documented anywhere, so I cannot find help in official sources.

Thanks,

Rico

  • Here is the partitions.yml:

    I have tried to keep it simple for now.

  • Hi,

    Does your external flash device have the "size" property?
    It seems like num_bits is zero here: partition_manager.cmake#L238-L239, resulting in this error:

    math cannot parse the expression: " / 8": syntax error, unexpected

    Here is an example of the mx25r64 device, where you see the size property:

    Best regards,
    Marte

1 2