This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

MCB2300 and SD-Card/MCI trouble

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

Parents
  • 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.

Reply
  • 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.

Children