在Ubuntu中连接usb规模,cdc_acm表示未能设置dtr / trs

时间:2017-11-24 21:27:50

标签: ubuntu serial-port usb tty cdc

我正在尝试在Linux(Ubuntu)中连接一个规模(Dibal 400系列),但我无法成功。在安装驱动程序以启用虚拟Com端口后,该规模可在Windows上运行,但是当我在Linux中插入扩展时,它会尝试启动,但过了一段时间后,规模会关闭。

sys日志消息说:

kernel: [ 3202.896355] usb 1-2: new full-speed USB device number 8 using xhci_hcd
kernel: [ 3203.038395] usb 1-2: New USB device found, idVendor=0483, idProduct=5740
kernel: [ 3203.038400] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
kernel: [ 3203.038403] usb 1-2: Product: Dibal G Series
kernel: [ 3203.038405] usb 1-2: Manufacturer: DIBAL S.A
kernel: [ 3203.038407] usb 1-2: SerialNumber: 00000000001A
kernel: [ 3203.039349] cdc_acm 1-2:1.0: ttyACM0: USB ACM device
mtp-probe: checking bus 1, device 8: "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2"
mtp-probe: bus: 1, device: 8 was not an MTP device
kernel: [ 3203.081110] [UFW BLOCK] IN=wlp2s0 OUT= MAC= SRC=fe80:0000:0000:0000:8bb6:c943:d1eb:b07f DST=ff02:0000:0000:0000:0000:0000:0000:0001 LEN=64 TC=0 HOPLIMIT=1 FLOWLBL=400724 PROTO=UDP SPT=8612 DPT=8612 LEN=24 
kernel: [ 3203.081125] [UFW BLOCK] IN=wlp2s0 OUT= MAC= SRC=fe80:0000:0000:0000:8bb6:c943:d1eb:b07f DST=ff02:0000:0000:0000:0000:0000:0000:0001 LEN=64 TC=0 HOPLIMIT=1 FLOWLBL=123875 PROTO=UDP SPT=8612 DPT=8610 LEN=24 
kernel: [ 3203.091404] [UFW BLOCK] IN=wlp2s0 OUT= MAC= SRC=fe80:0000:0000:0000:8bb6:c943:d1eb:b07f DST=ff02:0000:0000:0000:0000:0000:0000:0001 LEN=64 TC=0 HOPLIMIT=1 FLOWLBL=400724 PROTO=UDP SPT=8612 DPT=8612 LEN=24 
kernel: [ 3203.091423] [UFW BLOCK] IN=wlp2s0 OUT= MAC= SRC=fe80:0000:0000:0000:8bb6:c943:d1eb:b07f DST=ff02:0000:0000:0000:0000:0000:0000:0001 LEN=64 TC=0 HOPLIMIT=1 FLOWLBL=123875 PROTO=UDP SPT=8612 DPT=8610 LEN=24 
kernel: [ 3207.543042] usb 1-2: USB disconnect, device number 8
kernel: [ 3207.543169] cdc_acm 1-2:1.0: failed to set dtr/rts
ModemManager[1005]: <warn>  (ttyACM0) could not open serial device (2)
ModemManager[1005]: <warn>  (Plugin Manager) (Nokia) [ttyACM0] error when checking support: '(tty/ttyACM0) failed to open port: Could not open serial device ttyACM0: No such file or directory'
ModemManager[1005]: <warn>  (ttyACM0) could not open serial device (2)
ModemManager[1005]: <warn>  (Plugin Manager) (Iridium) [ttyACM0] error when checking support: '(tty/ttyACM0) failed to open port: Could not open serial device ttyACM0: No such file or directory'
ModemManager[1005]: <warn>  (ttyACM0) could not open serial device (2)
ModemManager[1005]: <warn>  (Plugin Manager) (Cinterion) [ttyACM0] error when checking support: '(tty/ttyACM0) failed to open port: Could not open serial device ttyACM0: No such file or directory'
ModemManager[1005]: <warn>  (ttyACM0) could not open serial device (2)
ModemManager[1005]: <warn>  (Plugin Manager) (Generic) [ttyACM0] error when checking support: '(tty/ttyACM0) failed to open port: Could not open serial device ttyACM0: No such file or directory'
ModemManager[1005]: <info>  Couldn't find support for device at '/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2': not supported by any plugin

作为附加信息,在Windows中它被识别为:

STMicroelectronics虚拟COM端口(COM3) 它有下一个配置: 波特率:9600 奇偶校验:无

当比例开始时(持续运行的3或4秒),我已经测试过了:

udevadm test /sys/devices/pci0000:00/0000:00:14.0/usb1/1-1

ACTION=add
BUSNUM=001
DEVNAME=/dev/bus/usb/001/036
DEVNUM=036
DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-1
DEVTYPE=usb_device
DRIVER=usb
ID_BUS=usb
ID_MODEL=Dibal_G_Series
ID_MODEL_ENC=Dibal\x20G\x20Series
ID_MODEL_FROM_DATABASE=STM32F407
ID_MODEL_ID=5740
ID_REVISION=0200
ID_SERIAL=DIBAL_S.A_Dibal_G_Series_00000000001A
ID_SERIAL_SHORT=00000000001A
ID_USB_INTERFACES=:020201:0a0000:
ID_VENDOR=DIBAL_S.A
ID_VENDOR_ENC=DIBAL\x20S.A
ID_VENDOR_FROM_DATABASE=STMicroelectronics
ID_VENDOR_ID=0483
MAJOR=189
MINOR=35
PRODUCT=483/5740/200
SUBSYSTEM=usb
TYPE=0/0/0
USEC_INITIALIZED=9445077321
Unload module index
Unloaded link configuration context.

有人可以帮助我吗?

非常感谢, 哈维。

1 个答案:

答案 0 :(得分:3)

最后我解决了这个问题:

感谢这个链接:

https://github.com/dhylands/usb-ser-mon/blob/master/mk-udev-rules-stm32.sh

使用它创建一个脚本并执行它。

#!/bin/sh
sudo sh -c 'cat > /etc/udev/rules.d/49-stm32.rules' <<EOF
# 0483:5740 - STM32F4 Dsicovery in USB Serial Mode (CN5)
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740", 
ENV{ID_MM_DEVICE_IGNORE}="1"
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740", 
ENV{MTP_NO_PROBE}="1"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740", 
MODE:="0666"
KERNEL=="ttyACM*", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740", 
MODE:="0666"
# 0483:df11 - STM32F4 Discovery in DFU mode (CN5)
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", 
MODE:="0666"
EOF

sudo udevadm control --reload-rules