DE1-SoC: udev not creating tty in /dev

I have a Globalsat BU-353-S4 which is identified as a Prolific Technology Inc. USB-Serial Controller D when it is plugged into the usb port. Unfortunately I either cannot find/can’t identify the corresponding device in /dev or it doesn’t exist.

I am left with two choices as far as I see it: Fix the problem or build a new kernel and see if that helps fix the problem. I have posted elsewhere however I haven’t received any feedback; at least this forum is active and seems to be populated with knowledgeable people.

I would be so very grateful if someone can either spot what I am doing incorrectly or what is wrong please.

System Info as follows…

root@DE1_SoC:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.1 LTS
Release:        16.04
Codename:       xenial

root@DE1_SoC:~# uname -a
Linux DE1_SoC 4.5.0-00183-g4647b69-dirty #52 SMP Thu Oct 27 17:10:02 CST 2016 armv7l armv7l armv7l GNU/Linux

When the device is plugged in, dmesg notes the fact as follows:-

root@DE1_SoC:~# dmesg | tail
[31381.055505] usb 1-1.1: new full-speed USB device number 3 using dwc2
[31381.156617] usb 1-1.1: New USB device found, idVendor=067b, idProduct=2303
[31381.156634] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[31381.156643] usb 1-1.1: Product: USB-Serial Controller D
[31381.156651] usb 1-1.1: Manufacturer: Prolific Technology Inc.

and it is visible with lsusb

root@DE1_SoC:~# lsusb
Bus 001 Device 003: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Bus 001 Device 002: ID 0424:2512 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

but there is no corresponding device visible in /dev.

A bit of (rather sad) digging by seeing which files had been created/modified most recently in /dev/ gave me a couple of candidates, notable /dev/char and /dev/bus…

root@DE1_SoC:/~# ls -lasih /dev/char/189*
10408 0 lrwxrwxrwx 1 root root 18 Feb 11  2016 /dev/char/189:0 -> ../bus/usb/001/001
9455 0 lrwxrwxrwx 1 root root 18 Feb 11  2016 /dev/char/189:1 -> ../bus/usb/001/002
22875 0 lrwxrwxrwx 1 root root 18 Mar 24 20:04 /dev/char/189:2 -> ../bus/usb/001/003

which pointed me to /dev/bus/usb/001…

root@DE1_SoC:~# ls -lasih /dev/bus/usb/001
total 0
 1176 0 drwxr-xr-x 2 root root    100 Mar 24 20:04 .
 1175 0 drwxr-xr-x 3 root root     60 Jan  1  1970 ..
 1177 0 crw-rw-r-- 1 root root 189, 0 Feb 11  2016 001
 1255 0 crw-rw-r-- 1 root root 189, 1 Feb 11  2016 002
22870 0 crw-rw-r-- 1 root root 189, 2 Mar 24 20:04 003

and the Prolific controller appears on /dev/bus/usb/001/003…

