Skip to main content
NPask.1
Visitor II
June 14, 2021
Question

STM32F405 SD card randomly stops being written to

  • June 14, 2021
  • 1 reply
  • 650 views

Please see post over on Arduino forum (since I can't post all that text here) but feel free to reply here.

This topic has been closed for replies.

1 reply

Tesla DeLorean
Guru
June 14, 2021

Problem with Arduino is that everything is obfuscated and the debugging is worthless..

The code you're showing is all top-level stuff, the failure is likely at a lower level. Not sure there's a magic answer to this, you're going to need to get a better understand on what exactly is "not working"

If its running FATFS you'd want to debug the DISKIO layer, perhaps consider if its using DMA or POLLED mode.

I personally would be using pull-up resistors on the DATA/CMD lines, the 22R series are good for stopping ringing as you clock faster, although I'd guess this is going along at 24 MHz. I'd be looking at 33K or 47K pull-ups, or at the very least enabled on the pin side. Perhaps you can dig into the variant.cpp/variant.h code.

You could perhaps build a HAL equivalent of the code and test/demo the MicroSD card writing.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..