LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-11-2018, 08:20 AM   #1
rbees
Member
 
Registered: Mar 2004
Location: northern michigan usa
Distribution: Debian Squeeze, Whezzy, Jessie
Posts: 897

Rep: Reputation: 46
Incomplete install instructions?


Thanks to all who help on this site.

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
 
Old 03-11-2018, 09:22 AM   #2
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: MID-SOUTH USA
Distribution: Slackware 14.2 / Slackware 14.2 current / Manjaro
Posts: 6,613

Rep: Reputation: 1333Reputation: 1333Reputation: 1333Reputation: 1333Reputation: 1333Reputation: 1333Reputation: 1333Reputation: 1333Reputation: 1333Reputation: 1333
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.
 
Old 03-11-2018, 09:43 AM   #3
rbees
Member
 
Registered: Mar 2004
Location: northern michigan usa
Distribution: Debian Squeeze, Whezzy, Jessie
Posts: 897

Original Poster
Rep: Reputation: 46
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.
 
Old 03-11-2018, 10:29 AM   #4
rbees
Member
 
Registered: Mar 2004
Location: northern michigan usa
Distribution: Debian Squeeze, Whezzy, Jessie
Posts: 897

Original Poster
Rep: Reputation: 46
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.
 
Old 03-11-2018, 10:44 AM   #5
rbees
Member
 
Registered: Mar 2004
Location: northern michigan usa
Distribution: Debian Squeeze, Whezzy, Jessie
Posts: 897

Original Poster
Rep: Reputation: 46
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.
 
Old 03-11-2018, 11:17 AM   #6
rbees
Member
 
Registered: Mar 2004
Location: northern michigan usa
Distribution: Debian Squeeze, Whezzy, Jessie
Posts: 897

Original Poster
Rep: Reputation: 46
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.
 
Old 03-11-2018, 01:52 PM   #7
rbees
Member
 
Registered: Mar 2004
Location: northern michigan usa
Distribution: Debian Squeeze, Whezzy, Jessie
Posts: 897

Original Poster
Rep: Reputation: 46
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.....
 
Old 03-12-2018, 08:35 PM   #8
rbees
Member
 
Registered: Mar 2004
Location: northern michigan usa
Distribution: Debian Squeeze, Whezzy, Jessie
Posts: 897

Original Poster
Rep: Reputation: 46
Been told that the the boot loader is not the issue.

thanks again
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Can't install Slackware64 14.1 - RAMDISK: incomplete write jmpetre Slackware 2 12-06-2013 11:40 AM
Install error, incomplete Novatian Linux - Mobile 3 09-19-2012 07:32 PM
Wine Used To Install HP Program, Installation Incomplete. Novatian Linux - Software 1 09-04-2008 12:13 AM
incomplete install suse greenberet Linux - Software 4 12-25-2006 11:26 PM
winex - incomplete install? r_jensen11 Linux - Software 9 01-24-2004 02:00 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration