Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

FatFS example with SD card: disk initialization fails

Hello!

I try to run FatFS example (SD card example, pca10040) from nRF5 SDK on my nrf52832 (ebyte e73) with microSD card with no success. No matter what I'm still getting the same error: disk initialization failed (disk_initialize(0) returns 1). I've already read many topics and tried several things like: 

  • changing APP_SDCARD_FREQ_INIT and APP_SDCARD_FREQ_DATA to other values (lower / higher, depending on answers found)
  • changing NRFX_SPIM_MISO_PULL_CFG or NRF_SPI_DRV_MISO_PULLUP_CFG to other values
  • double-checked connections (pins in code & wiring)
  • tried different microSD cards
  • tried cards formatted as FAT32, as FAT...
  • tried connecting the same card adapter to Arduino on 3.3V and running simple SD card exmaple and IT WORKED

VCC in my setup is 3.3V (not from a battery).

I also tried code like this:

nrf_gpio_cfg(SDC_SCK_PIN,
    NRF_GPIO_PIN_DIR_OUTPUT,
    NRF_GPIO_PIN_INPUT_DISCONNECT,
    NRF_GPIO_PIN_NOPULL,
    NRF_GPIO_PIN_H0H1,
    NRF_GPIO_PIN_NOSENSE);

but later, while debugging, found out that it is set in nrfx_spim.c after calling disk_initialize, so this code in my main.c did not change anything.

I have no idea how to go futher, so I'm asking for help.

Related