2024-06-25 01:54 AM - edited 2024-06-25 04:39 AM
MCU: STM32L471VGT6
I am trying to get an SD Card to work for my system. I am using a custom board and I cant share any drawings. However, what I am using for the SD Card:
Sd card adapter: https://learn.adafruit.com/adafruit-microsd-spi-sdio
Sd card: SDHC 32 GIG micro sd card.
The wiring is okay, I checked so many times.
The sd card and adapter works for spi, tried it on arduino.
What I have tried in STM32CubeMX:
Enable SDMMC1 (Tried both SD 1 bit and wide 4 bit)
- Formatted it on windows to FAT32
- Interrrupt on
- DMA on
- Pullup on every pin except CK
- Put sdmmc clock to 48 MHz
- DMA template enabled on FATFS
I have tried different PCB, tried different sd adapter, tried different sd card
What My code is crashing on is the f_mount. It returns
Solved! Go to Solution.
2024-06-26 05:53 AM
My new problem is not I cant use the sd Card after the stm32 processor have been in sleep mode. The sd card refuse to open a file or make a volume, mouting is fine. I have tried many differemt pf init/deint but nothing seems to work. Any ideas?
Note: The cards works before sleep mode
2024-06-26 06:07 AM
Do you power-down the card while the STM32 is asleep?
What do you do with the SDIO lines while the STM32 is asleep?
2024-06-26 07:11 AM
It goes into Stop mode 2:
"
2024-06-26 07:30 AM - edited 2024-06-26 07:31 AM
@morris wrote:Can it have someting to do with the clock?
Quite possibly - you'll have to re-run your SystemClock_Config() to get your clocks back to how they were before sleep.
What happens to the SDIO peripheral during sleep? Does it need to be reconfigured after?
I don't think you answered whether you have a logic analyser to see what's happening on the wires? That should show up if the timings all gone wrong ...
2024-06-27 04:44 AM
I found it, I had to run