Is there a Library connect MicroSDHC via SPI

Hi,

i want/need to connect & access a microSD Card (32GB) on an breakout board via SPI (technical reasons) and want to use the suggested PINS (28-31) as in the intermediate lesson 5 exercise 1.

Is there a separate library (except the described spi, gios, devicetree) available/required, like an SD.h?

Thanks for hints/suggestions

Parents
  • Hello,

    Try to set SPI max frequency 400 kHz

    spi-max-frequency = <400000>;

    The overlay file based on your overlay be like this:

    &spi1 {
        compatible = "nordic,nrf-spim";   /* enable SPIM driver */
        status = "okay";
        pinctrl-0 = <&spi1_default>;
        pinctrl-1 = <&spi1_sleep>;
        pinctrl-names = "default", "sleep";
        cs-gpios = <&gpio0 31 GPIO_ACTIVE_LOW>;
    
        sdhc0: sdhc@0 {
            compatible = "zephyr,sdhc-spi-slot";
            reg = <0>;
            status = "okay";
            spi-max-frequency = <400000>; /* start low */
    
            mmc {
                compatible = "zephyr,sdmmc-disk";
                status = "okay";
                disk-name = "MMC SD";
            };
        };
    };

Reply
  • Hello,

    Try to set SPI max frequency 400 kHz

    spi-max-frequency = <400000>;

    The overlay file based on your overlay be like this:

    &spi1 {
        compatible = "nordic,nrf-spim";   /* enable SPIM driver */
        status = "okay";
        pinctrl-0 = <&spi1_default>;
        pinctrl-1 = <&spi1_sleep>;
        pinctrl-names = "default", "sleep";
        cs-gpios = <&gpio0 31 GPIO_ACTIVE_LOW>;
    
        sdhc0: sdhc@0 {
            compatible = "zephyr,sdhc-spi-slot";
            reg = <0>;
            status = "okay";
            spi-max-frequency = <400000>; /* start low */
    
            mmc {
                compatible = "zephyr,sdmmc-disk";
                status = "okay";
                disk-name = "MMC SD";
            };
        };
    };

Children
No Data
Related