Hi,
I wanted to test the SD-card example from keil using the native MCI interface with an SD card. It detects well an Formatted SDcard inserted but asks me forever to format the card and then , that the format failed... When a took a look into the source, it seems mci_init() return well (__TRUE value), but when I did an mci_read_sect in order to read the sector 0, it failed. I really didn't find what's wrong...
Best Regards
I found the problem here:
mci_read_sect(...) { ... for (i = 100000; i; i--) { if (GPDMA_RAW_INT_TCSTAT & 0x01) { /* Data transfer finished. */ break; } } MCI_DATA_CTRL = 0x00; if (i == 0) { printf("timeout!\n"); } else if ((mci_read_status () & 0x0F00) != 0x0900) { printf("wrong state!\n"); } ... }
The debug message returned is 'Timeout'... I increased the timeout value (100 000 instead 10 000) but without success.
I don't know if it's your case, but the DMA only works if the buffer you are reading into is in the USB/Ethernet RAM area.
Regards, Sergio.
Thanks for the tip, But i tried to set up my destination buffer in usb memory like this without success :
static char pom[512] __attribute__((at(0x7fd0000)))
I still got the timeout on the reading... But this keil example is supposed to work out of the box ? :).
I forget to mention that the MCB2300 is a rev3 and with a LPC2368 .