WCHSoftGroup / ch341par_linux

13 stars 5 forks source link

CH34x_GetDriverVersion error #3

Open maswx opened 11 months ago

maswx commented 11 months ago

我安装了驱动,并运行了demo,但是显示 CH34x_GetDriverVersion error ,能帮看看原因吗?

(base) ➜  ch341 git:(xxx) ✗ ./a.out /dev/ch34x_pis0
Open device /dev/ch34x_pis0 succeed, fd: 3
CH34x_GetDriverVersion error.

(base) ➜  ch341 git:(xxx) ✗ sudo dmesg | tail -n 10
[63388.030879] usb 2-1.4: Manufacturer: Saleae LLC
[64751.402150] usb 2-1.3: USB disconnect, device number 18
[64751.402381] CH34x_pis-0 now disconnected
[64770.056815] usb 2-1.3: new full-speed USB device number 22 using ehci-pci
[64770.169800] usb 2-1.3: New USB device found, idVendor=1a86, idProduct=5512, bcdDevice= 3.04
[64770.169810] usb 2-1.3: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[64770.170459] Found a bulk in endpoint
[64770.170462] Found a bulk out endpoint
[64770.170462] Found a interrupt in endpoint
[64770.170566] Ch34x_pis device now attached to ch34x_pis-0

(base) ➜  ch341 git:(xxx) ✗ ll /dev/ch34x_pis0 
crwxrwxrwx 1 root root 180, 0 12月 13 13:54 /dev/ch34x_pis0
(base) ➜  ch341 git:(xxx) ✗ find /lib/modules/$(uname -r)/ -name "ch34*"
/lib/modules/5.15.0-91-generic/kernel/drivers/usb/misc/ch34x_pis.ko
/lib/modules/5.15.0-91-generic/kernel/drivers/usb/serial/ch341.ko

(base) ➜  ch341 git:(xxx) ✗ gcc ch341_demo.c  -lch347    
(base) ➜  ch341 git:(xxx) ✗ ldd a.out 
    linux-vdso.so.1 (0x00007ffcd17eb000)
    libch347.so => /lib/libch347.so (0x00007f32a9bd9000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f32a99e7000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f32a9c0b000) 
(base) ➜  ch341 git:(xxx) ✗ ldd a.out
(base) ➜  ch341 git:(xxx) ✗ ./a.out /dev/ch34x_pis0 
Open device /dev/ch34x_pis0 succeed, fd: 3
CH34x_GetDriverVersion error.
maswx commented 11 months ago

使用老版本动态库 libch34x.so 是正常的!

gcc -Wall -fPIC -g  test.c -o test  -lch34x
./test 
Open successful, dev_fd = 3
VenIc is 0x30