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.

TMS320F28377D: Write SD card killed card

Part Number: TMS320F28377D
Other Parts Discussed in Thread: CONTROLSUITE

Hi everyone,

I am using a TMS320F28377D with a micro SD card for a long time now. My old project is able to read and write files on the SD card but after a new installation of the IDE writing fails. With a new project I even crashed some cards, they are not recognized on Windows anymore.

To figure out what is going wrong I opened the sd_card example located at C:\ti\controlSUITE\device_support\F2837xD\v210\F2837xD_examples_Cpu1. Unfortunately, the project does not write anything to the card, so I added the following code into line 801.

fresult = f_open(&g_sFileObject, "test.txt", FA_READ | FA_WRITE);
fresult = f_read(&g_sFileObject, g_cTmpBuf, sizeof(g_cTmpBuf) - 1, &nStatus);
fresult = f_write(&g_sFileObject, g_cTmpBuf, sizeof(g_cTmpBuf) - 1, &nStatus);
fresult = f_close(&g_sFileObject);

The line 801 is the line after mounting the file system. I created a file "test.txt" with some text and stared the program. Reading was fine, even the write ended with FR_OK but f_close terminated with FR_RW_ERROR.

Can anyone give me a hint where to search for the problem and what happened to the dead SD cards? What can go wrong to destroy a card?

Thank you for the support

Kind Regards Jan

  • Hi Jan,

    I apologize for the slow response. There is a known issue when writing to the SD card described here:


    Are the cards truly destroyed or do they just reformatted before you can use them again?


    Whitney

  • Hi Whitney,

    thank you for the information. With this fix my code is working.

    Whitney Dewey said:
    Are the cards truly destroyed or do they just reformatted before you can use them again?

    Well, the cards are not recognized by Windows or Linux anymore, so I am not able to reformat them. I thought about reformatting them with FatFs but at that moment I still had this bug in my program. Perhaps it is possible with the fixed version.

    Is there any schedule for releasing a fixed support library?

    Kind regards,

    Jan

  • Jan,

    Glad to hear that fixed it. The fixed code should go out in a release around the end of this month.

    Whitney