This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

SDK FATFS example Disk initialization failed

Hi

I'm using the unmodified  fatfs example in SDK16 with PCA10040 dev board connected to a Mikroe SD-Click board which is nothing more than a breakout board for microSD cards

https://download.mikroe.com/documents/add-on-boards/click/microsd/microsd-click-schematic.pdf

Connections are as the example 

CS    P0.22

DI     P0.23

D0   P0.24

CLK     P0.25

I also bridged the jumper SB10 to bypass the polarity reversal protection diode, so the SD board gets the full 3.3v supply (it was 2.8v)

But all I get is  "Disk initialization failed"

After connecting a logic analyser I can see what looks like correct activity. I see a write command 0x00 (0x40 byte written), then after about 0.25ms the card responds with 0x01 so the physical connections seem OK. Also I tried with both a regular Sandisk card and an industrial spec ATP card with same result.

Where can I look next? I've also attached my logic analyser screen shot.

Thanks

Nick

<info> app: FATFS example started.
<info> app: Initializing disk 0 (SDC)...
<info> app: Disk initialization failed.

Parents Reply
  • Hi Kenneth

    Thanks for the quick reply. The error was 1 - R/W failure, and the problem was sdk_config.h:

    NRF_SPI_DRV_MISO_PULLUP_CFG was set to pull down; change to NRF_GPIO_PIN_NOPULL and it works OK now including writing to the text file.

    A couple of things. 1) Is this a bug in the example? Not sure why you'd need pull downs. also 2) Wouldn't it be helpful to put the error codes in the application logging?

    Anyway, working now thanks.

Children
No Data
Related