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

NRF52 won't initialize micro-SD card into SPI mode

Hello people,

I'd like to use the NRF52832 (QFAAB0) / PCA 10040 / S132 development board as a data logger. For that I soldered a micro-sd card reader and started using the code found in another topic.

Any attempt to initialize the SD card into SPI mode however fails whatever variant I test. More specific: I do not get any bit value 0 on the DO after sending the CMD0 while I send 80 clocks after that in hope receiving the answer. I connected GND & VDD to the dedicated pins, all other pins have been connected to PIN block 0.11-0.16, all with 50k pull-ups. I've tested with a Transcend 8GB, Sandisk 8GB, noname 2GB and noname 16GB micro SD cards and all fail to pull down the DO for even one bit during numerous attempts.

I even used a different SD card holder connected to a different set of pins, use SPI 0, 1 and 2 controller, different delays during the initialization routine, 125 and 250 kHz, SPI mode 0-3, different CS toggle initialization strategies, sending extra idle clocks, no change on DO whatsoever.

I used an oscilloscope to help debug the problem. All level changes are clean and SPI communication appears flawless except for no change on the DO / MISO ever. One thing I've noticed is that the NRF52 only supplies 2.8-2.9 volts on VDD or any other output pin. I've therefore used an external 3.3V power supply and sent CMD8 as initialization and saw a reply from the card on the DI channel, making it kind of bi-directional...

I attached the code I use to initialize. At board startup, function SPI_SD_PIN_init() is called. Some statements later, function SD_init() is called. The SD card SPI initialization is in SDSC_init(). Pin MMCSD_PIN_SELECT is used as CS line, using functions mmcsd_select() to make it logic low and mmcsd_deselect() to make it logic high. The application also uses FreeRTOS 9 and BLE Softdevice, it is like the BLE HRS example. SD_Routines.c SD_Routines.h

Hope someone can help ?

Related