AnsweredAssumed Answered

Packet loss with MPC8347 DR UDC

Question asked by Chan Park on Sep 9, 2014
Latest reply on Oct 14, 2014 by Chan Park

Hi,

 

I have a data corruption (or packet loss) problem with MPC8347 USB Device Controller.

 

I am using our 8347 custom board as USB Device and a laptop as USB Host.

 

My test application sends data from USB Device to USB Host.

 

       MPC8347 (Device) -----> Laptop (Host)

 

It sends 1448 bytes of data to the host in the following structure.

 

unsigned int buf[362];

buf[0] = 1;    // sequence number

buf[1] = 1440; // data length in byte

buf[2] = 0xDEADBEEF;

buf[3] = 0xDEADBEEF;

buf[361] = 0xDEADBEEF;

 

There is 2 ms delay after the write and it sends another 1448 bytes of data in the same structure with sequence number incremented by 1.

The device keeps sending data and the host receives and verifies the data.

It works quiet well for about 10~20 minutes and the problem occurs.

The problem is that the host expects to receive 0xDEADBEEF, but it receives wrong data.  In fact, it receives the sequence number of the next data packet.

It looks like there is packet loss in DR (Dual-Role) UDC.

Would this be a known issue with DR UDC?  Could you confirm that it is caused by USB-A001 in MPC8349E Chip Errata?

 

The MPC8347 board is running Linux 3.2.   My laptop is running Ubuntu 12.04.

 

Here is configuration of DR UDC in my kernel.

  usb@23000 {

     compatible = "fsl-usb2-dr";

     reg = <0x23000 0x1000>; // OK, USB DR starts at 0x23000

     #address-cells = <1>;

     #size-cells = <0>;

     interrupt-parent = <&ipic>;

     interrupts = <38 0x8>; // OK, IRQ ID no = 38 for USB-DR

     dr_mode = "peripheral";

     phy_type = "ulpi";

  };

 

Here is output of lsusb -v on my laptop.  It shows information of MPC8347 Gadget driver.

 

Bus 001 Device 110: ID xxxx:yyyy ABCD

Device Descriptor:

  bLength                18

  bDescriptorType         1

  bcdUSB               2.00

  bDeviceClass            0 (Defined at Interface level)

  bDeviceSubClass         0

  bDeviceProtocol         0

  bMaxPacketSize0        64

  idVendor           0xxxxx ABCD

  idProduct          0xyyyy

  bcdDevice            2.19

  iManufacturer           1 ABCD

  iProduct                2 ABCD

  iSerial                 3 ABCDABCD

  bNumConfigurations      1

  Configuration Descriptor:

    bLength                 9

    bDescriptorType         2

    wTotalLength           32

    bNumInterfaces          1

    bConfigurationValue     1

    iConfiguration          0

    bmAttributes         0xc0

      Self Powered

    MaxPower                2mA

    Interface Descriptor:

      bLength                 9

      bDescriptorType         4

      bInterfaceNumber        0

      bAlternateSetting       0

      bNumEndpoints           2

      bInterfaceClass         7 Printer

      bInterfaceSubClass      1 Printer

      bInterfaceProtocol      2 Bidirectional

      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

      Endpoint Descriptor:

        bLength                 7

        bDescriptorType         5

        bEndpointAddress     0x01  EP 1 OUT

        bmAttributes            2

          Transfer Type            Bulk

          Synch Type               None

          Usage Type               Data

        wMaxPacketSize     0x0200  1x 512 bytes

        bInterval               0

Device Qualifier (for other device speed):

  bLength                10

  bDescriptorType         6

  bcdUSB               2.00

  bDeviceClass            7 Printer

  bDeviceSubClass         0

  bDeviceProtocol         0

  bMaxPacketSize0        64

  bNumConfigurations      1

Device Status:     0x0001

  Self Powered

 

 

Best regards,

Chan

Outcomes