您尚未登录。

楼主 # 2023-09-17 09:33:38

ncer
会员
注册时间: 2021-06-01
已发帖子: 39
积分: 74.5

v3s usb无法识别到ch341/ch342

插入ch341 这种usb转串口,死活没反应,lsusb也看不到设备。但是插入usb网卡就可以正常识别。

我板子上还画了个ch342,以为是画得有问题,但是直接用usb口插了ch341也是没反应,实在不知道问题出在哪儿了,请大家看看


用的主线5.19的内核,USB相关的config设置如下:

CONFIG_USB=y
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
CONFIG_USB_OTG=y
CONFIG_USB_EHCI_HCD=y
# CONFIG_USB_EHCI_TT_NEWSCHED is not set
CONFIG_USB_EHCI_HCD_PLATFORM=y
CONFIG_USB_ACM=y
CONFIG_USB_MUSB_HDRC=y
CONFIG_USB_MUSB_HOST=y
CONFIG_USB_MUSB_SUNXI=y
CONFIG_USB_SERIAL=y
CONFIG_USB_SERIAL_GENERIC=y
CONFIG_USB_SERIAL_CH341=y
CONFIG_NOP_USB_XCEIV=y
CONFIG_USB_GADGET=y
CONFIG_USB_ROLE_SWITCH=y

设备树里otg设置成的是host, ID引脚在板子上没有用到,也没有连接(typeC接口)

&usb_otg {
	dr_mode = "host";
	status = "okay";
};

&usbphy {
	usb0_id_det = <&pio 5 6 GPIO_ACTIVE_HIGH>;
	status = "okay";
};

