CH334 嵌入式Linux 驱动问题

尊敬的技术支持:

    您好!

    最近在使用贵司的CH334R,但在嵌入式 linux中无法正确枚举CH334及其级联的设备,请问使用CH334R是需要在内核中开启额外的驱动吗? 还是有其他原因呢?

    以下是我的原理图:

    image.png

已解决, 是因为晶振匹配电容不对, 导致晶振不起振


又来新问题啦, CH334R是否需要额外的linux驱动呢? 


您好,CH334不需要额外的Linux驱动的。直接使用系统自带的通用hub驱动即可。若您这边有技术问题,可以直接描述下当前遇到的问题。


在linux 内核初始化阶段 约50%的概率 会报device descriptor read/64, error -110


在linux 内核初始化阶段 约50%的概率 会报

device descriptor read/64, error -110

我通过CH334外接了2个USB设备, 有时候两个都初始化成功, 有时候丢一个,有时候丢两个.

如何解决上述问题呢?


下面是所有boot部分的log

[    0.000000] Booting Linux on physical CPU 0x0

[    0.000000] Linux version 6.0.1+ (fuxiaoer@DESKTOP-ICQ2N2B) (arm-none-linux-gnueabihf-gcc (Arm GNU Toolchain 12.2.Rel1 (Build arm-12.24)) 12.2.1 20221205, GNU ld (Arm GNU Toolchain 12.2.Rel1 (Build arm-12.24)) 2.39.0.20221210) #38 SMP Mon Mar 13 18:00:25 CST 2023

[    0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d

[    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: MangoPi MQ-Dual

[    0.000000] Memory policy: Data cache writealloc

[    0.000000] cma: Reserved 16 MiB at 0x47000000

[    0.000000] Zone ranges:

[    0.000000]   Normal   [mem 0x0000000040000000-0x0000000047ffffff]

[    0.000000]   HighMem  empty

[    0.000000] Movable zone start for each node

[    0.000000] Early memory node ranges

[    0.000000]   node   0: [mem 0x0000000040000000-0x0000000047ffffff]

[    0.000000] Initmem setup node 0 [mem 0x0000000040000000-0x0000000047ffffff]

[    0.000000] percpu: Embedded 11 pages/cpu s15508 r8192 d21356 u45056

[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 32512

[    0.000000] Kernel command line: mem=128M root=/dev/mmcblk0p2 rootfstype=ext4 init=/sbin/init rw rootwait console=ttyS4,115200

[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes, linear)

[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes, linear)

[    0.000000] mem auto-init: stack:all(zero), heap alloc:off, heap free:off

[    0.000000] Memory: 99812K/131072K available (8192K kernel code, 949K rwdata, 2144K rodata, 1024K init, 269K bss, 14876K reserved, 16384K cma-reserved, 0K highmem)

[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1

[    0.000000] rcu: Hierarchical RCU implementation.

[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=2.

[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.

[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2

[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16

[    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.000012] Switching to timer-based delay loop, resolution 41ns

[    0.000187] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns

[    0.000668] Console: colour dummy device 80x30

[    0.000709] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)

[    0.000724] pid_max: default: 32768 minimum: 301

[    0.000874] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)

[    0.000889] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)

[    0.001434] CPU: Testing write buffer coherency: ok

[    0.001733] /cpus/cpu@0 missing clock-frequency property

[    0.001764] /cpus/cpu@1 missing clock-frequency property

[    0.001773] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000

[    0.002517] Setting up static identity map for 0x40100000 - 0x40100060

[    0.002658] rcu: Hierarchical SRCU implementation.

[    0.002664] rcu:     Max phase no-delay instances is 1000.

[    0.003185] smp: Bringing up secondary CPUs ...

[    0.003860] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001

[    0.003981] smp: Brought up 1 node, 2 CPUs

[    0.003991] SMP: Total of 2 processors activated (96.00 BogoMIPS).

[    0.003999] CPU: All CPU(s) started in SVC mode.

[    0.004505] devtmpfs: initialized

[    0.008558] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5

[    0.008759] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns

[    0.008781] futex hash table entries: 512 (order: 3, 32768 bytes, linear)

[    0.009349] pinctrl core: initialized pinctrl subsystem

[    0.010730] NET: Registered PF_NETLINK/PF_ROUTE protocol family

[    0.011768] DMA: preallocated 256 KiB pool for atomic coherent allocations

[    0.012614] thermal_sys: Registered thermal governor 'step_wise'

[    0.012846] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.

[    0.012858] hw-breakpoint: maximum watchpoint size is 8 bytes.

[    0.021416] platform 5460000.tcon-top: Fixing up cyclic dependency with 5200000.mixer

[    0.021490] platform 5460000.tcon-top: Fixing up cyclic dependency with 5100000.mixer

[    0.021765] platform 5461000.lcd-controller: Fixing up cyclic dependency with 5460000.tcon-top

[    0.022121] platform 5470000.lcd-controller: Fixing up cyclic dependency with 5604000.tv-encoder

[    0.022182] platform 5470000.lcd-controller: Fixing up cyclic dependency with 5460000.tcon-top

[    0.023169] platform 7090000.rtc: Fixing up cyclic dependency with 7010000.clock-controller

[    0.032855] SCSI subsystem initialized

[    0.033313] usbcore: registered new interface driver usbfs

[    0.033365] usbcore: registered new interface driver hub

[    0.033404] usbcore: registered new device driver usb

[    0.033593] mc: Linux media interface: v0.10

[    0.033635] videodev: Linux video capture interface: v2.00

[    0.033707] pps_core: LinuxPPS API ver. 1 registered

[    0.033713] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <个人信息保护,已隐藏>

[    0.033729] PTP clock support registered

[    0.035078] clocksource: Switched to clocksource arch_sys_counter

[    0.042556] NET: Registered PF_INET protocol family

[    0.042745] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)

[    0.043279] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)

[    0.043304] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)

[    0.043314] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)

[    0.043331] TCP bind hash table entries: 1024 (order: 1, 8192 bytes, linear)

[    0.043350] TCP: Hash tables configured (established 1024 bind 1024)

[    0.043428] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)

