Hi, I am working with TMS320C5535 eZdsp USB Kit, I tried debugging Connected Audio framework example successfully. But now I am adapting it as a webcam device conforming to USB Video Class (UVC) specs, everything is good so far, the board is recognized as USB Video Device except that when I connect to the board to start streaming function (the host UVC driver on Windows will send packet to set the interface to alternative interface number 1), the host keeps saying that "Cannot connect device. The device may already be in use" - certainly there is none using this device.
I tried to debug and use USB Monitor to track the packets going from/to the USB port, what I have found so far is weird:
- By the time I connect to the device, inside function MUSB_Handle_EP0_Intr (app_usb.c), case CSL_USB_SET_INTERFACE: when it runs through this line
usbRegisters->PERI_CSR0_INDX |= CSL_USB_PERI_CSR0_INDX_SERV_RXPKTRDY_MASK, USB Monitor shows that the host return error USBD_STATUS_BUFFER_UNDERRUN (0xc000000d). I got no clue how this might happen and how to fix it. I guess this is the reason I cannot connect to the board as a Webcam device.
- Also, before that instrument, usbRegisters->PERI_CSR0_INDX = 0x0001, after bit OR with CSL_USB_PERI_CSR0_INDX_SERV_RXPKTRDY_MASK (0x0040u), it becomes 0x0011. How this could happen?
- The Status returned in Hdr is USB_STATUS_INVALID_PARAMETER (0x80000300), and the field InterfaceHandle in URB_FUNCTION_SELECT_INTERFACE request = 0xffffffffffffffff, while it should be something else like 0xffffffffc9262d00...
I got stuck at this point for several days without any progress, so I appreciate any help or suggestion for this. Thank you very much.
Hi, it turns out that is the problem of speed mode. After modifying the MaxPacketSize of Isochronous Endpoint 1 OUT from 0x400 (1024) - Hi-speed down to 0x0064 (100) - Full-speed then it passes the SELECT_INTERFACE request. Now remain the question why the device cannot work with USB 2.0 Hi-speed?
There are some facts that we need to be clear:
1. My computer clearly supports USB 2.0, and so does the port I am using, since I plugged another webcam USB 2.0 into the port and it works properly with MaxPacketSize = 1024
2. When I start the device, there is a message in Windows 7 saying that "This device can perform faster if you connect it to a hi-speed usb 2.0". It looks like my computer does not support USB 2.0, but as 1. pointed out it surely is.
All in all, how to make it work in Hi-speed mode? Since I am turning TMS320C5535 into something like a webcam so full-speed mode is just too slow for me.
Thank you!
Hi, any idea?
It is already solved, please check this article http://e2e.ti.com/support/dsp/tms320c5000_power-efficient_dsps/f/109/t/184302.aspx