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

FatFS example on SDK 14.2: initialization error (disk_state = 1)

Hi

Freshly downloaded the SDK14.2 and trying to start a new development based on the fatfs example.

I connected a small Sparkfun SD card breakout to the SPI pin on my pca10040 (actually rigado BMD-300 evaluation board which should be fully compatible). My connections are:

- P0.22 --> CS

- P0.23 --> DI/MOSI

- P0.24 --> DO/MISO

- P0.25 --> SCK

(+ VCC and GND)

I also tried to change the pullup settings on MISO to all three possible configurations.

Result: initialization error (disk_state = 1).

The analyzer shows that the SPI master tries to communicate with the SD card, which does not answer at all (see attached picture).

I double- even triple-checked the wiring, but cannot tell what could be wrong.

Parents
  • Hello,

    Are you sure you aren't mixing up the MISO and MOSI pins? If I am not mistaken, DI is MOSI. Hence, shouldn't the green wire be connected to pin P0.24, and not P0.23?I might be mistaken, it is not too easy to see the wires on the SD card reader in the picture.

    If that is not the issue, what sort of SD card do you use? Can you plug it into a computer and try to reformat it to FATFS32?

    It should be fairly easy, and it can be done something like this: https://www.lifewire.com/format-sd-card-using-windows-4128719

    Best regards,
    Edvin

  • Hi,

    Not completely done with this issue! Since a couple of days, the SD card initialization returns STA_NOINIT after the disk_initialize function (from SDK_14.2.0\examples\fatfs). More precisely, the block_dev_handler gets the result NRF_BLOCK_DEV_RESULT_IO_ERROR.

    I tried different setups from what I've read on this site:

    • set NRF_GPIO_PIN_NOPULL on sdk_config.h
    • use two different FAT32-formatted cards
    • supply the breakout with 5V or 3.3V
    • try the example projects on SDK 12.2 (without change), 14.2 (with NOPULL setting) and 15.0 (without change)

    I hope this time I didn't mix up the wires, but as on the picture:

    • P0.25 --> SCK
    • P0.24 --> DO
    • P0.23 --> DI
    • P0.22 --> CS

    Can you help me on what could produce this IO error?

    Thanks,

    Sébastien

Reply
  • Hi,

    Not completely done with this issue! Since a couple of days, the SD card initialization returns STA_NOINIT after the disk_initialize function (from SDK_14.2.0\examples\fatfs). More precisely, the block_dev_handler gets the result NRF_BLOCK_DEV_RESULT_IO_ERROR.

    I tried different setups from what I've read on this site:

    • set NRF_GPIO_PIN_NOPULL on sdk_config.h
    • use two different FAT32-formatted cards
    • supply the breakout with 5V or 3.3V
    • try the example projects on SDK 12.2 (without change), 14.2 (with NOPULL setting) and 15.0 (without change)

    I hope this time I didn't mix up the wires, but as on the picture:

    • P0.25 --> SCK
    • P0.24 --> DO
    • P0.23 --> DI
    • P0.22 --> CS

    Can you help me on what could produce this IO error?

    Thanks,

    Sébastien

Children
Related