[    0.043459] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)

[    0.043619] NET: Registered PF_UNIX/PF_LOCAL protocol family

[    0.044274] RPC: Registered named UNIX socket transport module.

[    0.044288] RPC: Registered udp transport module.

[    0.044291] RPC: Registered tcp transport module.

[    0.044294] RPC: Registered tcp NFSv4.1 backchannel transport module.

[    0.046218] Initialise system trusted keyrings

[    0.046542] workingset: timestamp_bits=30 max_order=15 bucket_order=0

[    0.051547] NFS: Registering the id_resolver key type

[    0.051602] Key type id_resolver registered

[    0.051608] Key type id_legacy registered

[    0.051668] NET: Registered PF_ALG protocol family

[    0.051676] Key type asymmetric registered

[    0.051680] Asymmetric key parser 'x509' registered

[    0.051810] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 246)

[    0.051819] io scheduler mq-deadline registered

[    0.051824] io scheduler kyber registered

[    0.067285] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled

[    0.076592] CAN device driver interface

[    0.077263] PPP generic driver version 2.4.2

[    0.077532] PPP BSD Compression module registered

[    0.077541] PPP Deflate Compression module registered

[    0.077768] PPP MPPE Compression module registered

[    0.077776] NET: Registered PF_PPPOX protocol family

[    0.077868] usbcore: registered new interface driver cdc_ether

[    0.077908] usbcore: registered new interface driver cdc_eem

[    0.077970] usbcore: registered new interface driver cdc_ncm

[    0.077997] usbcore: registered new interface driver r8153_ecm

[    0.078226] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver

[    0.078236] ehci-platform: EHCI generic platform driver

[    0.078420] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver

[    0.078442] ohci-platform: OHCI generic platform driver

[    0.078605] usbcore: registered new interface driver cdc_acm

[    0.078612] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters

[    0.078638] usbcore: registered new interface driver cdc_wdm

[    0.078675] usbcore: registered new interface driver usb-storage

