cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F405 SD card randomly stops being written to

NPask.1
Associate

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

1 REPLY 1

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 Venmo
Up vote any posts that you find helpful, it shows what's working..