Gonzalo Fernandez

i.MX53QSB - probllems with High-Bandwidth USB isochronous transfers.

Discussion created by Gonzalo Fernandez on Aug 9, 2011
Latest reply on Apr 3, 2012 by Gonzalo Fernandez

Hi all,

a newbie here!

I'm trying to implement a USB gadget device with my i.MX53QSB using High-Bandwidth USB isochronous transfers (3 packets/microframe) but, unfortunatelly, with NO success. If I use 1 packet/microframe I have no problem at all, it works flawlesslly. The BSP is L2.6.35_11.01.00 from Freescale.

To change from 1 packet to 3 packets/microframe operation, as far as I know, I only need to change the .wMaxPacketSize field of the endpoint descriptor, so:
- for 1 packet/microframe:  .wMaxPacketSize = cpu_to_le16(0x0000+1024)
- for 3 packets/microframe:  .wMaxPacketSize = cpu_to_le16(0x1000+1024)

Doing this, if I plug the QSB to my host machine (Ubuntu 11.04), I can see the following (lsusb -v):
- for 1 packet/microframe:
      ..... . .
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               1
      ..... . .

- for 3 packet/microframe:
      ..... . .
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x1400  3x 1024 bytes
        bInterval               1
      ..... . .

so this looks OK.

The problem appears in "static int process_ep_req()" (in arcotg_udc.c), where "curr_td->size_ioc_sts" is always set to 0x8408 reporting a "DTD_STATUS_TRANSACTION_ERR" error. This only (and always) happens with 3 packets/microframe, no problem with 1 packet/microframe.

In /proc/driver/fsl_usb2_udc I'm not able to see any problem:

- for 1 packet/microframe:

root@freescale ~$ cat /proc/driver/fsl_usb2_udc
ARC USBOTG Device Controller driver
fsl-usb2-udc version: 1 August 2005
Gadget driver: g_webcam

USBCMD reg:
SetupTW: 0
Run/Stop: Run

USB Status Reg:
Dr Suspend: 0Reset Received: 0System Error: NormalUSB Error Interrupt: No err

USB Intrrupt Enable Reg:
Sleep Enable: 1SOF Received Enable: 0Reset Enable: 1
System Error Enable: 1Port Change Dectected Enable: 1
USB Error Intr Enable: 1USB Intr Enable: 1

USB Frame Index Reg:Frame Number is 0x1b89

USB Device Address Reg:Device Addr is 0x18000000

USB Endpoint List Address Reg:Device Addr is 0xcf3c6000

USB Port Status&Control Reg:
Port Transceiver Type : UTMIPort Speed: High Speed
PHY Low Power Suspend: Low power modePort Reset: Not in ResetPort Suspend Mode: Not in
Over-current Change: NoPort Enable/Disable Change: Not change
Port Enabled/Disabled: EnableCurrent Connect Status: Attached

USB Mode Reg:Controller Mode is : Device Controller

Endpoint Setup Status Reg:SETUP on ep 0x0

EP Ctrl Reg [0x0]: = [0x800080]
EP Ctrl Reg [0x1]: = [0x0]
EP Ctrl Reg [0x2]: = [0x840000]
EP Ctrl Reg [0x3]: = [0x0]
EP Ctrl Reg [0x4]: = [0x0]
EP Ctrl Reg [0x5]: = [0x0]
EP Ctrl Reg [0x6]: = [0x0]
EP Ctrl Reg [0x7]: = [0x0]
EP Prime Reg = [0x0]
For ep0 Maxpkt is 0x40 index is 0x0
req df582b40 actual 0x1a length 0x1a  buf df485500

For ep2in Maxpkt is 0x400 index is 0x2
req df3afe40 actual 0x400 length0x400  buf df53b400
req df3afde0 actual 0x400 length0x400  buf df53b800
req df3afb40 actual 0x400 length0x400  buf df53a000
req df3af540 actual 0x400 length0x400  buf df53b000

- for 3 packet/microframe:

root@freescale ~$ cat /proc/driver/fsl_usb2_udc
ARC USBOTG Device Controller driver
fsl-usb2-udc version: 1 August 2005
Gadget driver: g_webcam

USBCMD reg:
SetupTW: 0
Run/Stop: Run

USB Status Reg:
Dr Suspend: 0Reset Received: 0System Error: NormalUSB Error Interrupt: Err detected

USB Intrrupt Enable Reg:
Sleep Enable: 1SOF Received Enable: 0Reset Enable: 1
System Error Enable: 1Port Change Dectected Enable: 1
USB Error Intr Enable: 1USB Intr Enable: 1

USB Frame Index Reg:Frame Number is 0xb74

USB Device Address Reg:Device Addr is 0x1c000000

USB Endpoint List Address Reg:Device Addr is 0xcf391000

USB Port Status&Control Reg:
Port Transceiver Type : UTMIPort Speed: High Speed
PHY Low Power Suspend: Low power modePort Reset: Not in ResetPort Suspend Mode: Not in
Over-current Change: NoPort Enable/Disable Change: Not change
Port Enabled/Disabled: EnableCurrent Connect Status: Attached

USB Mode Reg:Controller Mode is : Device Controller

Endpoint Setup Status Reg:SETUP on ep 0x0

EP Ctrl Reg [0x0]: = [0x800080]
EP Ctrl Reg [0x1]: = [0x0]
EP Ctrl Reg [0x2]: = [0x840000]
EP Ctrl Reg [0x3]: = [0x0]
EP Ctrl Reg [0x4]: = [0x0]
EP Ctrl Reg [0x5]: = [0x0]
EP Ctrl Reg [0x6]: = [0x0]
EP Ctrl Reg [0x7]: = [0x0]
EP Prime Reg = [0x0]
For ep0 Maxpkt is 0x40 index is 0x0
req df584f60 actual 0x1a length 0x1a  buf df4826c0

For ep2in Maxpkt is 0x400 index is 0x2
req df3faf00 actual 0x400 length0x400  buf df58a000
req df3fac00 actual 0x400 length0x400  buf df58b000
req df3fab40 actual 0x400 length0x400  buf df58b400
req df3fae40 actual 0x400 length0x400  buf df58b800


"mult" (in arcotg_udc.c) is directly related to the number of packets/microframe, but for me it's use looks good.

The only problem I've found is in "fsl_ep_queue()" function; "udc" is declared and then used with no initialization. This issue is solved moving the line "udc = ep->udc;" to the beginning of the function. Unfortunately, this looks no to be related with the issue I'm experiencing.

I don't know how to continue. Please, any advice is welcome.

Gonzalo.

Outcomes