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.

USB Device: No zero packet generated with CPPI DMA in Generic RNDIS mode

Hi,

I have a problem using the generic RNDIS mode regarding the generation of zero packets (device mode, IN direction).

Regardless if I'm setting the HPDword2.ZeroLength, there is no zero packet generated at all. But I get an interrrupt that the descriptor is finished.

I also tried to set the HPDword3buffLength to zero instead or in addition - it does not help.

Here is the logged descriptor as prepared by software:

    HPDword0 = 0x80000000,
    HPDWord1 = 0x0,
    HPDword2 = 0x14084018,
    HPDword3buffLength= 0x0,

After getting the interrupt, the descriptor shows exactly the same content:

    HPDword0 = 0x80000000,
    HPDWord1 = 0x0,
    HPDword2 = 0x14084018,
    HPDword3buffLength= 0x0,

..but there is no zero packet sent at all.

This seems to work fine in transparent mode. But any idea why it does not work in Generic RNDIS Mode?

 

Best Regards,

 

Stefan

  • Stefan

    There is separate mode available for zero byte transfer check with using RNDIS or CDC mode.

    Regards

    Ravi B

     

  • Ravi,

     

    thanks for your answer. Is my understanding correct that zero length packets cannot be sent in Generic RNDIS mode, and this is a feature (I could not find any hint regarding this in the documentation)? So the one and only option would be to switch to CDC or RNDIS mode if I want to send a zero packet?

     

    Best Regards,

     

    Stefan

  • Stefan

    I dont think zero length packet can be transfered using Generic RNDIS mode.  I will confirm this to you.

    One option is to use CDC/RNDIS mode.

    Another option is, use Generic RNDIS mode to transmit, once the transfer is complete, in tx_dma_complete_isr function if you need to send zero length byte, then set TXPKTRDY (bit 1 of TXCSR), without loading any data into TX_FIFO.

    Regards

    Ravi B

  • Ravi,

     

    I have made a quick check if the RNDIS mode is working in the same way as the Generic RNDIS mode we have used so far.

    We had decided to use the Generic RNDIS mode, because this mode and Transparent mode was the only mode used in the linux driver (which is more or less the reference for the musb).

    Fortunately, I could not see any degradation if using the RNDIS mode, and also the zero packet is sent as expected. So most likely we will stay at the RNDIS mode instead of the Generic RNDIS mode. It would be very good if this difference between RNDIS/Generic RNDIS mode is documented in the data sheet. According to this, the only difference between these modes is that for Generic RNDIS mode the last packet can also be a MaxPktSize packet if a buffer is filled with a size as defined in the Generic RNDIS EP Size register. I could not find any hint regarding the handling of zero packets.

    Thanks for your quick help and Best Regards,

    Stefan

  • Stefan

    For the class drivers which mandate the short packet as packet terminating condition then you must use CDC/RNDIS modes. For class drivers like mass storage the CDC/RNDIS mode will not be useful. You need to use transparent or Generinc RNDIS mode.

    Use RNDIS mode for zero length packet transfer when transfer size is multiple of max endpoint size.

    Use CDC mode for zero byte transfer  (1 byte with value 00).

    Use GENERIC RNDIS mode - to recieve the data upto 64K programmed in EPx_size register . Terminates on short packet or received EP_SIZE length of data.

    In all these modes the short packet reception is default terminating condition.

    This has been explained in the respective section of dma modes.

    Regards

    Ravi B