NXPUSBlib Example Virtual Serial

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

NXPUSBlib Example Virtual Serial

470 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by nsacks on Mon Mar 25 09:17:26 MST 2013
Hello all,

For reference, I am working with LPC4330Xplorer board, trying to access the M4 core. I am also working in Linux.

I have been successful in downloading the Virtual Serial example project, however, when I go to test the echo functionality I am given the following script:
[FONT=Courier New][SIZE=2]
[  183.818893] usb 2-4: >config 1 interface 0 altsetting 0 endpoint 0x81 has an invalid bInterval 255, changing to 11

[  183.818906] usb 2-4: >config 1 interface 1 altsetting 0 bulk endpoint 0x3 has invalid maxpacket 16

[  183.818914] usb 2-4: >config 1 interface 1 altsetting 0 bulk endpoint 0x82 has invalid maxpacket 16

[  184.144427] usb 2-4: >New USB device found, idVendor=1fc9, idProduct=2047

[  184.144438] usb 2-4: >New USB device strings: Mfr=1, Product=2, SerialNumber=0

[  184.144445] usb 2-4: >Product: LPCUSBlib CDC Demo

[  184.144451] usb 2-4: >Manufacturer: NXP

[  184.157154] usb 2-4: >can't set config #1, error -32

mtp-probe: checking bus 2, device 2: "/sys/devices/pci0000:00/0000:00:13.2/usb2/2-4"

mtp-probe: bus: 2, device: 2 was not an MTP device[/SIZE][/FONT][SIZE=2]
[/SIZE]
I was wondering if anyone new a solution to the problem, as I have exhausted all ideas. I have configured all linked projects correctly, but I think there might be a problem with the descriptor file, but I am not sure what to do with it.

Thanks!
0 Kudos
1 Reply

362 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Tsuneo on Sat Mar 30 11:14:22 MST 2013
With quick look on the source code, this example applies the high-speed USB core / port (USB0) on LPC4330


Quote:

[ 183.818893] usb 2-4: >config 1 interface 0 altsetting 0 endpoint 0x81 has an invalid bInterval 255, changing to 11


This problem is fixed by touching to the bInterval field of the interrupt IN endpoint descriptor, so that it fits to high-speed interrupt endpoint.

Descriptors.c

const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
  ...
  .CDC_NotificationEndpoint =
  {
    ...
    .PollingIntervalMS      = 0xFF     // <---- 4 // ( 2^(4-1) = 8 micro-frames = 1ms) : 1-16 for high-speed
  },



Quote:

[ 183.818906] usb 2-4: >config 1 interface 1 altsetting 0 bulk endpoint 0x3 has invalid maxpacket 16
[ 183.818914] usb 2-4: >config 1 interface 1 altsetting 0 bulk endpoint 0x82 has invalid maxpacket 16


These errors are caused by the restriction of high-speed bulk endpoint, whose wMaxPacketSize must be 512

Descriptors.h

/** Size in bytes of the CDC data IN and OUT endpoints. */
#define CDC_TXRX_EPSIZE                16  // <---- 512


I'm not sure there would be any other problem(s), I don't run this example yet
If you see any other problem, post it here.

Tsuneo
0 Kudos