Installing CH431SER on Ayufan 0.9.14: gitlab-ci-linux-build-159
#1
Hello

when I try to install the Driver CH341SER from CH341SER_LINUX.ZIP - 南京沁恒微电子股份有限公司 (wch.cn) for the Ayufan linux build. I get this error Message during the compilation:
Code:
rock64@rockpro64:~/CH341SER_LINUX/driver$ make
make -C /lib/modules/4.4.190-1233-rockchip-ayufan-gd3f1be0ed310/build  M=/home/rock64/CH341SER_LINUX/driver 
make[1]: Entering directory '/usr/src/linux-headers-4.4.190-1233-rockchip-ayufan-gd3f1be0ed310'
  CC [M]  /home/rock64/CH341SER_LINUX/driver/ch341.o
gcc: error: unrecognized command line option '-mgeneral-regs-only'
gcc: error: unrecognized command line option '-mcmodel=large'
scripts/Makefile.build:283: recipe for target '/home/rock64/CH341SER_LINUX/driver/ch341.o' failed
make[2]: *** [/home/rock64/CH341SER_LINUX/driver/ch341.o] Error 1
Makefile:1479: recipe for target '_module_/home/rock64/CH341SER_LINUX/driver' failed
make[1]: *** [_module_/home/rock64/CH341SER_LINUX/driver] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.4.190-1233-rockchip-ayufan-gd3f1be0ed310'
Makefile:5: recipe for target 'default' failed
make: *** [default] Error 2


I want to use the PineDisplay as Display on Linux and since Ayufan has a Documentation how to use it on his Linux Build, i use it.
But i need to install the Driver to use a CH340c RS485 to USB converter.

Any help is greatly appreciated.
  Reply
#2
(07-11-2023, 01:12 AM)Thisone Wrote:
Code:
  CC [M]  /home/rock64/CH341SER_LINUX/driver/ch341.o
gcc: error: unrecognized command line option '-mgeneral-regs-only'
gcc: error: unrecognized command line option '-mcmodel=large'
scripts/Makefile.build:283: recipe for target '/home/rock64/CH341SER_LINUX/driver/ch341.o' failed

What version of gcc you are using? Your gcc doesn't understand the two commandline options '-mgeneral-regs-only' and '-mcmodel=large'

I'm on 6.0.0-1164-ayufan and compiling with gcc 13.1.1 that driver works like a charm:
Code:
$ make
make -C /lib/modules/6.0.0-1164-ayufan-ga2fd0c498/build  M=/tmp/CH341SER_LINUX/driver  
make[1]: Entering directory '/usr/src/linux-headers-6.0.0-1164-ayufan-ga2fd0c498'
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: aarch64-linux-gnu-gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
  You are using:           aarch64-alt-linux-gcc (GCC) 13.1.1 20230613 (ALT Sisyphus 13.1.1-alt1)
  CC [M]  /tmp/CH341SER_LINUX/driver/ch341.o
  MODPOST /tmp/CH341SER_LINUX/driver/Module.symvers
  CC [M]  /tmp/CH341SER_LINUX/driver/ch341.mod.o
  LD [M]  /tmp/CH341SER_LINUX/driver/ch341.ko
make[1]: Leaving directory '/usr/src/linux-headers-6.0.0-1164-ayufan-ga2fd0c498'

That driver loads into that kernel without complaint:
[ 152.041600] ch341: loading out-of-tree module taints kernel.
[ 152.042335] usbcore: registered new interface driver usb_ch341
[ 152.042341] ch341: USB serial driver for ch340, ch341, etc.
[ 152.042344] ch341: V1.6 On 2022.08

May be is is incompatible with the legacy kernel?
  Reply
#3
I choose the Version, because it is marked as the latest stable build, but I'll try updating the Compiler if you think that would solve the Problem.
  Reply
#4
(07-11-2023, 12:06 PM)hunderteins Wrote:
(07-11-2023, 01:12 AM)Thisone Wrote:
Code:
  CC [M]  /home/rock64/CH341SER_LINUX/driver/ch341.o
