Hi,
I am using TMS320f288335 to write and read simple block to sd card. I am following this tutorial:
http://www.ti.com/lit/an/spraao7/spraao7.pdf
Uint16 write_buffer[512];
Uint16 read_buffer[512];
void main(){
for(i=0;i<512;i++)
write_buffer[i] = i;
}
void uSD_Process(){
switch(SD_process){
case POWERUPINIT:
sd_card_insertion();
SD_process++;
break;
case CARDINIT:
sd_initialization();
SD_process++;
break;
case READ_REGISTER1:
sd_read_register(SEND_CSD);
SD_process++;
break;
case READ_REGISTER2:
sd_read_register(READ_OCR);
SD_process++;
break;
case READ_REGISTER3:
sd_read_register(SEND_CID);
sd_erase_block(SECTOR_ZERO,1);
SD_process++;
break;
case WRITING:
sd_write_block(SECTOR_ZERO, write_buffer);
sdstatus.bit.bit2_Write = 0;
SD_process++;
}
break;
case READING:
sd_read_block(SECTOR_ZERO, read_buffer);
// sd_erase_block(SECTOR_ZERO,2);
SD_process++;
break;
}}
I am just follwing the standard sequence from pdf and it pass card_detection,Power-up Initialization, Card Initialization, Establish Communication, read CSD, CID, OCR.
However, I cannot read data from sd. Either I cannot write or read. The read_buffer array becomes all 0.
Could you help me please? The SD card I am using is just standard SD(not sdhc , not micro).