nRF54L15 - Does SPI-mode SD NAND Flash work with Zephyr SDHC-SPI driver?

Hi Nordic Team,

I am working on a custom nRF54L15 board using NCS, and I would like to use an SPI-mode SD NAND Flash (LGA8/SOP8 package, SD 2.0/SDHC compatible, SPI interface) as external storage.

I understand that:

  • Nordic currently does not support NAND Flash via sQSPI or SPI at the driver level.
  • However, Zephyr does support standard SD cards via SPI using the zephyr,sdhc-spi-slot driver.

Since SPI-mode SD NAND Flash exposes a standard SD/SDHC block interface over SPI (rather than raw NAND commands), I would like to clarify:

  1. Can the Zephyr zephyr,sdhc-spi-slot driver recognize and use an SPI-mode SD NAND Flash as a standard SD block device, without requiring a dedicated NAND driver?
  2. If yes, what is the maximum supported capacity (SDSC ≤ 2 GB / SDHC 4–32 GB)?
  3. Are there any known limitations or issues when using SD NAND Flash this way on nRF54L15?

Hardware: Custom nRF54L15 board Software: NCS v3.3.1

Thank you!

Parents
  • Hi Moke,

    Can the Zephyr zephyr,sdhc-spi-slot driver recognize and use an SPI-mode SD NAND Flash as a standard SD block device, without requiring a dedicated NAND driver?

    Yes, the Zephyr zephyr,sdhc-spi-slot driver can recognize and use an SPI-mode SD-NAND Flash chip as a standard SD block device without a dedicated NAND driver.

    Zephyr supports SD memory cards via the disk driver API, or via the SDMMC subsystem. It is also explained here

    &spi1 {
    status = "okay";
    cs-gpios = <&porta 27 GPIO_ACTIVE_LOW>;
    
    sdhc0: sdhc@0 {
    compatible = "zephyr,sdhc-spi-slot";
    reg = <0>;
    status = "okay";
    mmc {
    compatible = "zephyr,sdmmc-disk";
    disk-name = "SD";
    status = "okay";
    };
    spi-max-frequency = <24000000>;
    };
    };

    If yes, what is the maximum supported capacity (SDSC ≤ 2 GB / SDHC 4–32 GB)?

    To identify whether your SD-NAND IC is operating as SDSC (≤ 2 GB) or SDHC (4–32 GB), you can check it in software during initialization,

    disk_access_ioctl(disk_name, DISK_IOCTL_GET_SECTOR_SIZE, &sector_size);

    Are there any known limitations or issues when using SD NAND Flash this way on nRF54L15?

    1. Connect your SD-NAND IC to one of the standard peripheral SPIM instances rather than the ultra-high-speed instance. In the link, it shows how to add SD card node to spi1 interface. I would also suggest you to have a look at this devzone ticket.

    2. Verify your SD-NAND datasheet I/O voltage requirements. If it requires 3.3 V and your nRF54L15 GPIO domain runs at 1.8 V, bidirectional level shifters will be required.

    Regards

    Pallavi

     

Reply
  • Hi Moke,

    Can the Zephyr zephyr,sdhc-spi-slot driver recognize and use an SPI-mode SD NAND Flash as a standard SD block device, without requiring a dedicated NAND driver?

    Yes, the Zephyr zephyr,sdhc-spi-slot driver can recognize and use an SPI-mode SD-NAND Flash chip as a standard SD block device without a dedicated NAND driver.

    Zephyr supports SD memory cards via the disk driver API, or via the SDMMC subsystem. It is also explained here

    &spi1 {
    status = "okay";
    cs-gpios = <&porta 27 GPIO_ACTIVE_LOW>;
    
    sdhc0: sdhc@0 {
    compatible = "zephyr,sdhc-spi-slot";
    reg = <0>;
    status = "okay";
    mmc {
    compatible = "zephyr,sdmmc-disk";
    disk-name = "SD";
    status = "okay";
    };
    spi-max-frequency = <24000000>;
    };
    };

    If yes, what is the maximum supported capacity (SDSC ≤ 2 GB / SDHC 4–32 GB)?

    To identify whether your SD-NAND IC is operating as SDSC (≤ 2 GB) or SDHC (4–32 GB), you can check it in software during initialization,

    disk_access_ioctl(disk_name, DISK_IOCTL_GET_SECTOR_SIZE, &sector_size);

    Are there any known limitations or issues when using SD NAND Flash this way on nRF54L15?

    1. Connect your SD-NAND IC to one of the standard peripheral SPIM instances rather than the ultra-high-speed instance. In the link, it shows how to add SD card node to spi1 interface. I would also suggest you to have a look at this devzone ticket.

    2. Verify your SD-NAND datasheet I/O voltage requirements. If it requires 3.3 V and your nRF54L15 GPIO domain runs at 1.8 V, bidirectional level shifters will be required.

    Regards

    Pallavi

     

Children
  • Thank you very much, Pallavi Patil, for the detailed explanation!

    Your answer was very clear — confirming that the Zephyr zephyr,sdhc-spi-slot driver can recognize SPI-mode SD NAND Flash without needing a dedicated NAND driver. I also now understand how to check the capacity class via disk_access_ioctl, and the hardware considerations regarding SPIM instance selection and voltage level matching.

    This information is very helpful. I will proceed with testing based on your suggestions. Thanks again for your support!

    Best regards,

    Moke

  • Nitpick: The DISK_IOCTL_GET_SECTOR_SIZE will always report 512 bytes for any SD or SDHC card. The FS layers won't likely work with any other value, especially FAT.

    SD/SDHC card standard requires 512 byte sectors, so you should never run into a problem here. 

    If your app layer needs to know card type: Any card <= 2GB is SD, any larger card is SDHC. That calculation requires both DISK_IOCTL_GET_SECTOR_COUNT and DISK_IOCTL_GET_SECTOR_SIZE, and the multiplication should be a 64-bit operation with the result in bytes.

Related