Problem with SDMMC interface CMD55?

Post here all questions related to STM32 core if you can't find a relevant section!
Post Reply
Bambo
Posts: 75
Joined: Wed Jan 15, 2020 8:36 pm

Problem with SDMMC interface CMD55?

Post by Bambo »

Hi,

I'm currently working on a project that uses a MicroSD SDHC card as its storage.

At the moment i'm having problems with initializing SD cards. Sometimes the SD will initialize ok but other times the same cards won't. I've pinned the bug down to a particular line of code but I am having no luck apply fixes i find online.

The bug is here: https://github.com/stm32duino/Arduino_C ... sd.c#L3546. The line "errorstate = SDMMC_CmdAppCommand(hsd->Instance, 0);" is returning 4, but it makes no sense because that command is ran a couple statements before here https://github.com/stm32duino/Arduino_C ... sd.c#L3534 and that returns no errors.

So in summary when the second CMD55 is sent, it returns an error but the first time it does not.

Some references:
1. https://community.st.com/s/question/0D5 ... er-acmd-41
2. https://community.st.com/s/question/0D5 ... ue-stm32l4

Can anyone help me figure this out?

Thanks!
Bambo
Posts: 75
Joined: Wed Jan 15, 2020 8:36 pm

Re: Problem with SDMMC interface CMD55?

Post by Bambo »

Update:

I've configured the SDMMC clock to be 8MHz and starting with a clock div of 78 to bring it to 100KHz for initialization but it doesn't seem to affect it.
Post Reply

Return to “General discussion”