SD card support to nRF5340

Hi,

Is there any example available for nRF5340-DK to read and write to external SD card ?

Thanks.

Parents Reply Children
  • Thanks Menon for the quick response. I'll try the sample codes.

  • Hi Menon,

    I tried the fat_fs example but could not get the expected results.

    As the fat_fs example shared by you is for nrf52840, I had created the nrf5340dk_nrf5340_cpuapp_ns.overlay and nrf5340dk_nrf5340_cpuapp_ns.conf files inside boards directory. 

    * Copyright (c) 2019 Tavish Naruka <tavishnaruka@gmail.com>
    *
    * SPDX-License-Identifier: Apache-2.0
    */

    &spi3 {
            compatible = "nordic,nrf-spim";
            status = "okay";
            sck-pin = <17>;
            mosi-pin = <13>;
            miso-pin = <14>;

            cs-gpios = <&gpio0 18 0>;

            sdhc0: sdhc@0 {
                    compatible = "zephyr,mmc-spi-slot";
                    reg = <0>;
                    status = "okay";
                    label = "SDHC0";
                    spi-max-frequency = <24000000>;
            };
    };

    CONFIG_DISK_DRIVER_SDMMC=y
    CONFIG_SPI=y

    Pin configuration:

    SD card -- DK pin configuration.

    VCC - 5V

    GND - GND

    CS - P0.18

    DI - P0.14

    DO - P0.13

    CLK - P0.17

    Flashed the application to the board but getting below error.

    Moreover, I am getting the message " nrf5340dk_nrf5340_cpuapp_ns.overla is untracked".

    Please let me know how to resolve this issue.

    Thanks.

Related