Hi,
I'm running a bare-metal application on an BeagleBone Black. This application also accesses the SD-card of the BBB. The code I'm using, bases on the MMCSD-library which originally comes from TI (was shipped e.g. with StarterWare and with some other board support packages). This MMCSD-library is used in two environments:
- within the MLO bootloader-code, there plain accesses to the SD-card are used (no interrupts, no DMA, just polling the registers)
- within the main application, that was loaded by the MLO, there a sophisticated access method is used with EDMA and interrupts
In both cases the basic functions to send commands/read responses are the same, means the register handling is similar for both, they only differ in the method of receiving the data (polling vs. IRQ/DMA).
Now when I use "expensive" SD-cards, everything works fine in both environments.
When I use cheap, no-name SD-cards (that work properly with Windows and Linux), they only work in case 1). In case 2) they fail. In detail: sending an CMD to the card ends up with a timeout (CTO in register STAT is set while register CC is not set, so command was not completed but an timeout occurred). According to the description of the register CTO, this timeout is fixed, means I can not set a higher timeout-value for these cheap micro-SD-cards anywhere. Setting the bus-frequency (which originally is at 96 MHz) to a lower or much lower value also does not change anything.
As these cheap SD-cards work properly in case 1), I think this all is a timing problem and the EDMA/interrupt environment is too fast for them.
So...any idea what could be the reason or how to workaround this? Anybody knows this problem?
Thanks!