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.

TM4C123FE6PM: USB Host TivaWare TM4C123FE6PM

Part Number: TM4C123FE6PM

HI,

i am using the TM4C123FE6PM along with the latest version of TivaWare in a design where it is acting as a USB Host and it is communicating with a device that has a FTDI chip in it.  (Board/product one is TIVA as a USB Host and board/product two is a FTDI USB device).

I have several questions:

1. I am experiencing a lockup issue when i have larger packets of data (900 bytes roughly).  Has this been reported?

2. I also seem to experience this at 460.8k.  Has this been experienced by others

3. Are there examples of DMA with CDC or HID?

Thanks,

Dustin

  • Hello Dustin,

    Yes, that has been reported and there is a solution for it as well: https://e2e.ti.com/support/microcontrollers/tiva_arm/f/908/p/679752/2503431

    The only host examples w/ DMA I know of are from the DK board and use MSC, not CDC or HID. There are HID examples but I don't think any of those use DMA. So I don't believe we have an example that meets that exact criteria, sorry.

  • Ralph,
    Thank you for the prompt reply. When i was searching the forums i did see this issue listed however this is not exactly the same as my problem.
    I should have specified, this is on the receive side of the Host not the transmit as the link provided. What happens is the Host requests data from the device, sends a small request packet, the device responds, if this data is small say one or two of the rings on the ring buffer (62 or maybe 124 bytes) then no issues at 460.8k but larger data (say 900 bytes) causes it to lock and i cannot recover it. No data is received immediately after this fault occurs.
    Dustin
  • Hello Dustin,

    Are you using Full Speed or High Speed USB?
  • Hi Ralph,
    it is configured for Full Speed.

    Dustin
  • Hello Dustin,

    Would you happen to know if the packets are coming in with transactions of 64 bytes or less? By this I mean, does the 900 byte packet for example get sent via multiple transactions with each transaction being 64 bytes or less?

    Also you mentioned the DMA, is the failure occurring when DMA is active, or is it occurring in a situation where the DMA is not being used?

    I ask these questions as there is an issue that occurred before with USB host receiving concerning USB high speed, but I am not sure it has ever occurred for full speed and am trying to gauge if it could be affecting your situation.

  • Hi Ralph,

    The data coming in is sent out by the FTDI chip at a frequency that is dictated by the incoming UART baud rate.  I don't control the timing or the bytes sent. 

    Regarding DMA, this is without DMA which is why i was looking for an example that is closer to our application such as CDC or HID.

    Thanks,
    Dustin 

  • Hello Dustin,

    I see, not positive if this would apply still then but I think it's worth looking into. If TM4C is the host, it should dictate the maximum packet size it can receive, so I feel that this shouldn't occur then, unless it was configured to handle more than 64 bytes at a time...

    Anyways, the issue came up with some of the high speed standards that require packets larger than 64 bytes need to be exchanged, and one of the TivaWare API's coding makes that impossible as it limits packets to 64 bytes max.

    Within the USBHCDPipeRead function, the TivaWare API as downloaded from the web has the following:

            if(bUseDMA == false)
            {
                //
                // Disable uDMA on the endpoint
                //
                MAP_USBEndpointDMADisable(USB0_BASE, ui32Endpoint, USB_EP_HOST_IN);
    
                //
                // Set up for the next transaction.
                //
                g_sUSBHCD.psUSBINPipes[ui32PipeIdx].pui8ReadPtr = pui8Data;
                g_sUSBHCD.psUSBINPipes[ui32PipeIdx].ui32ReadSize =
                            (ui32RemainingBytes < 64) ? ui32RemainingBytes : 64;
            }

    The resolution is to use the following instead:

            //
            // If unable to use DMA then get ready to transfer without DMA.
            //
            if(bUseDMA == false)
            {
                //
                // Disable uDMA on the endpoint
                //
                MAP_USBEndpointDMADisable(USB0_BASE, ui32Endpoint, USB_EP_HOST_IN);
    
                //
                // Set up for the next transaction.
                //
                g_sUSBHCD.psUSBINPipes[ui32PipeIdx].pui8ReadPtr = pui8Data;
                g_sUSBHCD.psUSBINPipes[ui32PipeIdx].ui32ReadSize =
                            (ui32RemainingBytes < g_sUSBHCD.psDMAInstance->pui32MaxPacketSize[ui32PipeIdx]) ? ui32RemainingBytes : g_sUSBHCD.psDMAInstance->pui32MaxPacketSize[ui32PipeIdx];
            }