LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Incomplete install instructions? (https://www.linuxquestions.org/questions/programming-9/incomplete-install-instructions-4175625363/)

rbees 03-11-2018 08:20 AM

Incomplete install instructions?
 
Thanks to all who help on this site.:thumbsup:

I purchased a arduino clone made with the ch340g chip. It seams to get these to work the driver has to be installed from the manufactures site. But the site is in Chinese, which I can't read.

The instructions

Quote:

// ChangeLog
// 1.0 - 1.1 modified to solve transmition between ch341 and ch341
// 1.1 - 1.2 Support high Linux kernel
Instructions

Note: 1.Please run followed executable programs as root privilege
2.Current Driver support versions of linux kernel range from 2.6.25 to 3.13.x
3.Current Driver support 32bits and 64bits linux systems

Usage:
(load or unload linux driver of CH34x)
//compile
#make
//load ch34x chips driver
#make load
//unload ch34x chips driver
#make unload
This is their english translation included with the source.

From a github site https://github.com/lizard43/CH340G
Quote:

Some Arduino clones use a CH340G USB chip and you'll need to install a driver

The zip files are from the vendor site. The Windows seems to work ~ok. I don't have a Mac, can't vouch for that driver. The Linux driver as-is only support 3.9 or less kernel versions

In order to support 3.9+ kernels, the ch34x.c file needed to be edited. This change is in the ch340g folder. The old, original file for ref is in the old340 folder

The difference is that between kernel version, they renamed the struct usb_serial_port port number field from 'number' to 'port_number'

Diff the ch34x.c files to see what I'm talking about.

To build and install just do:

make

make load
I have installed some software from source and it has always gone
Quote:

./configure
make
make install
So these instruction look to me like they are leaving a bunch of steps out. Almost like you have to build a new kernel and add these steps into the normal process.

I get this when I plug the arduino clone in.
Code:

:~$ sudo dmesg | tail
[136677.806287] usb 2-1.3: device descriptor read/64, error -32
[136677.994313] usb 2-1.3: device descriptor read/64, error -32
[136678.102580] usb 2-1-port3: attempt power cycle
[136678.706410] usb 2-1.3: new full-speed USB device number 13 using ehci-pci
[136678.735549] usb 2-1.3: device descriptor read/8, error -32
[136678.863611] usb 2-1.3: device descriptor read/8, error -32
[136679.050368] usb 2-1.3: new full-speed USB device number 14 using ehci-pci
[136679.079624] usb 2-1.3: device descriptor read/8, error -32
[136679.207639] usb 2-1.3: device descriptor read/8, error -32
[136679.314532] usb 2-1-port3: unable to enumerate USB device

:~$ lsusb
Bus 002 Device 006: ID 0a5c:5800 Broadcom Corp. BCM5880 Secure Applications Processor
Bus 002 Device 005: ID 413c:8187 Dell Computer Corp. DW375 Bluetooth Module
Bus 002 Device 004: ID 0af0:6911 Option
Bus 002 Device 003: ID 248a:8366
Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
:~$

Some have said it is a usb cable issue. Tried a different cable. Same results.

Others have said that there is a problem with the chip because of the communication issues. But if I understand the changes to the souce that will be fixed with the updated driver.

What do I need to do to actuall test the driver?
Thanks

BW-userx 03-11-2018 09:22 AM

Not all source code uses configure. Some use just make. Make install If that is a module it probably is just make make load. To load it. Give it a try. Or open the makefile and give it a read first.

rbees 03-11-2018 09:43 AM

Thanks BW_userx,

So I assume that

make
make load

is done from the directory where the source is located. And does this survive a reboot? If not how do I make it survive? Provided that it works that is.

There is a /lib/modules/kernel-version/kernel/drivers/usb/serial/ch431.ko that must try to load when I plug in the arduino clone. Should I blacklist it first?

Thanks again.

rbees 03-11-2018 10:29 AM

Yup

As I expected, FAIL
Code:

e:~/sys-config/arduino/CH341SER_LINUX$ sudo make
[sudo] password for user:
make -C /lib/modules/4.9.0-6-amd64/build  M=/home/kingbee/sys-config/arduino/CH341SER_LINUX 
make[1]: Entering directory '/usr/src/linux-headers-4.9.0-6-amd64'
  LD      /home/user/sys-config/arduino/CH341SER_LINUX/built-in.o
  CC [M]  /home/user/sys-config/arduino/CH341SER_LINUX/ch34x.o
/home/user/sys-config/arduino/CH341SER_LINUX/ch34x.c: In function ‘wait_modem_info’:
/home/user/sys-config/arduino/CH341SER_LINUX/ch34x.c:756:3: error: implicit declaration of function ‘interruptible_sleep_on’ [-Werror=implicit-function-declaration]
  interruptible_sleep_on( &priv->delta_msr_wait );
  ^~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
/usr/src/linux-headers-4.9.0-6-common/scripts/Makefile.build:304: recipe for target '/home/user/sys-config/arduino/CH341SER_LINUX/ch34x.o' failed
make[4]: *** [/home/i-ul/sys-config/arduino/CH341SER_LINUX/ch34x.o] Error 1
/usr/src/linux-headers-4.9.0-6-common/Makefile:1515: recipe for target '_module_/home/user/sys-config/arduino/CH341SER_LINUX' failed
make[3]: *** [_module_/home/kingbee/sys-config/arduino/CH341SER_LINUX] Error 2
Makefile:150: recipe for target 'sub-make' failed
make[2]: *** [sub-make] Error 2
Makefile:8: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.9.0-6-amd64'
Makefile:5: recipe for target 'default' failed
make: *** [default] Error 2
:~/sys-config/arduino/CH341SER_LINUX$

I have now tried 3 different cables, no joy.

I suspect that there have been other changes to the kernel since this driver file was updated. But I have no idea how to fix the issue. Although I have located that section in the make file.

rbees 03-11-2018 10:44 AM

So the source from the github site must have some kind of issue as it failed to build but the source from the manufactures site built just fine. Still can't access the arduino clone but some progress has been made.

Have looked at blacklisting the existing module but the instruction have changed since the last time I had to do it.

Still don't know how to make it survive a reboot. The built module was not copied into the kernel tree.

rbees 03-11-2018 11:17 AM

So the module is installed but still no access to the arduino clone.

Code:

:~$ sudo lsmod
Module                  Size  Used by
ch34x                  20480  0
usbserial              49152  1 ch34x

It is not being assigned a /dev/ttyUSB0 or what ever it should be in this case.

The system responds the same wheather the module is inserted or not.

And the system also does not try to use the debian version either.

My guess the card is bad.

To bad it will cost as much to ship it back as it cost in the first place.

rbees 03-11-2018 01:52 PM

One other possability, perhaps lack of a bootloader prevents the computer from detecting the card corectly? This is probably not the best place to ask but.....

rbees 03-12-2018 08:35 PM

Been told that the the boot loader is not the issue.

thanks again


All times are GMT -5. The time now is 05:03 PM.