0
\$\begingroup\$

I've implemented the start-up sequence for SPI mode on MicroSD v2 cards (using the specifications), and I've found that the SD card fails initialization at different points in the process. It often fails sending the first CMD8, but then sometimes fails later at the ACMD41 or even after that. By fail, I mean it'll return 0x00 or an incorrect response.

Are there any ideas on why the initialization process can fail at different steps? It appears I'm supplying the correct power, and there are no pullup or pulldown resistors needed for SPI. I'm bare-metal coding, so there's no OS to interfere with it. Posting code here is non-trivial as every step uses callbacks (no choice, due to timing requirements). I'm coding for the nRF52840, and ARM chip.

\$\endgroup\$
  • \$\begingroup\$ How much wire is there between your MCU and the SD Card reader? \$\endgroup\$ – hekete Jun 4 at 6:57
  • \$\begingroup\$ What is the initialization process you are following ? \$\endgroup\$ – MaNyYaCk Jun 5 at 5:13
  • 1
    \$\begingroup\$ I've implemented ... fails. I'd take a wild guess your implementation maybe isn't perfect. SD is quite tricky with the timings and init sequences. \$\endgroup\$ – domen Jun 5 at 7:22
  • \$\begingroup\$ I've followed my own implementation as well as one from Particle.io, producing both the same results. There's only 1" wire connecting the 2, but they are on a breadboard. I'll solder them directly and see what happens \$\endgroup\$ – Warpspace Jun 6 at 23:35
  • \$\begingroup\$ OK, turns out it was the power supply. I still don't know why, but once the SD was powered by an alternate power source (with common ground), it worked \$\endgroup\$ – Warpspace Jun 12 at 1:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.