gcc: error: unrecognized command line option '-mgeneral-regs-only'
gcc: error: unrecognized command line option '-mcmodel=large'
scripts/Makefile.build:283: recipe for target '/home/rock64/CH341SER_LINUX/driver/ch341.o' failed

What version of gcc you are using? Your gcc doesn't understand the two commandline options '-mgeneral-regs-only' and '-mcmodel=large'

I'm on 6.0.0-1164-ayufan and compiling with gcc 13.1.1 that driver works like a charm:
Code:
$ make
make -C /lib/modules/6.0.0-1164-ayufan-ga2fd0c498/build  M=/tmp/CH341SER_LINUX/driver 
make[1]: Entering directory '/usr/src/linux-headers-6.0.0-1164-ayufan-ga2fd0c498'
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: aarch64-linux-gnu-gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
  You are using:           aarch64-alt-linux-gcc (GCC) 13.1.1 20230613 (ALT Sisyphus 13.1.1-alt1)
  CC [M]  /tmp/CH341SER_LINUX/driver/ch341.o
  MODPOST /tmp/CH341SER_LINUX/driver/Module.symvers
  CC [M]  /tmp/CH341SER_LINUX/driver/ch341.mod.o
  LD [M]  /tmp/CH341SER_LINUX/driver/ch341.ko
make[1]: Leaving directory '/usr/src/linux-headers-6.0.0-1164-ayufan-ga2fd0c498'

That driver loads into that kernel without complaint:
[  152.041600] ch341: loading out-of-tree module taints kernel.
[  152.042335] usbcore: registered new interface driver usb_ch341
[  152.042341] ch341: USB serial driver for ch340, ch341, etc.
[  152.042344] ch341: V1.6 On 2022.08

May be is is incompatible with the legacy kernel?

I still get the same error after updating gcc to gcc-9 following this tutorial: How to Install GCC Compiler on Ubuntu 18.04 | Linuxize
  Reply
#5
(07-12-2023, 01:14 AM)Thisone Wrote: I still get the same error after updating gcc to gcc-9 following this tutorial: How to Install GCC Compiler on Ubuntu 18.04 | Linuxize

I don't know about "latest stable build." You are just using a lot of legacy software. Kernel 4.4 is legacy, gcc-9 is legacy. Try to use an older version of your driver that fits into that environment. For example https://github.com/juliagoda/CH341SER/tree/ubuntu

There is also a CH341-driver allready included into 4.4. The README.md of the vendor-driver states, that this driver is too old. I think the vendor has adapted the driver to modern gcc/kernel versions, because x86_64 is not holding back at 4.4. That often breaks compatibility to older versions.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  irradium (based on crux linux) RockPro64 riscv64, aarch64 mara 1 517 03-25-2024, 12:12 PM
Last Post: mara
  Installing Ubuntu Server on RockPro64 deutschlmao 2 2,660 10-29-2023, 04:43 PM
Last Post: brotherj4mes
Exclamation Ethernet regression on Linux Kernel 6.5.4? Deathcrow 3 852 09-22-2023, 04:27 AM
Last Post: diederik
  GPIO on Ayufan 0.9.14 Build Thisone 7 2,151 04-23-2023, 01:32 PM
Last Post: diederik
  Linux laptop does not detect the board when plugged in via USB soupy 1 4,027 04-13-2023, 03:01 AM
Last Post: Reynold Grady
  Is some u-boot required on the SPI for installing debian with the official installer? callegar 1 1,365 10-25-2022, 10:07 AM
Last Post: ratzzupaltuff
  RockPro64 linux console video mode callegar 0 892 09-06-2022, 02:32 PM
Last Post: callegar
Brick Maintained Linux booting from eMMC ootoovak 10 8,274 04-30-2022, 03:57 PM
Last Post: TRS-80
  How I Got Fedora Linux to Boot From eMMC (or microSD, for that matter) whitecat23 4 4,326 01-03-2022, 10:32 AM
Last Post: whitecat23
  Compiling ayufan mainline - DT-overlay missing Mentaluproar 0 1,468 07-24-2021, 09:46 PM
Last Post: Mentaluproar

Forum Jump:


Users browsing this thread: 1 Guest(s)