root@DE1_SoC:/dev/bus/usb/001# udevadm info --attribute-walk --name /dev/bus/usb/001/003

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/platform/soc/ffb40000.usb/usb1/1-1/1-1.1':
    KERNEL=="1-1.1"
    SUBSYSTEM=="usb"
    DRIVER=="usb"
    ATTR{authorized}=="1"
    ATTR{avoid_reset_quirk}=="0"
    ATTR{bConfigurationValue}=="1"
    ATTR{bDeviceClass}=="00"
    ATTR{bDeviceProtocol}=="00"
    ATTR{bDeviceSubClass}=="00"
    ATTR{bMaxPacketSize0}=="64"
    ATTR{bMaxPower}=="100mA"
    ATTR{bNumConfigurations}=="1"
    ATTR{bNumInterfaces}==" 1"
    ATTR{bcdDevice}=="0400"
    ATTR{bmAttributes}=="80"
    ATTR{busnum}=="1"
    ATTR{configuration}==""
    ATTR{devnum}=="3"
    ATTR{devpath}=="1.1"
    ATTR{idProduct}=="2303"
    ATTR{idVendor}=="067b"
    ATTR{ltm_capable}=="no"
    ATTR{manufacturer}=="Prolific Technology Inc. "
    ATTR{maxchild}=="0"
    ATTR{product}=="USB-Serial Controller D"
    ATTR{quirks}=="0x0"
    ATTR{removable}=="fixed"
    ATTR{speed}=="12"
    ATTR{urbnum}=="10"
    ATTR{version}==" 1.10"

  looking at parent device '/devices/platform/soc/ffb40000.usb/usb1/1-1':
    KERNELS=="1-1"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{authorized}=="1"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bDeviceClass}=="09"
    ATTRS{bDeviceProtocol}=="02"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{bMaxPower}=="2mA"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bcdDevice}=="0bb3"
    ATTRS{bmAttributes}=="e0"
    ATTRS{busnum}=="1"
    ATTRS{configuration}==""
    ATTRS{devnum}=="2"
    ATTRS{devpath}=="1"
    ATTRS{idProduct}=="2512"
    ATTRS{idVendor}=="0424"
    ATTRS{ltm_capable}=="no"
    ATTRS{maxchild}=="2"
    ATTRS{quirks}=="0x0"
    ATTRS{removable}=="unknown"
    ATTRS{speed}=="480"
    ATTRS{urbnum}=="29"
    ATTRS{version}==" 2.00"

  looking at parent device '/devices/platform/soc/ffb40000.usb/usb1':
    KERNELS=="usb1"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{authorized}=="1"
    ATTRS{authorized_default}=="1"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bDeviceClass}=="09"
    ATTRS{bDeviceProtocol}=="01"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{bMaxPower}=="0mA"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bcdDevice}=="0405"
    ATTRS{bmAttributes}=="e0"
    ATTRS{busnum}=="1"
    ATTRS{configuration}==""
    ATTRS{devnum}=="1"
    ATTRS{devpath}=="0"
    ATTRS{idProduct}=="0002"
    ATTRS{idVendor}=="1d6b"
    ATTRS{interface_authorized_default}=="1"
    ATTRS{ltm_capable}=="no"
    ATTRS{manufacturer}=="Linux 4.5.0-00183-g4647b69-dirty dwc2_hsotg"
    ATTRS{maxchild}=="1"
    ATTRS{product}=="DWC OTG Controller"
    ATTRS{quirks}=="0x0"
    ATTRS{removable}=="unknown"
    ATTRS{serial}=="ffb40000.usb"
    ATTRS{speed}=="480"
    ATTRS{urbnum}=="31"
    ATTRS{version}==" 2.00"

  looking at parent device '/devices/platform/soc/ffb40000.usb':
    KERNELS=="ffb40000.usb"
    SUBSYSTEMS=="platform"
    DRIVERS=="dwc2"
    ATTRS{driver_override}=="(null)"

  looking at parent device '/devices/platform/soc':
    KERNELS=="soc"
    SUBSYSTEMS=="platform"
    DRIVERS==""
    ATTRS{driver_override}=="(null)"

  looking at parent device '/devices/platform':
    KERNELS=="platform"
    SUBSYSTEMS==""
    DRIVERS==""

A bit more digging…

root@DE1_SoC:~# udevadm info --query=property --name /dev/bus/usb/001/003
BUSNUM=001
DEVNAME=/dev/bus/usb/001/003
DEVNUM=003
DEVPATH=/devices/platform/soc/ffb40000.usb/usb1/1-1/1-1.1
DEVTYPE=usb_device
DRIVER=usb
ID_BUS=usb
ID_MM_DEVICE_MANUAL_SCAN_ONLY=1
ID_MODEL=USB-Serial_Controller_D
ID_MODEL_ENC=USB-Serial\x20Controller\x20D
ID_MODEL_FROM_DATABASE=PL2303 Serial Port
ID_MODEL_ID=2303
ID_REVISION=0400
ID_SERIAL=Prolific_Technology_Inc._USB-Serial_Controller_D
ID_USB_INTERFACES=:ff0000:
ID_VENDOR=Prolific_Technology_Inc.
ID_VENDOR_ENC=Prolific\x20Technology\x20Inc.\x20
ID_VENDOR_FROM_DATABASE=Prolific Technology, Inc.
ID_VENDOR_ID=067b
MAJOR=189
MINOR=2
PRODUCT=67b/2303/400
SUBSYSTEM=usb
TYPE=0/0/0
USEC_INITIALIZED=31381492974

Hoping to be able to read the device…

