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