LPC2368 SD read problem

i'm using the example program for LPC236X for testing the SD card by writing to it and verifying i'm reading back the same value.
the writing goes fluently without any problems.
the reading is stacked.
i realized that i don't get any data from the SD in the read process and the processor is waiting in the:

while ( !(MCI_STATUS & MCI_RX_DATA_AVAIL) );

i'm using an old 16MB SD card.
even when i'm trying to read from the card the SD_Status by using ACMD13 the card doesn't send any data.

when i insert the card to my digital camera i get the message "unable to use the card", but when i connect the camera to my laptop i can read and write to the card as it is detected by the laptop as removable storage.
any idea regarding the possible problem i have?

Parents
  • Hi Meir Sudry, Don't read the data in FIFO mode, use GPDMA mode.
    In my case Iam getting Receive Overrun error in FIFO mode so i shifted to DMA mode.
    I think You are writing the data on 0th block, which is a boot sector for file system, which was corrupted.
    When the bootsector was corrupted it won't work in camera because it won't format(not sure my guess) and if you connect to PC it shows as a removable disk but it will ask to format before trying to open it.

    Can you tell me which IDE and board you are using?

Reply
  • Hi Meir Sudry, Don't read the data in FIFO mode, use GPDMA mode.
    In my case Iam getting Receive Overrun error in FIFO mode so i shifted to DMA mode.
    I think You are writing the data on 0th block, which is a boot sector for file system, which was corrupted.
    When the bootsector was corrupted it won't work in camera because it won't format(not sure my guess) and if you connect to PC it shows as a removable disk but it will ask to format before trying to open it.

    Can you tell me which IDE and board you are using?

Children
More questions in this forum