This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Starterware/TMDSLCDK138: Having problem with using f_write() to write SD card

Part Number: TMDSLCDK138

Tool/software: Starterware

I am running the sample project "2045.starterware_c6748_mmcsd" on LCDKOMAPL138. Added the following code:

fresult = f_open(&g_sFileObject, g_cTmpBuf, (BYTE)FA_WRITE);
if(fresult != FR_OK)
{
return(fresult);
}
usBytesRead = 7;
strcpy(writeDatBuf, "testing");
fresult = f_write(&g_sFileObject, writeDatBuf, 7,
&usBytesRead);
if(fresult != FR_OK)
{
return(fresult);
}

The f_open() and f_write() always report FR_OK. However, the data was not written into the file (txt file). The f_read() work fine and read back the correct data every time. Please advise.

Thanks.

  • If you mean the sample from here:

    e2e.ti.com/.../283373

    I ported over from AM335X to C6748 for my own purposes. As such, it it not officially supported by anybody including TI guys. The port was mainly replacing AM335X HS SD/MMC code with C6748 SD code. The rest of the code was left mostly unchanged. The original StarterWare AM335X SD card example did not support writing. Only read. I should have noted it the notes at the top of the thread. It is noted in a later reply.

    Another forum user named "wook bae" is also trying to get long file name and write working but is having some problems. See his thread here:

    e2e.ti.com/.../578888

    He posted his code in one of his replies. Look for:

    WP_MMCSD_V0R2.zip

    It might be better start. You might be able to help him out.
  • Moving this thread to the L138 forum.