[    0.078761] usbcore: registered new interface driver ch341

[    0.078787] usbserial: USB Serial support registered for ch341-uart

[    0.081006] sun6i-rtc 7090000.rtc: registered as rtc0

[    0.081127] sun6i-rtc 7090000.rtc: setting system clock to 1970-01-02T00:00:01 UTC (86401)

[    0.081256] sun6i-rtc 7090000.rtc: RTC enabled

[    0.081567] i2c_dev: i2c /dev entries driver

[    0.083180] sunxi-wdt 20500a0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)

[    0.084251] sun8i-ce 3040000.crypto: Set mod clock to 300000000 (300 Mhz) from 400000000 (400 Mhz)

[    0.084561] sun8i-ce 3040000.crypto: will run requests pump with realtime priority

[    0.084898] sun8i-ce 3040000.crypto: will run requests pump with realtime priority

[    0.085146] sun8i-ce 3040000.crypto: will run requests pump with realtime priority

[    0.085334] sun8i-ce 3040000.crypto: will run requests pump with realtime priority

[    0.085473] sun8i-ce 3040000.crypto: Register cbc(aes)

[    0.085498] sun8i-ce 3040000.crypto: Register ecb(aes)

[    0.085509] sun8i-ce 3040000.crypto: Register cbc(des3_ede)

[    0.085529] sun8i-ce 3040000.crypto: Register ecb(des3_ede)

[    0.085561] sun8i-ce 3040000.crypto: CryptoEngine Die ID 0

[    0.086438] usbcore: registered new interface driver usbhid

[    0.086447] usbhid: USB HID core driver

[    0.087378] NET: Registered PF_PACKET protocol family

[    0.087407] can: controller area network core

[    0.087468] NET: Registered PF_CAN protocol family

[    0.087476] can: raw protocol

[    0.087482] can: broadcast manager protocol

[    0.087497] can: netlink gateway - max_hops=1

[    0.087601] Key type dns_resolver registered

[    0.087627] Key type ceph registered

[    0.088003] libceph: loaded (mon/osd proto 15/24)

[    0.088102] Registering SWP/SWPB emulation handler

[    0.088185] Loading compiled-in X.509 certificates

[    0.106249] sun20i-d1-pinctrl 2000000.pinctrl: initialized sunXi PIO driver

[    0.127541] 2500400.serial: ttyS1 at MMIO 0x2500400 (irq = 231, base_baud = 1500000) is a 16550A

[    0.148857] 2500800.serial: ttyS2 at MMIO 0x2500800 (irq = 232, base_baud = 1500000) is a 16550A

[    0.170136] 2500c00.serial: ttyS3 at MMIO 0x2500c00 (irq = 233, base_baud = 1500000) is a 16550A

[    0.191451] 2501000.serial: ttyS4 at MMIO 0x2501000 (irq = 234, base_baud = 1500000) is a 16550A

[    1.153604] printk: console [ttyS4] enabled

[    1.179119] 2501400.serial: ttyS5 at MMIO 0x2501400 (irq = 235, base_baud = 1500000) is a 16550A

[    1.191385] phy phy-4100400.phy.0: Changing dr_mode to 1

[    1.192447] usb_phy_generic usb_phy_generic.1.auto: dummy supplies not allowed for exclusive requests

[    1.196801] ehci-platform 4101000.usb: EHCI Host Controller

[    1.206526] musb-hdrc musb-hdrc.2.auto: MUSB HDRC host driver

[    1.217641] musb-hdrc musb-hdrc.2.auto: new USB bus registered, assigned bus number 2

[    1.218394] ehci-platform 4200000.usb: EHCI Host Controller

[    1.225739] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.00

[    1.231285] ehci-platform 4101000.usb: new USB bus registered, assigned bus number 1

[    1.239352] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1

[    1.239361] usb usb2: Product: MUSB HDRC host driver

[    1.239367] usb usb2: Manufacturer: Linux 6.0.1+ musb-hcd

[    1.248768] ohci-platform 4200400.usb: Generic Platform OHCI controller

[    1.254321] usb usb2: SerialNumber: musb-hdrc.2.auto

