sdc driver : µsd card compatibility

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
User avatar
alex31
Posts: 445
Joined: Fri May 25, 2012 10:23 am
Has thanked: 57 times
Been thanked: 88 times

sdc driver : µsd card compatibility

Post by alex31 »

Hello.

I use sdio sd card interface in several project, with olimex E407, and with our own design.
we had a bunch of old 2Gb sd card, and never had issues with them.

I just have bought 2 kinds of now selling card :
° sandisk µsdhc 8Gb class 10
° samsung µsdhc 8Gb class 4

none of this two card works with sdio driver, either using my code and my design, or using
unmodified ARMCM4-STM32F407-LWIP-FATFS-USB demo.

sdio driver connects, il retrieves correct csd bytes, but none of the read test passes.

any clues of what can be wrong, and where to find to make the driver
works whith this newer cards ?

Thanks
Alexandre
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: sdc driver : µsd card compatibility

Post by Giovanni »

Hi.

No idea, I don't have a card to test. You shoud try to debug step by step and see where the driver fails and the error condition.

Giovanni
theShed
Posts: 50
Joined: Tue Feb 26, 2013 3:43 pm

Re: sdc driver : µsd card compatibility

Post by theShed »

Humm.... 8GB that requires 33bits which may be a problem,
and I'm pretty sure Fatfs only supports up to 4GB (I may be wrong on that one).

1. Check the value returned by mmcsdGetCapacity() - I'm not convinced the V2 size calculation is right.
Edit: It is right....

2. Try re-partitioning the card into 4GB partitions - That should keep Fatfs happy...

--
mike
User avatar
alex31
Posts: 445
Joined: Fri May 25, 2012 10:23 am
Has thanked: 57 times
Been thanked: 88 times

Re: sdc driver : µsd card compatibility

Post by alex31 »

Humm.... 8GB that requires 33bits which may be a problem,
and I'm pretty sure Fatfs only supports up to 4GB (I may be wrong on that one).

1. Check the value returned by mmcsdGetCapacity() - I'm not convinced the V2 size calculation is right.
Edit: It is right....

2. Try re-partitioning the card into 4GB partitions - That should keep Fatfs happy...


Thanks for your advice, it's one of the 3 points that where needed to make my 8gb µsd card to work :

1/ i had both SDIO_Dn, SDIO_CK, and SDIO_CMD in floating mode, and, as i have read on another thread,
SDIO_CMD pullup should be activated (or perhaps the right way is to put a pullup resistor on the design ?)

2/ I have seen that sdcRead wad failing on timout, so i have
allowed a greater read timeout, putting
#define SDC_READ_TIMEOUT_MS 15
in mcuconf.h , instead of the default 5 ms, so sdcRead works now

3/ i have made a 4gb partition, and made a fa16 4gb filesystem in
and fatfs is happy with that.


Thanks !
Alexandre
User avatar
alex31
Posts: 445
Joined: Fri May 25, 2012 10:23 am
Has thanked: 57 times
Been thanked: 88 times

Re: sdc driver : µsd card compatibility

Post by alex31 »

according to fatfs documentation, fatfs should be able to use fat32 to format more than 2gb card, and be
able to use it.

does anybody here have been able to use this feature ?

I am ok until 4gb in fat16, but every attempt to use bigger fat32 filesystem hangs.

Alexandre
User avatar
kreyl
Posts: 59
Joined: Sun Jan 13, 2013 11:46 pm
Been thanked: 4 times

Re: sdc driver : µsd card compatibility

Post by kreyl »

I have tried 8GB uSD cards from different vendors, no problems with them. I use FAT32, by the way.
I have no pull-ups at my design, because stm32f205 allows to configure pin as output with pull-up activated. Otherwise I would place external pull-ups on every SD pin save CMD one.
I have some problem with very old 64MB uSD (ha-ha), but I did not bother to debug it, since I do not plan to use such stuff.
rubenswerk
Posts: 104
Joined: Wed Feb 22, 2012 11:39 am

Re: sdc driver : µsd card compatibility

Post by rubenswerk »

I tried cards in the range 2GB ... 16GB, no problems.
No external pullups, only the internal.
User avatar
alex31
Posts: 445
Joined: Fri May 25, 2012 10:23 am
Has thanked: 57 times
Been thanked: 88 times

Re: sdc driver : µsd card compatibility

Post by alex31 »

Ok, so fat32 should work for me too and i have to find why it's not working for me.

does fatfs, when using fat32 instead of fat16 use more stack ?

could you send me you ffconf.h to see if the problem is here ?

thanks in advance
Alexandre
Post Reply