启动log如下:

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.19.3 (ncer@ncer-CW65S) (arm-buildroot-linux-gnueabihf-gcc.br_real (Buildroot 2022.11.1) 11.3.0, GNU ld (GNU Binutils) 2.38) #6 PREEMPT Sun Sep 17 00:49:59 CST 2023
[    0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=50c53c7d
[    0.000000] CPU: div instructions available: patching division code
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: Lichee Pi Zero with Dock
[    0.000000] Memory policy: Data cache writeback
[    0.000000] cma: dma_contiguous_reserve(limit ffffffff)
[    0.000000] cma: dma_contiguous_reserve: reserving 32 MiB for global area
[    0.000000] cma: cma_declare_contiguous_nid(size 0x02000000, base 0x00000000, limit 0xffffffff alignment 0x00000000)
[    0.000000] cma: Reserved 32 MiB at 0x41c00000
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000040000000-0x0000000043ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000040000000-0x0000000043ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000040000000-0x0000000043ffffff]
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: Using PSCI v0.1 Function IDs from DT
[    0.000000] CPU: All CPU(s) started in HYP mode.
[    0.000000] CPU: Virtualization extensions available.
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line:  console=ttyS0,115200 panic=5 rootwait root=/dev/mmcblk0p2 spidev.bufsiz=65536 earlyprintk rw quiet
[    0.000000] Unknown kernel command line parameters "earlyprintk", will be passed to user space.
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 24048K/65536K available (4096K kernel code, 569K rwdata, 1120K rodata, 1024K init, 216K bss, 8720K reserved, 32768K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000] rcu:     RCU event tracing is enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] GIC: Using split EOI/Deactivate mode
[    0.000000] rcu: srcu_init: Setting srcu_struct sizes based on contention.
[    0.000000] arch_timer: cp15 timer(s) running at 24.00MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[    0.000001] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[    0.000015] Switching to timer-based delay loop, resolution 41ns
[    0.000230] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000491] Console: colour dummy device 80x30
[    0.000542] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[    0.000556] pid_max: default: 32768 minimum: 301
[    0.000720] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.000740] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.001292] CPU: Testing write buffer coherency: ok
[    0.001984] Setting up static identity map for 0x40100000 - 0x40100054
[    0.002094] rcu: Hierarchical SRCU implementation.
[    0.002102] rcu:     Max phase no-delay instances is 1000.
[    0.002631] devtmpfs: initialized
[    0.006110] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[    0.006273] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.006304] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.007800] pinctrl core: initialized pinctrl subsystem
[    0.009081] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.009345] cma: cma_alloc(cma (ptrval), count 64, align 6)
[    0.010285] cma: cma_alloc(): returned (ptrval)
[    0.010569] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.027988] usbcore: registered new interface driver usbfs
[    0.028043] usbcore: registered new interface driver hub
[    0.028102] usbcore: registered new device driver usb
[    0.028328] mc: Linux media interface: v0.10
[    0.028382] videodev: Linux video capture interface: v2.00
[    0.028893] ion_parse_dt_heap_common: id 4 type 4 name cma align 1000
[    0.029805] Bluetooth: Core ver 2.22
[    0.029870] NET: Registered PF_BLUETOOTH protocol family
[    0.029877] Bluetooth: HCI device and connection manager initialized
[    0.029893] Bluetooth: HCI socket layer initialized
[    0.029901] Bluetooth: L2CAP socket layer initialized
[    0.029919] Bluetooth: SCO socket layer initialized
[    0.030666] clocksource: Switched to clocksource arch_sys_counter
[    0.039393] NET: Registered PF_INET protocol family
[    0.039647] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.040614] tcp_listen_portaddr_hash hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.040770] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.040792] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.040811] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.040828] TCP: Hash tables configured (established 1024 bind 1024)
[    0.040948] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.040972] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.041180] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.043279] Initialise system trusted keyrings
[    0.043522] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    0.142929] NET: Registered PF_ALG protocol family
[    0.142961] Key type asymmetric registered
[    0.142967] Asymmetric key parser 'x509' registered
[    0.143108] io scheduler mq-deadline registered
[    0.143117] io scheduler kyber registered
[    0.148451] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[    0.152087] usbcore: registered new interface driver ath9k_htc
[    0.152106] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.152113] ehci-platform: EHCI generic platform driver
[    0.152462] ehci-platform 1c1a000.usb: EHCI Host Controller
[    0.152500] ehci-platform 1c1a000.usb: new USB bus registered, assigned bus number 1
[    0.152534] cma: cma_alloc(cma (ptrval), count 1, align 0)
[    0.152702] cma: cma_alloc(): returned (ptrval)
[    0.152728] cma: cma_alloc(cma (ptrval), count 1, align 0)
[    0.152777] cma: cma_alloc(): returned (ptrval)
[    0.152794] cma: cma_alloc(cma (ptrval), count 1, align 0)
[    0.152838] cma: cma_alloc(): returned (ptrval)
[    0.152919] ehci-platform 1c1a000.usb: irq 24, io mem 0x01c1a000
[    0.153061] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    0.153184] usbcore: registered new interface driver cdc_acm
[    0.153192] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[    0.153289] usbcore: registered new interface driver usbserial_generic
[    0.153320] usbserial: USB Serial support registered for generic
[    0.153351] usbcore: registered new interface driver ch341
[    0.153376] usbserial: USB Serial support registered for ch341-uart
[    0.154381] sun6i-rtc 1c20400.rtc: registered as rtc0
[    0.154437] sun6i-rtc 1c20400.rtc: setting system clock to 1970-01-01T00:06:12 UTC (372)
[    0.154580] sun6i-rtc 1c20400.rtc: RTC enabled
[    0.154783] i2c_dev: i2c /dev entries driver
[    0.155734] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[    0.157010] sun4i-ss 1c15000.crypto: Die ID 7
[    0.157456] sunxi-cedar 1c0e000.video-codec: sunxi cedar version 0.01alpha
[    0.157662] sunxi-cedar 1c0e000.video-codec: cedar-ve the get irq is 26
[    0.158493] NET: Registered PF_PACKET protocol family
[    0.158794] Loading compiled-in X.509 certificates
[    0.170482] sun8i-v3s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[    0.171018] sun8i-v3s-pinctrl 1c20800.pinctrl: supply vcc-pb not found, using dummy regulator
[    0.171803] printk: console [ttyS0] disabled
[    0.192056] ehci-platform 1c1a000.usb: USB 2.0 started, EHCI 1.00
[    0.192247] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.19
[    0.192262] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    0.192273] usb usb1: Product: EHCI Host Controller
[    0.192282] usb usb1: Manufacturer: Linux 5.19.3 ehci_hcd
[    0.192290] usb usb1: SerialNumber: 1c1a000.usb
[    0.192957] hub 1-0:1.0: USB hub found
[    0.193004] hub 1-0:1.0: 1 port detected
[    0.193462] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 93, base_baud = 3750000) is a U6_16550A
[    0.193700] printk: console [ttyS0] enabled
[    0.194307] sun8i-v3s-pinctrl 1c20800.pinctrl: supply vcc-pe not found, using dummy regulator
[    0.215405] 1c28400.serial: ttyS1 at MMIO 0x1c28400 (irq = 94, base_baud = 3750000) is a U6_16550A
[    0.239225] 1c28800.serial: ttyS2 at MMIO 0x1c28800 (irq = 95, base_baud = 3750000) is a U6_16550A
[    0.239864] sun8i-v3s-pinctrl 1c20800.pinctrl: supply vcc-pc not found, using dummy regulator
[    0.240374] mx25l25635e@0 enforce active low on chipselect handle
[    0.242587] usb_phy_generic usb_phy_generic.1.auto: supply vcc not found, using dummy regulator
[    0.242802] usb_phy_generic usb_phy_generic.1.auto: dummy supplies not allowed for exclusive requests
[    0.243424] musb-hdrc musb-hdrc.2.auto: MUSB HDRC host driver
[    0.243474] musb-hdrc musb-hdrc.2.auto: new USB bus registered, assigned bus number 2
[    0.243637] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.19
[    0.243655] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    0.243666] usb usb2: Product: MUSB HDRC host driver
[    0.243675] usb usb2: Manufacturer: Linux 5.19.3 musb-hcd
[    0.243683] usb usb2: SerialNumber: musb-hdrc.2.auto
[    0.244327] hub 2-0:1.0: USB hub found
[    0.244373] hub 2-0:1.0: 1 port detected
[    0.247217] sun8i-v3s-pinctrl 1c20800.pinctrl: supply vcc-pf not found, using dummy regulator
[    0.248505] sun8i-v3s-pinctrl 1c20800.pinctrl: supply vcc-pg not found, using dummy regulator
[    0.249496] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    0.250405] cma: cma_alloc(cma (ptrval), count 1, align 0)
[    0.250536] cma: cma_alloc(cma (ptrval), count 1, align 0)
[    0.250769] cma: cma_alloc(): returned (ptrval)
[    0.251208] cma: cma_alloc(): returned (ptrval)
[    0.253857] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    0.254015] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[    0.254036] cfg80211: failed to load regulatory.db
[    0.276210] sunxi-mmc 1c0f000.mmc: initialized, max. request size: 16384 KB
[    0.276386] sunxi-mmc 1c10000.mmc: initialized, max. request size: 16384 KB
[    0.276571] Waiting for root device /dev/mmcblk0p2...
[    0.320974] mmc0: host does not support reading read-only switch, assuming write-enable
[    0.326797] mmc0: new high speed SD card at address 1388
[    0.327800] mmcblk0: mmc0:1388 CS004 482 MiB
[    0.333482]  mmcblk0: p1 p2
[    0.368681] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Quota mode: disabled.
[    0.368781] VFS: Mounted root (ext4 filesystem) on device 179:2.
[    0.370149] devtmpfs: mounted
[    0.371225] Freeing unused kernel image (initmem) memory: 1024K
[    0.390806] Run /sbin/init as init process
[    0.390818]   with arguments:
[    0.390822]     /sbin/init
[    0.390827]     earlyprintk
[    0.390831]   with environment:
[    0.390835]     HOME=/
[    0.390839]     TERM=linux
[    0.533726] EXT4-fs (mmcblk0p2): re-mounted. Quota mode: disabled.
[    5.860681] random: crng init done

