This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Failure to get SDHC to work with NRF5340DK

Hello, 

I started my prototyping with the 52840DK and the SD Card was working fine. However, with the 5340 dev kit, I cannot get the SPI to work and access the SD Card properly.

I am getting the error : 

00> *** Booting Zephyr OS build v2.6.99-ncs1-1 **
00>
00> [00357896] <err> main: Storage init ERROR!
00> [00715756] <err> fs: fs mount error (-5)
00> Error mounting disk

I am using the overlay below and the standard FatFs sample in the Zephyr directory.

-- Zephyr version: 2.6.99 (C:/Users/pierr/ncs/v1.7.1/zephyr), build: v2.6.99-ncs1-1

Thanks a lot for your help.

&spi4 {
    compatible = "nordic,nrf-spim";
    status = "okay";
    cs-gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
    sck-pin = <33>;
    mosi-pin = <34>;
    miso-pin = <35>;
    
    sdhc0: sdhc@0 {
        compatible = "zephyr,mmc-spi-slot";
        reg = <0>;
        status = "okay";
        label = "SDHC0";
        spi-max-frequency = <24000000>;
    };
};
  

Parents
  • I am working through this same exact error on the same board and same Zephyr version. 

    My overlay looks very close to yours with the exception of my pin definitions. Why do you not have cs-gpios set to GPIO_ACTIVE_HIGH like what is in the sample? I tried both ACTIVE_LOW and ACTIVE_HIGH with the same result.

    My SD card is formatted FAT and is a 32GB SDHC.

    .

    I hooked all pins up to a logic analyzer and both MOSI and SCK go high on boot/reset. 

    .

    Here's the project on github: github.com/.../fat_fs

Reply
  • I am working through this same exact error on the same board and same Zephyr version. 

    My overlay looks very close to yours with the exception of my pin definitions. Why do you not have cs-gpios set to GPIO_ACTIVE_HIGH like what is in the sample? I tried both ACTIVE_LOW and ACTIVE_HIGH with the same result.

    My SD card is formatted FAT and is a 32GB SDHC.

    .

    I hooked all pins up to a logic analyzer and both MOSI and SCK go high on boot/reset. 

    .

    Here's the project on github: github.com/.../fat_fs

Children
No Data
Related