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.

请教关于Generic RNDIS DMA发送问题



各位专家,我在ezDSP5535开发板上用CCS5.3,在c55_csl_304\ccs_v50_examples\usb\CSL_USB_DmaExample的基础上修改发送缓冲区,可以向PC发送自定义的数据了。现在我想让5535读取SD卡内的几十GB的数据并发送上来,问题如下:

1.原工程里面是Transparent DMA模式,当然也可以用每次发送512B,执行多次的方法,但感觉这样效率比较低

2.如果用RNDIS DMA或Generic RNDIS DMA,除了做好相关寄存器中的模式设置之外,是否只需要改USB_confDmaTx()函数?还有其他需要改动的地方吗?

CSL_Status USB_confDmaTx(DWORD dwEndpoint, CSL_UsbHostPktDescr *hpdtx,Uint32 packetsize, Uint16 *pTxBuffer,Bool swapWords)
{
…………

if((hpdtx != NULL) && (pTxBuffer != NULL))
{
…………

hpdtx->Buffer0InfoWord0 = packetsize;      //是否普通RNDIS最大为4M-1字节,而Generic RNDIS最大为65536字节?

hpdtx->Buffer0InfoWord1 = ((Uint32)pTxBuffer) << 1 | 0x80000;      //该buffer长度是否与packetsize一致?

hpdtx->LinkingWord = 0;              //是否不再为0,若指向next buffer应该怎么修改?
hpdtx->OriginalBuffer0InfoWord0 = packetsize;

hpdtx->OriginalBuffer0InfoWord1 = ((Uint32)pTxBuffer) << 1 | 0x80000;

…………

}


3.手册中说transparent dma每次传输完成后都会产生一个dma中断,但在例程中没有发现相关的dma ISR,请问是什么原因?

4.若改为RNDIS DMA或Generic RNDIS DMA,是否也不需要dma ISR?


初次接触USB,请多指教!!

  • 没有RNDIS的例程可以参考。

    根据TRM RNDIS DMA Transfer Setup的要求,把模式改为RNDIS 模式就可以了,例程中MzxPktSize=64bytes已经满足要求。USB_confDmaTx的话,buffer可以改成你要求的大小。
    http://www.ti.com/lit/ug/spruh87h/spruh87h.pdf

     
    没有用到DMA中断就没写,看你是否需要DMA中断去做处理。

    上面文档13.2.9.9 CPPI DMA Transfer Interrupt Handling专门有讲DMA中断处理。 

  • 好的谢谢,我再试试。另外13.2.9.9中似乎两句话矛盾:

    The firmware needs to use queues not reserved by H/W as Completion Queues if require for DMA interrupt to be generated on a completion of a transfer.

    若传输完成后需要产生中断,Firmware 需要使用未被硬件保留作为completion queue的queue.

    If need not to generate an interrupt, firmware is required to use queues that are not reserved as completion queues (queues 28 to 67).

    若不需要产生中断,则应使用未保留的queue28~67作为completion queue

    那么问题是:若使用queue28~67,会不会产生中断?

  • 谢谢指正,文档中的这句话确实有错误,not应该去掉才对。

    The firmware needs to use queues not reserved by H/W as Completion Queues if require for DMA interrupt to be generated on a completion of a transfer.

    我已提交这个typo。
    http://www.go-dsp.com/forms/techdoc/doc_feedback.htm?litnum=SPRUH87H