[DONE] SDC read fails.

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderators: RoccoMarco, barthess

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: [TODO] SDC read fails.

Postby Giovanni » Wed Sep 18, 2013 7:20 pm

I'll make some tests on this during the weekend however the cards I have never had problems with this.

Giovanni

alexblack
Posts: 276
Joined: Mon Sep 24, 2012 3:52 pm
Location: Donetsk
Been thanked: 32 times
Contact:

Re: [TODO] SDC read fails.

Postby alexblack » Thu Sep 19, 2013 1:32 pm

Hi,
resset wrote:@alexblack, @Giovanni, can you tell if you have any other information on this?
I use STM32F407-DISCOVERY with Embest board and SDIO interface. ChibiOS/RT is 2.7.0unstable (most recent). My four cards, as turned out below, are most likely all V2.0. And I have quite related problem with them.

I think it is hardware problem. Check carefully the board with a magnifying glass - possibly a cold solder joints! Also check contacts of the reader.

resset
Posts: 32
Joined: Thu Dec 20, 2012 11:57 pm
Location: Poland
Has thanked: 2 times
Been thanked: 1 time
Contact:

Re: [TODO] SDC read fails.

Postby resset » Thu Sep 19, 2013 8:08 pm

alexblack wrote:Hi,
I think it is hardware problem. Check carefully the board with a magnifying glass - possibly a cold solder joints! Also check contacts of the reader.

I checked every line between discovery board and card socket and they are continous. Also solder joints look ok. I also tried another STM32F4-DISCOVERY board, same results. So only hardware sources of this failures can be either bad socket or bad cards (four of them).

MCU ports connected to D0-3, CMD, CLK are configured as floating, but there are external 47k pullups on all lines except CLK.

On the other hand I tried to delay a bit (10ms) first call to sdConnect after insertion was sensed. No difference, however. Once or twice I got error 12, which is SDC_DATA_TIMEOUT | SDC_COMMAND_TIMEOUT, but couldn't repeat in finite time it in order to debug the cause.

As soon as I get another SD card I'll test it.

pito
Posts: 199
Joined: Sun Nov 06, 2011 3:54 pm

Re: [TODO] SDC read fails.

Postby pito » Fri Sep 20, 2013 8:22 am

Have a look here:
viewtopic.php?f=3&t=519&hilit=pito+sdio#p4807
There is a working example attached within the posts somewhere for SDIO card speed measurements, maybe it helps you somehow.

alexblack
Posts: 276
Joined: Mon Sep 24, 2012 3:52 pm
Location: Donetsk
Been thanked: 32 times
Contact:

Re: [TODO] SDC read fails.

Postby alexblack » Fri Sep 20, 2013 12:37 pm

Hi,
resset wrote:MCU ports connected to D0-3, CMD, CLK are configured as floating, but there are external 47k pullups on all lines except CLK.
As soon as I get another SD card I'll test it.

I configured all pins D0-D3, SCK, CMD as "Alternate OUT", not floating.

resset
Posts: 32
Joined: Thu Dec 20, 2012 11:57 pm
Location: Poland
Has thanked: 2 times
Been thanked: 1 time
Contact:

Re: [TODO] SDC read fails.

Postby resset » Fri Sep 20, 2013 3:02 pm

pito wrote:Have a look here:
viewtopic.php?f=3&t=519&hilit=pito+sdio#p4807
There is a working example attached within the posts somewhere for SDIO card speed measurements, maybe it helps you somehow.

Unfortunately this works the same way, sometimes it mounts card immediately, sometimes doesn't at all.

alexblack wrote:I configured all pins D0-D3, SCK, CMD as "Alternate OUT", not floating.

My config is: MODER: alternate function, OTYPER: push-pull, OSPEEDR: 100M, PUPDR: floating (no pull-up, no pull-down, I have them on board), AFRH: 12.
I think there is no explicit way to set AF and output mode on the same pin.

Meh, I think I must have either faulty cards or some nasty problem with HW. Thank you for all help and let me think over it during a weekend. Thanks:)

P.S.
Giovanni, are you going to include alexblack's fix for V1.1 cards?

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: [TODO] SDC read fails.

Postby Giovanni » Fri Sep 20, 2013 3:17 pm

Yes, over the weekend.

Giovanni

pito
Posts: 199
Joined: Sun Nov 06, 2011 3:54 pm

Re: [TODO] SDC read fails.

Postby pito » Fri Sep 20, 2013 8:45 pm

OSPEEDR: 100M,

I would not go with 100M, my setting was 25, I think. Such slew rate may cause extensive ringing with longer wires or with bad impedance matching..

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: [TODO] SDC read fails.

Postby Giovanni » Thu Sep 26, 2013 2:03 pm

Hi,

I haven't forget this, I decided we need a better test for this driver in order to evaluate functionality and performance. The new test application is able to generate scores:

Code: Select all

ch> ChibiOS/RT Shell
ch> sdc all
Connecting... OK

Card Info
CSD      : 00260032 5F5983C0 FEFA4FFF 924040B4
CID      : 03534453 55313238 807FFFD7 000072E0
Mode     : SDV20
Capacity : 120MB
Single block aligned read performance:           2871 blocks/S, 1469952 bytes/S
16 sequential blocks aligned read performance:   12752 blocks/S, 6529024 bytes/S
Single block unaligned read performance:         2711 blocks/S, 1388032 bytes/S
16 sequential blocks unaligned read performance: 2736 blocks/S, 1400832 bytes/S
ch>


It is located in the 3.0 branch, I am still working on it but I will backport the result to 2.6 when it is done. If you have cards to test checkout the 3.0 branch, it is good enough for development now.

Giovanni

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: [TODO] SDC read fails.

Postby Giovanni » Thu Sep 26, 2013 2:04 pm

The first result is that the card I am testing fails to connect the first time after a cold boot, it works fine afterward. It is possible this is related to the problem you guys are experiencing.

Giovanni


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 8 guests