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/TMS320C6748: FATFS file write, Long Name Support, SDCardPin Detection

Part Number: TMS320C6748

Tool/software: Starterware

I am currentyl testing Norman's code to write a file to SD card on LCDK C6748.

By adding a delay inside disk_write, I could write a file to SD card but no idea on what cause the code failure without this delay? Can anyone tell me what is the provable reason on this?

Without the delay, I could creat a file but can't write any data into the file, just leaving FR_RW_ERROR message observed on the console.

Furthermore, I want to use Long file name. However, I don't see FATfs R0.04b have any LFN support. Do you happen to have any update on this?

For SDCardPresence Detection, do I just need to set the corresponding pin as input and read the value?

As the last question, if I want to use FAT32, what are the things I need to take care of?

  • Wook Bae,

    Who is Norman, or where did that code come from?

    In which file did you put the delay within disk_write? I find a function called disk_write in multiple *.c files within Starterware, including within some of the example files.

    How long is the delay you add? Please show that code.

    What speed grade SD card are you using?

    Regards,
    RandyP
  • WP_MMCSD_V0R2.zip 

    Please refer to the attached link and code. If you get into this link, you can find the original Norman's code. Actually, I am looking for a stable version of mmcsdproto.c for c6748 SD card write and read operaton. 

    Below are a part of file list in Norman's  code.

    mmcsd_rw.c // main c

    ff.c // fatfs 

    fat_mmcsd.c // interface layer between fatfs and SD protocol layer

    mmcsd_proto.c// sd card protocol layer 

    mmcsd // c6748 SD driver

    Actually, I added some delay (about 10us) into disk_write function in fat_mmcsd.c.

    For SD class, it is class 4 8GB.

    However, disk_write operation is not stable in this code somehow. So if possible, please correct the attached code.

  • Are there any problems on the code? I have been waiting for your reply but couldn't hear any so far. If it is not possible to get the code corrected for me, don't you have any reference code and document for MMCSD protocol layer on C6748.
  • I am having the similar problem with f_write(). I created a txt file for read/write in SD. Found that if it is an empty file, it is not able to write and got FR_RW_ERROR. If I write 10 bytes manually in SD card, the maximum char I can write with f_write() is 10 bytes to overwrite the data in the file. So if I like to write 1000 bytes in the card with f_write(), I have to write 1000 bytes manually in the card beforehand. Not fully understand why and still figuring out what is the reason.

  • You may test the above code. I could write upto 30Kbyte size file to 8GB SD card with this code.
    Here, I added some delay and applied a tweak to disk_write function as Avi Tal suggests in below link.

    e2e.ti.com/.../283373