[    1.276943] hub 2-0:1.0: USB hub found

[    1.280742] hub 2-0:1.0: 1 port detected

[    1.280833] ehci-platform 4101000.usb: irq 237, io mem 0x04101000

[    1.291165] ohci-platform 4200400.usb: new USB bus registered, assigned bus number 4

[    1.295293] ehci-platform 4200000.usb: new USB bus registered, assigned bus number 3

[    1.299804] cfg80211: Loading compiled-in X.509 certificates for regulatory database

[    1.314742] ohci-platform 4200400.usb: irq 241, io mem 0x04200400

[    1.320912] ehci-platform 4101000.usb: USB 2.0 started, EHCI 1.00

[    1.321058] sunxi-mmc 4020000.mmc: Got CD GPIO

[    1.327243] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.00

[    1.339771] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1

[    1.347017] usb usb1: Product: EHCI Host Controller

[    1.351896] usb usb1: Manufacturer: Linux 6.0.1+ ehci_hcd

[    1.355414] sunxi-mmc 4020000.mmc: initialized, max. request size: 2048 KB, uses new timings mode

[    1.357306] usb usb1: SerialNumber: 4101000.usb

[    1.368476] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'

[    1.371273] hub 1-0:1.0: USB hub found

[    1.377612] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2

[    1.381111] hub 1-0:1.0: 1 port detected

[    1.389691] cfg80211: failed to load regulatory.db

[    1.399425] ehci-platform 4200000.usb: irq 239, io mem 0x04200000

[    1.405735] usb usb4: New USB device found, idVendor=1d6b, idProduct=0001, bcdDevice= 6.00

[    1.414008] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1

[    1.421259] usb usb4: Product: Generic Platform OHCI controller

[    1.427195] usb usb4: Manufacturer: Linux 6.0.1+ ohci_hcd

[    1.432596] usb usb4: SerialNumber: 4200400.usb

[    1.437159] ehci-platform 4200000.usb: USB 2.0 started, EHCI 1.00

[    1.437576] ohci-platform 4101400.usb: Generic Platform OHCI controller

[    1.451072] hub 4-0:1.0: USB hub found

[    1.454876] hub 4-0:1.0: 1 port detected

[    1.459413] usb usb3: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.00

[    1.467729] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1

[    1.474946] usb usb3: Product: EHCI Host Controller

[    1.479833] usb usb3: Manufacturer: Linux 6.0.1+ ehci_hcd

[    1.485238] usb usb3: SerialNumber: 4200000.usb

[    1.490318] hub 3-0:1.0: USB hub found

[    1.494126] hub 3-0:1.0: 1 port detected

[    1.498691] ohci-platform 4101400.usb: new USB bus registered, assigned bus number 5

[    1.506736] ohci-platform 4101400.usb: irq 240, io mem 0x04101400

[    1.528486] mmc0: new high speed SDXC card at address 0001

[    1.534860] mmcblk0: mmc0:0001 JC2RT 59.6 GiB

[    1.541676]  mmcblk0: p1 p2 p3

[    1.579272] usb usb5: New USB device found, idVendor=1d6b, idProduct=0001, bcdDevice= 6.00

[    1.587590] usb usb5: New USB device strings: Mfr=3, Product=2, SerialNumber=1

[    1.594809] usb usb5: Product: Generic Platform OHCI controller

[    1.600739] usb usb5: Manufacturer: Linux 6.0.1+ ohci_hcd

[    1.606144] usb usb5: SerialNumber: 4101400.usb

[    1.611357] hub 5-0:1.0: USB hub found

[    1.615210] hub 5-0:1.0: 1 port detected

[    1.709741] EXT4-fs (mmcblk0p2): recovery complete

[    1.717019] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Quota mode: disabled.

[    1.725985] VFS: Mounted root (ext4 filesystem) on device 179:2.

[    1.732991] devtmpfs: mounted

[    1.737161] Freeing unused kernel image (initmem) memory: 1024K

[    1.743253] Run /sbin/init as init process

[    1.795116] usb 3-1: new high-speed USB device number 2 using ehci-platform

