Page 1 of 1
sdc driver : µsd card compatibility
Posted: Wed Mar 13, 2013 10:21 am
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
Re: sdc driver : µsd card compatibility
Posted: Wed Mar 13, 2013 11:55 am
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
Re: sdc driver : µsd card compatibility
Posted: Wed Mar 13, 2013 2:23 pm
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
Re: sdc driver : µsd card compatibility
Posted: Wed Mar 13, 2013 3:50 pm
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
Re: sdc driver : µsd card compatibility
Posted: Thu Mar 14, 2013 1:30 pm
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
Re: sdc driver : µsd card compatibility
Posted: Mon Mar 25, 2013 8:30 am
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.
Re: sdc driver : µsd card compatibility
Posted: Mon Mar 25, 2013 12:24 pm
by rubenswerk
I tried cards in the range 2GB ... 16GB, no problems.
No external pullups, only the internal.
Re: sdc driver : µsd card compatibility
Posted: Mon Mar 25, 2013 6:09 pm
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