Article 5A6KK Problem with CP210x kernel module

Problem with CP210x kernel module

by
jtliu
from LinuxQuestions.org on (#5A6KK)
I have a Raspberry Pi 4 model B 4GB. I have installed Linux raspberrypi 5.4.72-v7l+ and everything works fine.

I try to use the cp210x.ko kernel-module come with the kernel to connect a temperature monitor device through a virtual Serial-over-USB port created by the cp210x driver.

The kernel modules, usbserial.ko and cp210x.ko come with the raspberrypi 5.4.72-v7l+ can be loaded without problem:

Code:pi@raspberrypi:~ $ lsmod

Module Size Used by
cmac 16384 1
rfcomm 49152 4
.......
cp210x 24576 0
usbserial 36864 1 cp210x
.......And run the "dmesg" command and got the following (Everything seems OK):

Code:pi@raspberrypi:~ $ dmesg | grep cp210x
........
[ 2.749477] usbcore: registered new interface driver usbserial_generic
[ 2.749553] usbserial: USB Serial support registered for generic
[ 2.754191] usbcore: registered new interface driver cp210x
[ 2.754266] usbserial: USB Serial support registered for cp210x
........The problem here is, I can not found a way to get the corresponding device file, or node.

There is no device file created in the /dev/ directory after load the kernel module(a /dev/tty.SLAB_USBtoUART or similar device file should be created when I plug in the device into an USB port. Or if the major and minor number can be found in the /proc/devices file, one can use mknod XXX c majorNum minorNum to create a node).

I searched the internet, one suggestion is to use the following command to create a "new_id" file in the driver's directory with the vendor ID and product ID:

Code:sudo sh -c 'echo 10c4 ea60 > /sys/bus/usb/drivers/cp210x/new_id'But, when I run this commad, i got the flowing error:

Code:sh: 1: cannot create /sys/bus/usb/drivers/cp210x/new_id: Permission deniedIt seems that in the /sys/bus/usb/drivers/ directory, all folders are all 0 sized folders. How can one create a file in a 0 sized directory?

Code:pi@raspberrypi:~ $ ls -l /sys/bus/usb/drivers/
total 0
drwxr-xr-x 2 root root 0 Nov 7 20:11 brcmfmac
drwxr-xr-x 2 root root 0 Nov 7 20:11 cp210x
drwxr-xr-x 2 root root 0 Nov 7 20:11 hub
drwxr-xr-x 2 root root 0 Nov 7 20:11 lan78xx
drwxr-xr-x 2 root root 0 Nov 7 20:11 r8152
drwxr-xr-x 2 root root 0 Nov 7 20:11 smsc95xx
drwxr-xr-x 2 root root 0 Nov 7 20:11 uas
drwxr-xr-x 2 root root 0 Nov 7 20:11 usb
drwxr-xr-x 2 root root 0 Nov 7 20:11 usbfs
drwxr-xr-x 2 root root 0 Nov 7 20:11 usbhid
drwxr-xr-x 2 root root 0 Nov 7 20:11 usbserial_generic
drwxr-xr-x 2 root root 0 Nov 7 20:11 usb-storageFollowing is the contents of the /proc/devices file ( this device seems not in /proc/devices, so there is no way to use the "mknod" command to create a device file in /dev/ directory ??):

Code:pi@raspberrypi:~ $ cat /proc/devices
Character devices:
1 mem
4 /dev/vc/0
4 tty
4 ttyS
5 /dev/tty
5 /dev/console
5 /dev/ptmx
5 ttyprintk
7 vcs
10 misc
13 input
14 sound
29 fb
81 video4linux
89 i2c
116 alsa
128 ptm
136 pts
153 spi
162 raw
180 usb
188 ttyUSB
189 usb_device
204 ttyAMA
216 rfcomm
226 drm
235 cec
236 media
237 rpivid-vp9mem
238 rpivid-h264mem
239 rpivid-intcmem
240 rpivid-hevcmem
241 uio
242 vcsm
243 vchiq
244 hidraw
245 rpmb
246 bcm2835-gpiomem
247 vcio
248 vc-mem
249 bsg
250 watchdog
251 BaseRemoteCtl
252 rtc
253 dma_heap
254 gpiochip

Block devices:Can anyone help to figure out where might be the problem?
Any helps are highly appreciated!latest?d=yIl2AUoC8zA latest?i=GABlcNxOjr4:9IIwezdC9yw:F7zBnMy latest?i=GABlcNxOjr4:9IIwezdC9yw:V_sGLiP latest?d=qj6IDK7rITs latest?i=GABlcNxOjr4:9IIwezdC9yw:gIN9vFwGABlcNxOjr4
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments