Unable to get fs_sample to work with nRF5340-DK

I am trying to get the nRF Connect (Zephyr) fs_sample working with nRF5340 preview DK, but am getting the following errors:

*** Booting nRF Connect SDK d96769faceca ***
[00:00:00.258,697] <err> sd: Card error on CMD0
[00:00:00.258,728] <err> main: Storage init ERROR!
[00:00:00.264,343] <err> sd: Card error on CMD0
[00:00:00.264,343] <err> fs: fs mount error (-5)
Error mounting disk.
[00:00:00.264,404] <err> fs: fs not mounted (mp == 0x20000000)

My proj.conf has:

CONFIG_DISK_ACCESS=y
CONFIG_LOG=y
CONFIG_FILE_SYSTEM=y
CONFIG_FAT_FILESYSTEM_ELM=y
CONFIG_PRINTK=y
CONFIG_MAIN_STACK_SIZE=2048

CONFIG_DISK_DRIVER_SDMMC=y
CONFIG_SPI=y

app.overlay:

&spi4 {
status = "okay";
cs-gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
pinctrl-0 = <&spi4_default>;
sdhc0: sdhc@0 {
compatible = "zephyr,sdhc-spi-slot";
reg = <0>;
status = "okay";
mmc {
compatible = "zephyr,sdmmc-disk";
status = "okay";
};
spi-max-frequency = <1000000>;
};
};

My complete code for the project is here:

https://github.com/mkvenkit/fs_sample

SD Card Details

1. 8GB SD card formatted with FAT.

2. Waveshare microSD adapter with following connections:

CS - P1.12 - D3
MOSI - P1.13 - CMD
MISO - P1.14 - DO
SCK - P1.15 - CLK

SPI data from logic analyzer:



I have seen other related messages from the forum but I haven't been able to solve the issue. I'd appreciate any help with this. Thanks!

Parents
  • I am trying to get the nRF Connect (Zephyr) fs_sample working with nRF5340 preview DK

    Make sure the DK you have meet the requirement here:

    "The nRF5340 PDK has been deprecated with the introduction of the production-level nRF5340 DK. To determine if you have a PDK or DK, check the version number on the sticker on your kit. If the version is 0.11.0 or higher, the kit is an nRF5340 DK.

    See the nRF Connect SDK v1.4.0 documentation for the last release supporting the nRF5340 PDK."

    If that is not the problem, then it can be quite a lot of things, suggest to continue debugging and check related cases with similar symptoms.

    Best regards
    Kenneth

  • I am using a preview DK, as I mentioned. I will get a new 5340-DK to try this. But the the fs_sample is not working on nRF52840-DK either. From the messages I have seen, many people have trouble with SD cards on nRF boards. It would very helpful if Nordic could provide a working sample using nRF5340-DK. Thanks.

Reply Children
No Data
Related