SPI Interface for MicroSD Card

Hello,

I am attempting to mount and write to a microSD card via SPI. I am using the Fat_fs example found under "zephyr/samples/subsys/fs/fat_fs" and I am getting an error code of -5 during disk initialization. 

When I run the same code without the card inserted, I get the exact same behavior. So it almost seems like the driver isn't detecting the card at all. I have check that the sd card is FAT formatted and is working on my computer.

Also when using a logic analyzer, I can see that the MISO, MOSI, CS, and SCK signals appear to be working. However, pretty much all responses from the card (such as the CSD) return empty with all zeros. 

Below is the dts, config, and some notes about the board.

* MISO is tied high by an external resistor. 

Thanks in advance for the help

Parents Reply
  • Drew7997 said:
    Where are the logs saved to? I'm new to developing/debugging in this environment. 

    The logs are output on the selected logger backend, typically UART or RTT. See Logging in nRF Connect SDK for more details.

    Drew7997 said:
    I have made no modifications to the sample.
    Drew7997 said:
    After calling, disk_access_init the error happens here in disk_access_get_di(). The disk access list and node appear to be empty so nothing is ever initialized. 

    Are you building for a custom board? Did you try the sample on a nRF52833 DK first? Did it work with the card?

    If you are using a custom board, can you upload the board files and any overlays you are using? There might be some missing config in for your board.

Children
No Data
Related