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.

[AM335x]different size data receiving through USB DMA

Dear Champs,

Is it possible to receive different size data through USB RX?

My customer's environment is

Host(PC) USB --> AM335x(DEVICE) USB Rx 

Endpoint : 512byte, using GRNDIS mode, GRNDIS Max : 65536 byte

1 HPD used. HPD Buffer Size : 65536byte.

In this setting, they would like to get different data blocks at each time like as 1byte at 1st, 8byte at 2nd, 20byte at 3rd, ...,

Is this possible in CPPI usb driver?

Is there any example code to help to implement it?

My customer is using AM335x and Starterware(non-OS).

Thanks and Best Regards,

SI.

  • HI Sung,

    The answer to your question is No.

    In GRNDIS mode the CPPI DMA expects transfers that are a multiple of USB max packet size ( such as 64, 512 etc),  that is programmed in GENERIC RNDIS EPn Size register. If you have programmed 64 as the size in EP size register ( say for FS devices ) then CPPI DMA will receive 64 byte packets till the number of bytes received matches the packet length field in HPD.

    If a short packet ( size less than value in Generic EP size register) is received during the transfer, the HPD would be retired. Similar situation exists for RNDIS mode.

    In short either the transparent mode or the PIO mode would be suitable for this customer. My suggestion would be to go in for the PIO mode as the packet lengths are way to low to justify the overhead of using the CPPI dma.  

     You may refer section " CPPI DMA Protocols Supported " in AM335x TRM.

  • Thanks Vineeth Balan,

    Where is PIO mode? When I see the TRM 13.3.9.8 CPPI DMA Protocols Supported, I only found only Transparent, RNDIS, Generic RNDIS, and Linux CDC.

    Is there example code for Transparent mode and PIO mode?

    Thanks and Best Regards,

    SI.

  • Hi Sung-IL,

    There are two ways of transporting data to MUSB buffers -

    1 . Using CPPI DMA

    2. PIO mode/CPU mode - where the CPU is used to copy the data to MUSB FIFO RAM.

     Please refer the MUSB documentation in AM335x TRM.

    StarterWare examples such as host MSC (by default DMA based) use a compiler flag "DMA_MODE" to enable DMA mode. You would need to remove and rebuild that executable ( including drivers ) to switch to PIO mode. Refer  ..\examples\evmAM335x\usb_host_msc\usb_host_msc.c.

    Latest StarterWare examples use transparent mode only as other modes have Si issues.