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.

Alternatives to TI CSL library MMC_Write function?

In "csl_mmcsd.c" there is a function to write blocks of data to the SD Card.

CSL_Status MMC_write(CSL_MmcsdHandle    hMmcsd,
                     Uint32             cardAddr,
                     Uint16             noOfBytes,
                     Uint16             *pWriteBuffer)


When writing multiple blocks, this function appears to do 3 things:

1) Sends the CSL_MMCSD_WRITE_MULTIPLE_BLOCK_CMD command (Command 25)

2) Writes the data

3) Sends the stop command (CSL_MMCSD_STOP_CMD)

According to the SD card specification - after sending the stop command the SD card can be busy for up to 500ms.
 In my application I need to write to the same file multiple times as new data arrives (every 32ms). Occasionally we see these 500ms drop-outs when the SD card is busy (and lose data as a result) Therefore it would be more efficient to only send the start command when I write the first blocks and only send the stop command when I write the last block.

Is there an alternative to MMC_write() in the CSL library that I can use in this way?

  • Hi,

    We are looking into this and will get back to you .

    Regards

     Vasanth

  • Hi Paul,

    I don't think there is any other CSL calls that would speed things up given your application. Are there any buffering techniques that could be explored perhaps?

    MUltiple block writes seems to be the max (http://www.ti.com/lit/ug/sprufo6b/sprufo6b.pdf described in section 1.3.6.)
    I will check internally with some colleagues to see if they are aware of any other methods and will update here if so.

    Lali

  • Hi Paul,

    I am a little bit confused by your question. MMC_write() is doing the sector write to SD card without file system. You want to write data to the same file multiple times. It sounds like you need a file system. If you need a file system, then ATA example (CSL_MMCSD_SdCardFSExtExample or CSL_MMCSD_SdCardFSExample) is the one you want to study.

    If you want to increase the throughput in the FAT32 formatted SD card, the best thing to do is to increase the block size when you format the SD card. The default size is 4KB (8 sectors). It means you can do the ATA_write() can use 4KB instead of 512B, which reduce the number of SD write sessions to 1/8. As you may know, the system overhead for each write session is quite big. You even increase the block size beyond the 4KB, but it really depends on the nature of your data collection and buffering. The key is to reduce the number of write sessions by increase the write data size.

    Hope it helps!

    Best regards,

    Ming