0
\$\begingroup\$

I am trying to implement an sd card reader on lpc43xx devices. For this I can make use of the LPCopen examples that use the ROM based drivers. However for some reason the ROM based driver example states that it only supports sd cards up to 4Gb.

So now I probably have to port the outdated LPCUSBlib drivers in order to implement the sd card reader. Of which a specific bug discussed in this question: SDXC Card Reader with LPC1822

In this question it is replied that the LPCUSBlib version only worked up to 4GB initially as well. And a fix is proposed to accept sdxc cards of up to 64GB. (However it seems like in his pre fix code it should already accept up to 32GB) So I am confused whether this same fix was used to solve the initial issue of only supporting up to 4GB.

My question is, does anyone know the exact bug fix that got it working for >4GB. And would this solve the same problem for the ROM based rivers? The reason for asking is to prevent me from porting the LPCUSBlib drivers and then finding out that it only supports up to 4GB as well.

Thanks a lot.

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

This is speculation, so don't hold it to high standards :)

Difference between SD and SDHC is the fact that addresses are no longer byte based (32-bit number gives you the 4GB limit. Sandisk's website [1] says 2GB is the limit, but I vaguely remember 4GB cards in both variations), but 512B sector based.

As for 64GB, those are supposed to be SDXC, but as far as I can see the difference is just the filesystem change (exFAT vs. FAT32), which seems a bit silly, since the SD interface addresses blocks of raw data. I can't find a reference explaining any other difference, and would appreciate it. I've only used SD and SDHC on microcontroller, so my SDXC understanding could be wrong.

To actually answer: No, it definitely won't be the same bug fix (support for different commands and sector vs. byte addressing). I guess the upside is that a bugfix might not be needed at all.

[1] http://kb.sandisk.com/app/answers/detail/a_id/2520/~/sd%2Fsdhc%2Fsdxc-specifications-and-compatibility

\$\endgroup\$
3
  • \$\begingroup\$ Hey Domen, thanks a lot for your answer. THe LPC43xx device supports sd and SDHC as well. However the usb mass storage drivers example says it supports only up to 4GB devices. And I am very curious to know what kind of fix was applied in the earlier mentioned thread about getting it to work above 4 GB. Do you think the SD adresses and SDHC adresses cause the problem? \$\endgroup\$
    – bjeust
    Jan 30, 2016 at 12:11
  • \$\begingroup\$ If I understand, you're asking a different question now. Why is USB mass storage driver limited to 4GB? I wouldn't know, but I can suspect it's because 32-bit integer is used for size/offset somewhere. \$\endgroup\$
    – domen
    Jan 31, 2016 at 12:39
  • \$\begingroup\$ Hey Domen, thanks a lot for your replies. You were right. The problem was indeed that a 32-bit integer was used \$\endgroup\$
    – bjeust
    Feb 10, 2016 at 20:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.