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.

why the bulk-in pipe timeout ?

Other Parts Discussed in Thread: AM3359

hello everyone.

i am debuging the usb host controller with the am3359 based on the example usb_host_msc from the StarterWare02_00_00_07.i have a usb camera connected to the am3359 . And now the host can get the device / interface /endpoint Descriptors,then i want get some data from the camera via bulk-in pipe, so called the function:

USBHCDPipeRead(pCAMDevice->ulIndex,pCAMDevice->ulBulkInPipe, data,length);

i create the function USBHCAMOpen() which look like USBHMSCOpen() and  the parameters pCAMDevice->ulBulkInPipe came from the  function  USBHCDPipeAllocSize();

The data is the buffer pointer and the length is 360960 Byte.

The problem is i always get the PIPE_ERROR after call the USBHCDPipeRead(). And then exit the function from the flowing code.

            if(USB_TIMEOUT_DISABLE!=g_sUSBHCD[ulIndex].USBHTimeOut.Value.slNonEP0)
            {
                if(IsTimerElapsed())
                {
                    ulTimer = 0;
                    g_sUSBHCD[ulIndex].USBINPipes[ulPipeIdx].eState = PIPE_ERROR;
                    g_sUSBHCD[ulIndex].USBHTimeOut.Status.slNonEP0 = (1<<((ulPipeIdx + 1)+16));
                    break;
                }
            }

the usb camera works well connected to my PC(linux-fedora18) under the libusb open source library.

what is wrong with me? or miss someing?

Any help appreciated,

Thanks.

  • Hi,

    I wonder how do you initialize the camera. It will not source any data on it's own.

    Regards,
    Maciej 

  • Thanks for your reply : )

    I have tested the camera with my PC which running Fedora18 and can get the frame data by the open source libusb1.0.16 (download from http://www.libusb.org/).

    I use the same parameters to initialize the camera.

    In fact, the Upper Applactions is the same one, just use the usblib APIs offerd by StarterWare to instead the libusb interfaces.

    Using the modefied code the host  can get the correct Device Descriptor ,Configuration Descriptor, Interface Descrtiptor and Endpoint Descriptor,so the enumeration is ok. And the control transfer is ok. The frame initial parameters transfered via the control transfer.

    By the Way,if changed the length as 1024Byte,not the 360960Byte,the USBHCDPipeRead() will be ok , so ,do the length has some limitations?

  • Hi Blu Zhang,

    From the code snippet  you have posted , it seems that there is a timeout in the device stack occurring during the transfer.  Current timeout value is 7 seconds and I feel that this value should be enough for  the size of data you are transferring. One question that begs to be asked is are you ensuring that the Host ( Linux PC) is sending OUTs all the time (till 360960 bytes) are sent?. Also could you check how many bytes have been transferred before the issue occurs.

    It would be good if you could post the message log from the Linux PC.