cancel
Showing results for 
Search instead for 
Did you mean: 

driving SD card with SDIO_CK over 25Mhz

xzhang2
Associate II
Posted on June 08, 2011 at 16:57

Has anyone successfully worked with driving SD card with SDIO_CK over 25MHz?

I'm working on a SD card project. I'm trying to increase SDIO_CK up to 48MHz. but I keep receive SD_ERROR 3 ''SD_CMD_RSP_TIMEOUT ''.

SD card is V2.0. I am using CMD6 to switch to high speed mode. Response data shows switch is done. but following command gets SD_ERROR 3.

Any ideas?

JZ

#sdio-standard-peripheral-library-stm32 #sdio
7 REPLIES 7
infoinfo989
Associate III
Posted on June 08, 2011 at 17:31

Have you checked the bus timing using a scope?  We've found the critical timing seems to be when the CPU is doing a read from the card. Make sure the data setup time for the processor is being obeyed.

wojciech239955
Associate II
Posted on June 15, 2011 at 13:35

I have

exactly

the same

problem

(for

STM32F207

)

.

I'm unable

to

start the

transmission of

48MHz

with

the card.

I have

built

my own

sources

, and

only

some

modeled

by the solutions

of

StdPeriphLib

.

Card

switches to

HighSpeed

​​properly

.

After switching on

the

BYPASS

bit

SDIO_CLKCR

,

communication

crashes

on

SD_CMD_RSP_TIMEOUT

or

SD_DATA_TIMEOUT

.

SDIO

I've configured

to

work

with the

DMA

without

interrupts

,

only the

pooling

flags

.

PCLK2

=

60MHz

so

good.

When

BYPASS

is disabled, the

24MHz

transmission

works

very

well

.

 

I can not

find the

causes

for this

.

infoinfo989
Associate III
Posted on June 15, 2011 at 16:37

How is the STM32 physically interfacing to the card? Is there a level converter between the processor and the card, or is the card directly wired to the processor?

xzhang2
Associate II
Posted on June 16, 2011 at 00:09

do I need a level converter? since the SD card works fine with 24MHz with SDIO interface to it directly. I don't see any reason why need a level converter. if there is, I would like to hear.

JZ

Andrew Neil
Evangelist
Posted on June 16, 2011 at 12:17

Have you seen this post about timing issues in the ST code:

/3b73403f

wojciech239955
Associate II
Posted on June 16, 2011 at 19:54

Yes,

I've seen.

But this is not

the problem.

First

rule,

 

I dont build

such structures

,

but

overall

lean

timeouts

independent

countdown

timer

on

the system

.

Secondly

, this feature

CmdError

is called

only once

during

initialization

when the

SDIO

works at

400kHz

.

The problem

appears only after

the switch

SDIO

to

48MHz

, and this is

an internal

timeout

registrer

SDIO_STA

.

Setting the

timeout

higher values

​​do

not change.

The controller

simply

not sent

or receive

data.

infoinfo989
Associate III
Posted on June 21, 2011 at 17:51

Permit me to ask a second time: have you checked your bus timing with an oscilloscope?

On our board, we've found it's not possible to reliably exceed 20 MHz due to timing on the read cycle. That's with our hardware - yours will no doubt be different. You should certainly be able to hook up a scope or logic analyzer and watch the bus transfers. After all, the SD bus is only 6 lines.