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.

CCS/TM4C1294NCPDT: how to control a slow usb 1.1 device

Part Number: TM4C1294NCPDT
Other Parts Discussed in Thread: EK-TM4C1294XL

Tool/software: Code Composer Studio

HI TI,

I programmed ek-tm4c1294xl as USB host bulk to communicate with an out-aged usb 1.1 device. I borrowed static void * USBHMSCOpen(tUSBHostDevice *psDevice) from usbhmsc.c in /opt/ti/tivaware/usblib/host, to enumerate the endpoints,

                //
                // Allocate the USB Pipe for this Bulk OUT endpoint.
                //
                g_sUSBHMSCDevice.ui32BulkOutPipe =
                    USBHCDPipeAllocSize(0, USBHCD_PIPE_BULK_OUT,
                                        psDevice,
                                        psEndpointDescriptor->wMaxPacketSize,
                                        0);
                //
                // Configure the USB pipe as a Bulk OUT endpoint.
                //
                USBHCDPipeConfig(g_sUSBHMSCDevice.ui32BulkOutPipe,
                                 psEndpointDescriptor->wMaxPacketSize,
                                 0,
                                 (psEndpointDescriptor->bEndpointAddress &
                                  USB_EP_DESC_NUM_M));

The enumerates show as below,


Bulkout bEndpointAddress = 2, wMaxPacketSize = 64
Bulkin bEndpointAddress = 132, wMaxPacketSize = 64
Interrupt bEndpointAddress = 129, wMaxPacketSize = 16

There are 80 bytes to be bulk transfer to the device. However, it seems the device cannot keep up with the ek-tm4c1294xl bulk transfer speed.

My questions come from two-folds,

1. how to configure ek-tm4c1294xl bulk endpoints to a lower speed?

2. since 80 bytes exceeds the bulk buffer size 64, could this possibly causes problem?

Please advise, thanks in advance

Mike

  • Hello Mike,

    For question 1, the TivaWare usblib does not support Low Speed mode for USB. Therefore, you would need to modify the library yourself to use Low Speed mode. That includes modifying the endpoints.

    For question 2, the buffer size could certainly cause an issue. If your buffer can't store all the data, then it risks either overwriting other portions of memory or data being lost. I would not recommend allowing the buffer to be exposed to data overflows like what you described.

    Ultimately, given the age of the device, you're going to have to make quite a few modifications to the usblib to make it work for your application.

  • Thank you Ralph Jacobi,

    problem solved, the 64 bytes buffer actually caused the problem.

    follow www.keil.com/.../

    "You may send any size of buffer, even greater than 64 bytes with single USBHCDPipeWrite() call."

    Mike