LPC17xx作为带有PXA168的CDC设备

时间:2011-08-22 08:34:59

标签: linux usb cdc virtual-serial-port

我使用LPC1768作为连接到运行Linux的PXA168的CDC设备。在LPC方面,我有司机。我还为usb-serial和cdc-acm驱动器启用了PXA linux驱动程序。当我启动电路板时,我得到以下信息: -

[    2.539060] usb 1-1.3: new full speed USB device using pxau2h-ehci and address 4
[    2.581029] usb 1-1.3: New USB device found, idVendor=1fc9, idProduct=2002
[    2.587908] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    2.595241] usb 1-1.3: Product: NXP LPC17xx VCOM
[    2.599996] usb 1-1.3: Manufacturer: NXP SEMICOND
[    2.604786] usb 1-1.3: SerialNumber: DEMO00000000

# cat /proc/bus/usb/devices

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480 MxCh= 1
B:  Alloc=  0/800 us ( 0%), #Int=  1, #Iso=  0
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev= 2.06
S:  Manufacturer=Linux 2.6.34 ehci_hcd
S:  Product=Marvell PXA SOC EHCI Host Controller
S:  SerialNumber=pxau2h-ehci
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480 MxCh= 4
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=05e3 ProdID=0608 Rev=77.64
S:  Product=USB2.0 Hub
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   1 Ivl=256ms

T:  Bus=01 Lev=02 Prnt=02 Port=01 Cnt=01 Dev#=  3 Spd=480 MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=1908 ProdID=0221 Rev= 1.02
S:  Manufacturer=Generic
S:  Product=USB2.0 Device
S:  SerialNumber=20090909180003
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms

**T:  Bus=01 Lev=02 Prnt=02 Port=02 Cnt=02 Dev#=  4 Spd=12  MxCh= 0
D:  Ver= 2.00 Cls=02(comm.) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=1fc9 ProdID=2002 Rev= 1.00
S:  Manufacturer=NXP SEMICOND
S:  Product=NXP LPC17xx VCOM
S:  SerialNumber=DEMO00000000
C:* #Ifs= 2 Cfg#= 1 Atr=80 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=02 Prot=00 Driver=(none)
E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=2ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=(none)
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms**

现在我的LPC没有检测到任何驱动程序。当用于连接具有Windows的PC时,此LPC工作正常但是如果我连接到Linux PC,我也没有运行它。

任何人都可以帮助我理解linux的驱动程序以及用于访问虚拟串行端口的接口。

1 个答案:

答案 0 :(得分:2)

**T:  Bus=01 Lev=02 Prnt=02 Port=02 Cnt=02 Dev#=  4 Spd=12  MxCh= 0
D:  Ver= 2.00 Cls=02(comm.) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=1fc9 ProdID=2002 Rev= 1.00
S:  Manufacturer=NXP SEMICOND
S:  Product=NXP LPC17xx VCOM
S:  SerialNumber=DEMO00000000
C:* #Ifs= 2 Cfg#= 1 Atr=80 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=02 Prot=00 Driver=(none)

您已选择协议“0”(零)。我在Linux中没有成功。在描述符中将协议字段设置为“1”:cdc_acm模块将识别设备并为您提供/ dev / ttyACM *设备作为串行端口。

从usbdesc.c剪掉的代码:

  USB_INTERFACE_DESCRIPTOR_TYPE,     /* bDescriptorType */
  USB_CDC_CIF_NUM,                   /* bInterfaceNumber: Number of Interface */
  0x00,                              /* bAlternateSetting: Alternate setting */
  0x01,                              /* bNumEndpoints: One endpoint used */
  CDC_COMMUNICATION_INTERFACE_CLASS, /* bInterfaceClass: Communication Interface Class */
  CDC_ABSTRACT_CONTROL_MODEL,        /* bInterfaceSubClass: Abstract Control Model */
  0x01,                              /* bInterfaceProtocol: changed to "01" AT-Command */