[    1.967036] EXT4-fs (mmcblk0p2): re-mounted. Quota mode: disabled.

[    1.995993] usb 3-1: New USB device found, idVendor=1a86, idProduct=8091, bcdDevice= 2.10

[    2.004211] usb 3-1: New USB device strings: Mfr=0, Product=2, SerialNumber=0

[    2.011458] usb 3-1: Product: USB HUB

[    2.015886] hub 3-1:1.0: USB hub found

[    2.019874] hub 3-1:1.0: 4 ports detected

Starting syslogd: OK

Starting klogd: OK

Running sysctl: OK

Populating /dev using udev: [    2.226736] udevd[120]: starting version 3.2.11

[    2.345085] usb 3-1.3: new high-speed USB device number 3 using ehci-platform

[    7.365081] random: crng init done

[    7.401441] udevd[121]: starting eudev-3.2.11

[    7.465155] usb 3-1.3: device descriptor read/64, error -110

[   22.825083] usb 3-1.3: device descriptor read/64, error -110

[   23.045082] usb 3-1.3: new high-speed USB device number 4 using ehci-platform

[   28.185085] usb 3-1.3: device descriptor read/64, error -110

udevadm settle failed

done

Initializing random number generator: OK

Saving random seed: OK

Starting network: Waiting for interface usb0 to appear.^C...




.[   43.545086] usb 3-1.3: device descriptor read/64, error -110

[   43.665237] usb 3-1-port3: attempt power cycle

.[   44.325084] usb 3-1.3: new high-speed USB device number 5 using ehci-platform

.....



.... timeout!

run-parts: /etc/network/if-pre-up.d/wait_iface: exit status 1

FAIL

Starting ntpd: OK

Starting sshd: OK

Starting collectd: FAIL


Welcome to use T113

AllWinner T113 login: [   54.865085] usb 3-1.3: device not accepting address 5, error -110

[   54.965099] usb 3-1.3: new high-speed USB device number 6 using ehci-platform


Welcome to use T113

AllWinner T113 login:

Welcome to use T113

AllWinner T113 login:

Welcome to use T113

AllWinner T113 login:

Welcome to use T113

AllWinner T113 login:

Welcome to use T113

AllWinner T113 login:

Welcome to use T113

AllWinner T113 login: [   65.505083] usb 3-1.3: device not accepting address 6, error -110

[   65.511356] usb 3-1-port3: unable to enumerate USB device

[   65.815081] usb 3-1.4: new high-speed USB device number 7 using ehci-platform

[   65.976224] usb 3-1.4: New USB device found, idVendor=2c7c, idProduct=0125, bcdDevice= 3.18

[   65.984582] usb 3-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0

[   65.991911] usb 3-1.4: Product: Android

[   65.995766] usb 3-1.4: Manufacturer: Android

[   66.007062] cdc_ether 3-1.4:1.4 usb0: register 'cdc_ether' at usb-4200000.usb-1.4, CDC Ethernet Device, e6:bb:aa:44:41:5b



在这一部分出现了枚举失败的情况

[    7.465155] usb 3-1.3: device descriptor read/64, error -110

[   22.825083] usb 3-1.3: device descriptor read/64, error -110

[   23.045082] usb 3-1.3: new high-speed USB device number 4 using ehci-platform

[   28.185085] usb 3-1.3: device descriptor read/64, error -110



您好,如上提示是Hub枚举设备不正常,应是硬件工作不稳定导致。为快速解决您的问题,可直接电联下相关同事。电话:025-52638373、025-52638375。


嗯 已于贵司FAE进行电话沟通


最近使用CH334R,使用主控T113-i/LINUX系统,无法识别HUB,引线出来接电脑上也识别不了,测量晶振只有XO有波形,最大幅值只有600mV/24MHz,XI只有0.6V左右的电平,没有波形。改为5V供电一样的问题。麻烦指导一下。image.png


图中晶振是12M,您说的测了是24M不太对呢,334只支持12M。麻烦先确认下实际的晶振参数


只有登录才能回复,可以选择微信账号登录