root@DE1_SoC:~# cat < /dev/bus/usb/001/003
@{#     '2      ÿ
@@root@DE1_SoC:~# PuTTYPuTTYPuTTY^C

Hoping to be able to set the baud rate on the device…

root@DE1_SoC:~# stty -F /dev/bus/usb/001/003 ispeed 4800
stty: /dev/bus/usb/001/003: Operation not permitted

unplugging the device then setting the udev log level…

root@DE1_SoC:~# udevadm control --log-priority=debug

tailing syslog whilst plugging in the device gives:-

root@DE1_SoC:~# tail -f /var/log/syslog
Mar 25 08:38:37 DE1_SoC kernel: [  887.038693] usb 1-1.1: new full-speed USB device number 5 using dwc2
Mar 25 08:38:38 DE1_SoC systemd-udevd[1329]: seq 1227 queued, 'add' 'usb'
Mar 25 08:38:38 DE1_SoC systemd-udevd[1329]: Validate module index
Mar 25 08:38:38 DE1_SoC systemd-udevd[1329]: Check if link configuration needs reloading.
Mar 25 08:38:38 DE1_SoC systemd-udevd[1329]: seq 1227 forked new worker [3424]
Mar 25 08:38:38 DE1_SoC systemd-udevd[1329]: seq 1228 queued, 'add' 'usb'
Mar 25 08:38:38 DE1_SoC systemd-udevd[3424]: seq 1227 running
Mar 25 08:38:38 DE1_SoC kernel: [  887.139852] usb 1-1.1: New USB device found, idVendor=067b, idProduct=2303
Mar 25 08:38:38 DE1_SoC kernel: [  887.139867] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Mar 25 08:38:38 DE1_SoC kernel: [  887.139877] usb 1-1.1: Product: USB-Serial Controller D
Mar 25 08:38:38 DE1_SoC kernel: [  887.139885] usb 1-1.1: Manufacturer: Prolific Technology Inc.
Mar 25 08:38:38 DE1_SoC systemd-udevd[3424]: IMPORT builtin 'usb_id' /lib/udev/rules.d/50-udev-default.rules:13
Mar 25 08:38:38 DE1_SoC systemd-udevd[3424]: IMPORT builtin 'hwdb' /lib/udev/rules.d/50-udev-default.rules:13
Mar 25 08:38:38 DE1_SoC systemd-udevd[3424]: MODE 0664 /lib/udev/rules.d/50-udev-default.rules:41
Mar 25 08:38:38 DE1_SoC systemd-udevd[3424]: PROGRAM 'mtp-probe /sys/devices/platform/soc/ffb40000.usb/usb1/1-1/1-1.1 1 5' /lib/udev/rules.d/69-libmtp.rules:1923
Mar 25 08:38:38 DE1_SoC systemd-udevd[3425]: starting 'mtp-probe /sys/devices/platform/soc/ffb40000.usb/usb1/1-1/1-1.1 1 5'
Mar 25 08:38:38 DE1_SoC mtp-probe: checking bus 1, device 5: "/sys/devices/platform/soc/ffb40000.usb/usb1/1-1/1-1.1"
Mar 25 08:38:38 DE1_SoC mtp-probe: bus: 1, device: 5 was not an MTP device
Mar 25 08:38:38 DE1_SoC systemd-udevd[3424]: 'mtp-probe /sys/devices/platform/soc/ffb40000.usb/usb1/1-1/1-1.1 1 5'(out) '0'
Mar 25 08:38:38 DE1_SoC systemd-udevd[3424]: Process 'mtp-probe /sys/devices/platform/soc/ffb40000.usb/usb1/1-1/1-1.1 1 5' succeeded.
Mar 25 08:38:38 DE1_SoC systemd-udevd[3424]: handling device node '/dev/bus/usb/001/005', devnum=c189:4, mode=0664, uid=0, gid=0
Mar 25 08:38:38 DE1_SoC systemd-udevd[3424]: set permissions /dev/bus/usb/001/005, 020664, uid=0, gid=0
Mar 25 08:38:38 DE1_SoC systemd-udevd[3424]: creating symlink '/dev/char/189:4' to '../bus/usb/001/005'
Mar 25 08:38:38 DE1_SoC systemd-udevd[3424]: created db file '/run/udev/data/c189:4' for '/devices/platform/soc/ffb40000.usb/usb1/1-1/1-1.1'
Mar 25 08:38:38 DE1_SoC systemd-udevd[3424]: passed device to netlink monitor 0x7f643a78
Mar 25 08:38:38 DE1_SoC systemd-udevd[3424]: seq 1227 processed
Mar 25 08:38:38 DE1_SoC systemd-udevd[1329]: passed 303 byte device to netlink monitor 0x7f663890
Mar 25 08:38:38 DE1_SoC systemd-udevd[3424]: seq 1228 running
Mar 25 08:38:38 DE1_SoC systemd-udevd[3424]: RUN 'usb_modeswitch --driver-bind %p %s{idVendor} %s{idProduct} %E{PRODUCT}' /lib/udev/rules.d/40-usb_modeswitch.rules:16
Mar 25 08:38:38 DE1_SoC systemd-udevd[3424]: IMPORT builtin 'hwdb' /lib/udev/rules.d/50-udev-default.rules:15
Mar 25 08:38:38 DE1_SoC systemd-udevd[3424]: IMPORT builtin 'usb_id' /lib/udev/rules.d/60-libgphoto2-6.rules:9
Mar 25 08:38:38 DE1_SoC systemd-udevd[3424]: unable to access usb_interface device of '/sys/devices/platform/soc/ffb40000.usb/usb1/1-1/1-1.1/1-1.1:1.0'
Mar 25 08:38:38 DE1_SoC systemd-udevd[3424]: IMPORT builtin 'usb_id' returned non-zero
Mar 25 08:38:38 DE1_SoC systemd-udevd[3424]: RUN 'kmod load $env{MODALIAS}' /lib/udev/rules.d/80-drivers.rules:5
Mar 25 08:38:38 DE1_SoC systemd-udevd[3424]: created db file '/run/udev/data/+usb:1-1.1:1.0' for '/devices/platform/soc/ffb40000.usb/usb1/1-1/1-1.1/1-1.1:1.0'
Mar 25 08:38:38 DE1_SoC systemd-udevd[3428]: starting 'usb_modeswitch --driver-bind /devices/platform/soc/ffb40000.usb/usb1/1-1/1-1.1/1-1.1:1.0   67b/2303/400'
Mar 25 08:38:39 DE1_SoC systemd-udevd[3424]: Process 'usb_modeswitch --driver-bind /devices/platform/soc/ffb40000.usb/usb1/1-1/1-1.1/1-1.1:1.0   67b/2303/400' succeeded.
Mar 25 08:38:39 DE1_SoC systemd-udevd[3424]: Execute 'load' 'usb:v067Bp2303d0400dc00dsc00dp00icFFisc00ip00in00'
Mar 25 08:38:39 DE1_SoC systemd-udevd[3424]: No module matches 'usb:v067Bp2303d0400dc00dsc00dp00icFFisc00ip00in00'
Mar 25 08:38:39 DE1_SoC systemd-udevd[3424]: passed device to netlink monitor 0x7f643a78
Mar 25 08:38:39 DE1_SoC systemd-udevd[3424]: seq 1228 processed
Mar 25 08:38:39 DE1_SoC systemd-udevd[1329]: cleanup idle workers
Mar 25 08:38:39 DE1_SoC systemd-udevd[3424]: Unload module index
Mar 25 08:38:39 DE1_SoC systemd-udevd[3424]: Unloaded link configuration context.
Mar 25 08:38:39 DE1_SoC systemd-udevd[1329]: worker [3424] exited

It seems to be using the default rules in /lib/udev/rules.d/50-udev-default.rules, I don’t see a mention of the rule I (just) added in 40-usb_modeswitch.rules…

root@DE1_SoC:~# grep 2303 /lib/udev/rules.d/*
/lib/udev/rules.d/40-usb_modeswitch.rules:# PWI 20170325 Prolific Technology, Inc. PL2303 Serial Port
/lib/udev/rules.d/40-usb_modeswitch.rules:ATTR{idVendor}=="067B", ATTR{idProduct}=="2303", RUN+="usb_modeswitch '%b/%k'"
/lib/udev/rules.d/77-mm-usb-serial-adapters-greylist.rules:ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", ENV{ID_MM_DEVICE_MANUAL_SCAN_ONLY}="1"

That is as far as I have got, it looks like the kernel can see the device, udev is mapping it to /dev/ but there is no tty that I can see that I can use.

Thank you very much for looking and if you have an idea of what to do, I am all ears and grateful.