cancel
Showing results for 
Search instead for 
Did you mean: 

SD Card On SDIO, Command Response fails after ACMD 41

slagment
Associate II
Posted on February 29, 2012 at 22:19

The original post was too long to process during our migration. Please click on the attachment to read the original post.
16 REPLIES 16
Bill Lewis
Associate III
Posted on March 15, 2013 at 18:53

Has anyone gotten this to work?  I pulled down Clive's FATFS-DBG project and that gives exactly the same behavior at CMD55.

Posted on March 15, 2013 at 20:10

Has anyone gotten this to work?  I pulled down Clive's FATFS-DBG project and that gives exactly the same behavior at CMD55.

 

While it's possible I messed up something in the release, I do have SDIO running on multiple platforms, a custom F2/F4 board, and the STM32F4-Discovery board. The pull ups are critical to the interface, and I have very short and even wiring (about 1'' or 30 mm at most), the PCB implementation is perhaps half that.

I am using MicroSD (mainly SDHC, some SDXC) cards, and have used 128 MB to 64 GB cards.

Other things that are important are the correct HSE_VALUE, and a 48 MHz setting for the SDIO. The 48 MHz is important for USB interfacing, but I have over clocked this, and it can go faster.

You'll need to state very clearly what hardware, sockets, cards, etc you're using, and how it's all wired up.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Bill Lewis
Associate III
Posted on March 15, 2013 at 22:14

I hate to look stupid, but I am admitting it here.

Without thinking or checking I used the pin assignments for the SD card socket listed in the stm32f4_discovery_sdio_sd.c file.   They are for a Micro SD card and I'm using a full size card which has a different pinout.

I shuffled wires around on my prototype and it ''just works''.

My wires are 1 to 1.5 inches long.  I do have caps on the power pins of the socket also.

-Bill

P.S.  Clive, the help you provide this community is amazing!

Posted on March 16, 2013 at 00:13

Thanks, I'm glad you managed to pin point what was going on.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Bill Lewis
Associate III
Posted on March 23, 2013 at 19:31

I have a new problem with the SDIO example code.

stm32f4_discovery_sdio_sd.h  defines:

   static uint8_t SDSTATUS_Tab[16];

stm32f4_discovery_sdio_sd.c has this function:

   SD_Error SD_SendSDStatus(uint32_t *psdstatus)

The function is called with:

   errorstatus = SD_SendSDStatus((uint32_t *)SDSTATUS_Tab);

Inside the function is a doubly nested loop that fills in the table:

   *(psdstatus + count) = SDIO_ReadData();

That overwrites the space allocated for the status buffer.

The code writes 64 bytes as might be expected since it thinks the entries are uint32.

Has anyone else run into this?

-Bill

Posted on March 24, 2013 at 02:06

Not sure if it iterates around the 8 loop, or the latter while loop, but yes it doesn't look quite right.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on March 25, 2013 at 22:17

Definitely problematic, but does anyone call SD_GetCardStatus() ?

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