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.

TMS320C5515: CSL_USB_MSC_dmaExample example issue

Part Number: TMS320C5515

Hi,

I encountered some problems when implementing the USB MSC function.

..\c55_lp\c55_csl_3.08\ccs_v6.x_examples\usb\CSL_USB_MSC_dmaExample

This CSL_USB_MSC_dmaExample implements USB MSC functionality.

The current CPU frequency is 100MHz, and the SD clock frequency is 25MHz.

The reading speed is about 2MB/s.

Write the card at a speed of 260kB/s.

1. How to improve the read/write speed?

If a large file (greater than 10MB) is written into the file, the file is suddenly terminated before the writing is complete.

However, it is sometimes possible to write a 40MB file without a hitch.

2. How can we achieve the stability of writing files?

Shide.Lu

  • Hi Shide,

    Support for C5000 is limited, please see: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/818771/faq-support-guidance-for-c5000-digital-signal-processors

    I've assigned this thread to a colleague with more expertise on this topic.

    Regards,
    Frank

  • Hi Shide,

    As I recall that there is a silicon bug in C5515 USB. When The System DMA and USB CDMA used at the same time, the system can be locked up. The workaround is to either disable the System DMA for MMC/SD or the CDMA for USB. It is easier to disable the system DMS for MMC/SD, because there is an example in the CSL: CSL_USB_MSC_pollExample. Please use this example instead. 

    To improve the overall performance, our suggested solution is to use bigger data buffer for MMC/SD read/write and USB transfer/receive. Currently it is 512B for both MMC/SD and USB. The suggested buffer size is 8KB which will increase the MMC/SD throughput significantly.

    Best regards,

    Ming

  • Hi Ming,

    Thank you very much for your professional reply.

    (1). Both CSL_USB_MSC_pollExample and CSL_USB_MSC_dmaExample projects have a problem, that is, they cannot run normally after they are burned to SPI-Flash.

    For the CSL_USB_MSC_dmaExample project, add the following two lines at the beginning of the main() function:

    *(volatile ioport Uint16 *)0x0001 = 0x020E;

    asm(" idle");

    Comment the interrupt configuration in the.TCF file, and configure it in C code instead, can solve this problem.

    However, the CSL_USB_MSC_pollExample project cannot be solved by this method.

    Therefore, I can only develop based on the CSL_USB_MSC_dmaExample project.

    (2). In the CSL_USB_MSC_dmaExample project, change SD DMA to the POLLED mode.

    status = configSdCard(CSL_MMCSD_OPMODE_DMA);

    change to

    status = configSdCard(CSL_MMCSD_OPMODE_POLLED);

    Is that possible? Do I need to change any other code else?

    (3). In the CSL_USB_MSC_dmaExample project, increase the buffer size.

    The SD card buffer is:

    Uint16 glbaCacheBuff[256 * CACHED_SECT_COUNT];

    #define CACHED_SECT_COUNT           (16u)

    To change this macro definition is to change the buffer size of the SD card.

    So, how do I modify the USB buffer size?

    In my tests, I found that USB only transfers 512 bytes at a time when reading and writing files.

    Best regards,

    Shide.Lu

  • Hi Shide,

    1) you are correct about the enable the MPORT (*(volatile ioport Uint16 *)0x0001 = 0x020E;). The bootloader disables the MPORT to save power by default. The USB will actually use the MPORT for data transfer.

    2) Please compare the file c55_csl\c55xx_csl\ccs_v6.x_examples\mmc_sd\CSL_MMCSD_dmaExample\csl_mmcsd_dma_example.c and \c55_csl\c55xx_csl\ccs_v6.x_examples\mmc_sd\CSL_MMCSD_SdCardExample\csl_mmcsd_SdCardExample.c for details. Mainly the following differences:

    mmcsdHandle = MMC_open(&pMmcsdContObj, CSL_MMCSD0_INST, CSL_MMCSD_OPMODE_POLLED, &mmcStatus);

    mmcStatus = MMC_getCardStatus(mmcsdHandle, &cardStatus);

    3) I do not think the USB packet size can be changed from 512 to higher, but you can use the multiple descriptors chained together. It is a little bit hard to do. Here is the performance for USB using CDMA and 512 byte packet size. The performance is not bad:

    CDMA 512-byte Packet 5.57 220.61 12.772 96.21

    If you can live with it, I suggest you stay with the 512 byte packet size.

    Best regards,

    Ming

  • Hi Ming,

    CDMA 512-byte Packet 5.57 220.61 12.772 96.21

    A) What is the unit of this data? And which is the read speed and which is the write speed?

    B) Which example did you run to get the result? And could you provide me with this example?

    C) How to use the multiple descriptors chained? Is there any example?

    What I want to achieve is USB MSC function. Requirements, read card speed 5MB/s, write card speed 2~3MB/s.

    Best regards,

    Shide.Lu

  • Hi Shide,

    A) 

      Read Time (s) Read Speed (Mb/s) Write Time (s) Write Speed (Mb/s)
    CPU 64-byte Packet 42.232 29.10 119.659 10.27
    CDMA 64-byte Packet 42.33 29.03 82.899 14.82
    CPU 512-byte Packet 16.314 75.32 32.731 37.54
    CDMA 512-byte Packet 5.57 220.61 12.772 96.21

    B) 0842.USB_Throughput_CSL_300.zip

    C) I currently do not have the multiple descriptor example, but the result in A) indicates that you may be able to reach your goals using 512 packet size.

    Best regards,

    Ming