2025-01-08 02:12 PM
Hi
I'm trying to connect an SD card to my Nucleo U5A5ZJ-Q board using SDMMC peripheral and use it with FatFS library. When I use 1GB card and 4 bit mode, everything works fine. By "works fine" I mean that:
1. it passes this FatFS test: http://elm-chan.org/fsw/ff/res/app4.c
2. it is able to create a working text file.
But there are 2 problems:
1. 1 bit SDMMC mode doesn't work. When I'm trying to use it, the FatFS test fails at an SD card write. After clicking around in STM32CubeIDE debugger I found that there is a CRC error in SD callback being set as status, which then leads to a timeout and test fail. This problem isn't critical, because 4 bit mode seems to work, but it worries me a bit.
2. 16GB and 32GB cards don't work. They get a bit further (to reading), but fail in a simmilar way (SD callback -> CRC error -> timeout -> test fail). I haven't been able to test 2-8GB cards yet. This is more of a problem, because it's getting harder and harder to get such small capacity cards.
The whole project is attached below.
Ideas, anyone? Thanks in advance.
Adam
2025-01-08 02:31 PM
Hi,
most probably a hardware problem.
1-bit mode is less difficult, so it should work most times...even when 4-bit not working.
So search/read here in forum, what i wrote about sd-card problems and what to do.
...set pin speed medium, pullups on...etc.
+ i have sd-cards on my H743 audio player and no problem, 2GB or 32 GB .
2025-01-08 02:43 PM
Ok, I'm gonna try these things tomorrow. I find it weird that 4 bit mode is working but 1 bit mode is not. It seems that everyone has the opposite situation.