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.

Linux/AM5728: USB DMA buffer size

Part Number: AM5728

Tool/software: Linux

Hi, TI and evryone,

I test USB camera using the USB3.0 port of TI AM5728 EVM.

Sometimes the data reception from USB camera fail, and I think that perhaps the DMA buffer size for bulk transmission is too insufficient.

Please tell me how set the USB DMA buffer size of AM5728.

Thank you.

Best Regards.

aither

  • Hi Aither,

    The xHCI controller on AM5728 doesn't require any specific size of DMA buffers, it can handle any DMA-capable buffer. The issue you have sounds like something else.
  • Hi, Bin
    First, thanks you for your quick response.

    This USB 3.0 camera works well at Windows 10 and Ubuntu16.04, but do not works well at AM5728.
    This USB3.0 camera works well normally at AM5728 EVM, and my app gets the last image from the camera. But sometimes my app has a heavy workload, then UART terminal displays "xhci-hcd xhci-hcd.1.auto: WARN Event TRB for slot 4 ep 2 with no TDs queued?" and my app could not get the image from the camera.
    1. How can I solve this problem?
    2. Why the above message from TX event handler(I have found this message linux-4.9.69/src/drivers/usb/host/xhci-ring.c handle_tx_event() function) is outputted?
    Please lead me to solve.

    Thanks you again.
    Best Regards.
    aither
  • Aither,

    What Processor SDK version do you use?

    Please provide the descriptors of the camera. You can get it by plug it to Ubuntu PC and run the following command on the PC.
    $ lsusb -v -d <vid:pid>

    When you say your app has a heavy load, do you mean your app itself or your Linux system on AM5728?
    What is the app? A program you developed or you get from Linux community?
  • Hi, Bin,
    Thanks for your kind response.
    Now I use ti-processor-sdk-linux-am57xx-evm-04.03.00.05 and AM5728 EVM. The camera descriptor is below:
    root@ubuntu:/home/aither# lsusb -v -d 2676:

    Bus 001 Device 002: ID 2676:ba03 Basler AG
    Device Descriptor:
    bLength 18
    bDescriptorType 1
    bcdUSB 2.10
    bDeviceClass 239 Miscellaneous Device
    bDeviceSubClass 2 ?
    bDeviceProtocol 1 Interface Association
    bMaxPacketSize0 64
    idVendor 0x2676 Basler AG
    idProduct 0xba03
    bcdDevice 0.00
    iManufacturer 1 Basler
    iProduct 2 daA1920-15um
    iSerial 3 22410409
    bNumConfigurations 1
    Configuration Descriptor:
    bLength 9
    bDescriptorType 2
    wTotalLength 76
    bNumInterfaces 2
    bConfigurationValue 1
    iConfiguration 0
    bmAttributes 0x80
    (Bus Powered)
    MaxPower 400mA
    Interface Association:
    bLength 8
    bDescriptorType 11
    bFirstInterface 0
    bInterfaceCount 2
    bFunctionClass 239 Miscellaneous Device
    bFunctionSubClass 5 USB3 Vision
    bFunctionProtocol 0
    iFunction 5 USB3 Vision Device
    Interface Descriptor:
    bLength 9
    bDescriptorType 4
    bInterfaceNumber 0
    bAlternateSetting 0
    bNumEndpoints 2
    bInterfaceClass 239 Miscellaneous Device
    bInterfaceSubClass 5 USB3 Vision
    bInterfaceProtocol 0
    iInterface 0
    ** UNRECOGNIZED: 14 24 01 00 00 01 00 00 00 01 00 04 01 02 00 06 07 03 08 0c
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x04 EP 4 OUT
    bmAttributes 2
    Transfer Type Bulk
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0200 1x 512 bytes
    bInterval 0
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x84 EP 4 IN
    bmAttributes 2
    Transfer Type Bulk
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0200 1x 512 bytes
    bInterval 0
    Interface Descriptor:
    bLength 9
    bDescriptorType 4
    bInterfaceNumber 1
    bAlternateSetting 0
    bNumEndpoints 1
    bInterfaceClass 239 Miscellaneous Device
    bInterfaceSubClass 5 USB3 Vision
    bInterfaceProtocol 2
    iInterface 0
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x81 EP 1 IN
    bmAttributes 2
    Transfer Type Bulk
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0200 1x 512 bytes
    bInterval 0
    Binary Object Store Descriptor:
    bLength 5
    bDescriptorType 15
    wTotalLength 22
    bNumDeviceCaps 2
    USB 2.0 Extension Device Capability:
    bLength 7
    bDescriptorType 16
    bDevCapabilityType 2
    bmAttributes 0x00000006
    Link Power Management (LPM) Supported
    SuperSpeed USB Device Capability:
    bLength 10
    bDescriptorType 16
    bDevCapabilityType 3
    bmAttributes 0x00
    wSpeedsSupported 0x000c
    Device can operate at High Speed (480Mbps)
    Device can operate at SuperSpeed (5Gbps)
    bFunctionalitySupport 3
    Lowest fully-functional device speed is SuperSpeed (5Gbps)
    bU1DevExitLat 10 micro seconds
    bU2DevExitLat 2047 micro seconds
    Device Status: 0x0000
    (Bus Powered)
    root@ubuntu:/home/aither#

    My "workload" is my app's load, and my app is image processing app that I have developed.
    When image variation is too much, my image processing engine will have heavy load.
    Please help me and lead me to solve...

    Best Regards.
    Thank again.
    Aither
  • Aither,

    It appears that the camera was attached to the USB2.0 port on the PC, not USB3.0. Is the camera enumerated as super-speed on your am57x board instead? If so, please provide the descriptors when the camera is enumerated as super-speed.

    Regarding the issue, please first debug your app to ensure it is still capable to request video frames on time when it is heavily loaded, so that the camera can deliver video data on the rate of negotiated FPS and doesn't drop video data.
  • Hi, Bin

    First, thanks for your response.

    1. The camera connects as USB3.0:

    [ 215.250137] usb 2-1.3: new SuperSpeed USB device number 3 using xhci-hcd

    2. My test program is very simple from Basler SDK Samples, and when I have tested at TI PSDK 5.0, no problem appeared. So I think that perhaps USB3.0 driver module. Can you resolve my issue for TI PSDK 4.3?

    Best Regards.

    Thanks you again.

    Aither.

  • Aither,

    p aither said:
    [ 215.250137] usb 2-1.3: new SuperSpeed USB device number 3 using xhci-hcd

    This is strange. The descriptors you posted above shows "bcdUSB 2.10" and EP max packet size is 512 bytes, which are for high-speed, not super-speed.

    p aither said:
    2. My test program is very simple from Basler SDK Samples, and when I have tested at TI PSDK 5.0, no problem appeared. So I think that perhaps USB3.0 driver module. Can you resolve my issue for TI PSDK 4.3?

    If PLSDK 5.0 doesn't have the issue, it is likely a problem in the kernel driver, but I don't have enough information to understand the root cause of the issue and to solve it. You would first have to debug the kernel to show how the driver triggers the issue.

    But since the problem doesn't happen in PLSDK 5.0, I would highly recommend you migrate to the latest SDK.