lpcware

LPC4333 high-speed USB

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by svenb on Thu Oct 23 07:38:21 MST 2014
Hi!

I am using the LPC43xx virtual serial device example (with USB0) from lpcopen. It works fine, but in full-speed mode. As a test, I want to run it in high-speed mode, but can't figure out what to change to make this work.

I made sure the "force fullspeed" bit is not set in the LPC_USB0->PORTSC1_D register. Unless that is the case, I assumed that the chip would always advertise its high-speed capabilities to the host controller by sending a chirp during the first (?) reset -- which I do not see happen on my oscilloscope (the scope is 200 MHz bandwidth though, so not sure if I would see it -- the 480 MHz USB clock is visible though if sent to CLKOUT, so I would expect to see the chirp as well).

In dmesg I see this when I connect the device:
[ 4094.298593] usb 2-1.1: new full-speed USB device number 38 using ehci-pci
[ 4094.386331] cdc_acm 2-1.1:1.0: ttyACM0: USB ACM device


When I also send a "DeviceQualifier" type descriptor, I get this:
[ 3024.839243] usb 2-1.1: new full-speed USB device number 29 using ehci-pci
[ 3024.923152] usb 2-1.1: not running at top speed; connect to a high speed hub
[ 3024.925337] cdc_acm 2-1.1:1.0: ttyACM0: USB ACM device

but the hub is definitely high-speed capable and other devices work in high-speed on the same hub and port.

This is the output of lsusb -v for the device:
Bus 002 Device 038: ID 1fc9:2047 NXP Semiconductors 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            2 Communications
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x1fc9 NXP Semiconductors
  idProduct          0x2047
  bcdDevice            0.01
  iManufacturer           1 NXP
  iProduct                2 xx xx xx xxxxxxxx
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           62
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         2 Communications
      bInterfaceSubClass      2 Abstract (modem)
      bInterfaceProtocol      1 AT-commands (v.25ter)
      iInterface              0
      CDC Header:
        bcdCDC               1.10
      CDC ACM:
        bmCapabilities       0x06
          sends break
          line coding and serial state
      CDC Union:
        bMasterInterface        0
        bSlaveInterface         1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval             255
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval               1
Device Status:     0x0000
  (Bus Powered)


Any ideas what the reason could be that it doesn't use high-speed mode?
I tested setting the wMaxPacketSize to 512 for all endpoints; the example stopped working (not sure why), but the USB connection was still made in full-speed mode.

Especially: Is it even possible that something which is wrong in the descriptors causes the chirp not to happen?

Could this be related to clock setup somehow? For some reason, the example code did not really configure the USB PLL, it just turned it on; I had to configure it for 480 MHz manually.

I did a lot of measurements and fiddling on the chip and it's possible I destroyed something. Could this be a hardware defect of the High-Speed part of the PHY?

Attached is an image of the reset cycle when the device is plugged in. As you can see, there's no chirp.

The electrical layout of the board is custom, so if you think this could be an electrical problem, I'll be happy to provide the relevant information.

Thanks and best regards,
Sven

Outcomes