如果插入usb网卡,是有反应的:


[   28.710678] usb 1-1: new high-speed USB device number 2 using ehci-platform
[   28.931602] usb 1-1: New USB device found, idVendor=0cf3, idProduct=9271, bcdDevice= 1.08
[   28.931633] usb 1-1: New USB device strings: Mfr=16, Product=32, SerialNumber=48
[   28.931645] usb 1-1: Product: UB93
[   28.931654] usb 1-1: Manufacturer: ATHEROS
[   28.931662] usb 1-1: SerialNumber: 12345
[   28.932498] usb 1-1: ath9k_htc: Firmware ath9k_htc/htc_9271-1.4.0.fw requested
[   28.934037] usb 1-1: Direct firmware load for ath9k_htc/htc_9271-1.4.0.fw failed with error -2
[   28.934079] usb 1-1: ath9k_htc: Firmware htc_9271.fw requested
[   29.218971] usb 1-1: ath9k_htc: Transferred FW: htc_9271.fw, size: 50980
[   29.219613] cma: cma_alloc(cma 6120d6f6, count 1, align 0)
[   29.219945] cma: cma_alloc(): returned 53a05499
[   29.458233] ath9k_htc 1-1:1.0: ath9k_htc: HTC initialized with 33 credits
[   31.743111] ath9k_htc 1-1:1.0: ath9k_htc: FW Version: 1.3
[   31.743143] ath9k_htc 1-1:1.0: FW RMW support: Off
[   31.743152] ath: EEPROM regdomain: 0x60
[   31.743159] ath: EEPROM indicates we should expect a direct regpair map
[   31.743171] ath: Country alpha2 being used: 00
[   31.743176] ath: Regpair used: 0x60
[   31.747491] ieee80211 phy0: Atheros AR9271 Rev:1
[   39.123046] usb 1-1: USB disconnect, device number 2
[   39.210929] usb 1-1: ath9k_htc: USB layer deinitialized

离线

楼主 #1 2023-09-18 21:04:41

ncer
会员
注册时间: 2021-06-01
已发帖子: 39
积分: 74.5

Re: v3s usb无法识别到ch341/ch342

好吧,原来这俩设备是usb1.1 , 需要在kernel和设备树里打开ohci

离线

#2 2023-09-18 21:45:20

3050311118
会员
注册时间: 2020-09-08
已发帖子: 69
积分: 59

Re: v3s usb无法识别到ch341/ch342

那个uhci ohci xhci之类的驱动选了吗

离线

楼主 #3 2023-09-19 16:02:13

ncer
会员
注册时间: 2021-06-01
已发帖子: 39
积分: 74.5

Re: v3s usb无法识别到ch341/ch342

3050311118 说:

那个uhci ohci xhci之类的驱动选了吗

是的,之前只勾了xhci uhci 死活识别不了,后来加上 ohci 才行

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn