1. 程式人生 > >cypress虛擬串列埠(CDC_ACM)在Linux下不出現的問題

cypress虛擬串列埠(CDC_ACM)在Linux下不出現的問題

網上找的高人帖子: https://community.cypress.com/thread/14010?start=0&tstart=0

關鍵的yidu一段話:,

I managed to access the serial port in Linux:

- change product id in usb descriptor to 0xF139 :        < 0x39,0xF1,                      /* Product ID */ >

- use modprobe to bind the usbserial driver to the device <sudo modprobe usbserial vendor=0x04B4 product=0xF139

- the device appears now as /dev/ttyUSB0

按照這個操作,有時候會虛出兩個串列埠,有時候會出一個。。。。很神奇

還要cypress的cyusb_linux其他VID,PID 不識別問題,

https://community.cypress.com/docs/DOC-10863

Question: How do you make a device with a custom vendor identification (VID) number / product identification (PID) number visible on the cyusb_linux GUI?

Answer:

By default, the cyusb_linux GUI (Control Center equivalent for Linux) only shows devices with a Cypress® VID (0x04B4) and PIDs contained in the /etc/cyusb.conf file.

If you are using a Cypress VID (0x04B4) and any PID that is not present in the /etc/cyusb.conf file, you will have to add the VID (0x04B4) and the PID to the end of the /etc/cyusb.conf

 file. You will need root permissions to do this. If the cyusb_linux GUI is already open, close it and start it again. The device will now appear in the cyusb_linux GUI.

If you are using a non-Cypress VID, follow the steps below. For this example, the VID is 0x04FF and the PID is 0xFF.

  1.   Add the VID and PID in /etc/cyusb.conf as shown in Figure 1. You will need root permissions.  

       Figure 1. FX3™ Custom VID-PID Added to cyusb.conf File

     

       FX3 custom

  2.   For a non-Cypress VID, you will need to make changes in the /etc/udev/rules.d/88-cyusb.rules file as well. You will need root permissions. Copy lines four and five of the 88-cyusb.rules file and paste it back into the file with ATTR{idVendor}==”04b4” changed to ATTR{idVendor}==””, as shown in Figure 2.  

       Figure 2. ATTR{idVendor}==”04ff” Added in the 88-cyusb.rules File

     

       rules file

  3.   Close and restart the cyusb_linux GUI. The device with a custom VID/PID will now appear in the GUI as shown in Figure 3.  

       Figure 3. Device with VID=0x04ff and PID=0x00ff Now Appears in the cyusb_linux GUI

     

       linux GUI

  4. 還有個奇葩坑,就是如果VID設成cypress的0x04b4,PID只有為0x0008時,才能虛擬出ttyACM0,但cyusb_linux無裝置,採用上述方法,會出現裝置列表,但ttyACM0會消失,必須用modprobe強制生成一個ttyUSB0。如果換為其他PID則ttyACM0消失,裝置列表 出現。如果VID和PID設為非0x04b4,則ttyACM0會出現,再採用上述方法,自定義裝置也會出現在裝置列表中。這個奇葩坑害了我大概一週的時間!!!!