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.

TMS320C6748: Linux CDC mdoe : can't send data larger than 4M

Genius 13655 points
Part Number: TMS320C6748

Hello Champs,

Customer works on USB CPPI DMA driver and he wants to transfer larger than 4M data. He uses CDC device bus and CPPI DMA, DMA uses Linux CDC mode. In the data manual, it mentioned that the RNDIS and Linux CDC is the same except that LInux CDC mode requires data length should be times 64, if not, it will send 1 byte and data is 0x00 package to PC. 

The problem is that the DMA can't send data larger than 4M, the code is stuck at  enableCoreTxDMA while((HWREGH(usbInstance->usbBaseAddress + ulRegister) & 0x2) == 0x02);

Below is part of the code.

Initialize the CDC device bus:

void tpl_usb_cdc_init(void)

{

        CacheEnableMAR((unsigned int)0xC0001000, (unsigned int)0x08000000);

         CacheEnableMAR(L1DCFG_L1DMODE_32K | L1PCFG_L1PMODE_32K | L2CFG_L2MODE_256K);

         

         USBBufferInit((tUSBBuffer *)&g_sRxBuffer);

         USBDCDInit(USB_INSTANCE, (tUSBDCDCDevice *)*g_sCDCDevice);          

         Cppi41DmaInit(USB_INSTANCE, epInfo, NUMBER_OF_ENDPOINTS);

}

........................

for(j = 0; j < 16;j ++)

{

         dataBuf = (unsigned char *)cppiDmaAllocnBuffer(2048);//申请DMA缓存

          for(i = 0; i < 2048*1024; i++)

          {

                     dataBuf [i] = (i + 1)%256;

         }

         doDmaTxTransfer(USB_INSTANCE, dataBuf , 2048*1024, g_sCDCDevice.psPrivateCDCSerData->ucBulkINEndpoint);

          enableCoreTxDMA(USB_INSTANCE, g_sCDCDevice.psPrivateCDCSerData->ucBulkINEndpoint);//打开DMA通道

          delay(0xFFFFFFFF);//加入延时让DMA数据发送完成

          cppiDmaFreenBuffer((unsigned int *)dataBuf);//释放DMA缓存

          disableCoreTxDMA(USB_INSTANCE, g_sCDCDevice.psPrivateCDCSerData->ucBulkINEndpoint);//关闭DMA通道

          dmaTxCompletion(USB_INSTANCE, g_sCDCDevice.psPrivateCDCSerData->ucBulkINEndpoint);//队列发送完成,退出中断

}



Thanks.
Rgds

Shine

  • Hi Shine,

    Sorry but our USB expert is out this week. We'll try to get back to you next week.

    Thanks for your patience.

    Jianzhong

  • Hi Jianzhong,

    Is our USB expert back? Customer is waiting for our suggestion.

    Thanks.
    Rgds
    Shine

  • Shine,

    I'm sorry, our expert will be back toward the end of the week and will respond as soon as possible.

  • Hi RonB,

    Okay.  Thank you very much.

    Rgds

    Shine

  • Hi Shine,

    I only support USB in Linux, but not RTOS or any other OS, so I can only provide limited comments.

              delay(0xFFFFFFFF);//加入延时让DMA数据发送完成

              cppiDmaFreenBuffer((unsigned int *)dataBuf);//释放DMA缓存

              disableCoreTxDMA(USB_INSTANCE, g_sCDCDevice.psPrivateCDCSerData->ucBulkINEndpoint);//关闭DMA通道

              dmaTxCompletion(USB_INSTANCE, g_sCDCDevice.psPrivateCDCSerData->ucBulkINEndpoint);//队列发送完成,退出中断

    Is this code referenced from any other TI provided driver? I am not sure how the USB drivers are implemented in TI RTOS, but I would think the normal sequence would be:

    delay(0xFFFFFFFF);//加入延时让DMA数据发送完成
    dmaTxCompletion(USB_INSTANCE, g_sCDCDevice.psPrivateCDCSerData->ucBulkINEndpoint);//队列发送完成,退出中断disableCoreTxDMA(USB_INSTANCE, g_sCDCDevice.psPrivateCDCSerData->ucBulkINEndpoint);//关闭DMA通道
    cppiDmaFreenBuffer((unsigned int *)dataBuf);//释放DMA缓存