CH341SER icon indicating copy to clipboard operation
CH341SER copied to clipboard

`make` error on Linux Mint 20.2

Open ipsod opened this issue 2 years ago • 24 comments

➜  CH341SER git:(master) ✗ make
make -C /lib/modules/5.15.0-53-generic/build  M=/home/zero/tmp/ch340/CH341SER 
make[1]: Entering directory '/usr/src/linux-headers-5.15.0-53-generic'
  CC [M]  /home/zero/tmp/ch340/CH341SER/ch34x.o
/home/zero/tmp/ch340/CH341SER/ch34x.c:1300:20: error: initialization of ‘unsigned int (*)(struct tty_struct *)’ from incompatible pointer type ‘int (*)(struct tty_struct *)’ [-Werror=incompatible-pointer-types]
 1300 |  .write_room     = ch34x_write_room,
      |                    ^~~~~~~~~~~~~~~~
/home/zero/tmp/ch340/CH341SER/ch34x.c:1300:20: note: (near initialization for ‘ch34x_device.write_room’)
/home/zero/tmp/ch340/CH341SER/ch34x.c:1301:21: error: initialization of ‘unsigned int (*)(struct tty_struct *)’ from incompatible pointer type ‘int (*)(struct tty_struct *)’ [-Werror=incompatible-pointer-types]
 1301 |  .chars_in_buffer = ch34x_chars_in_buffer,
      |                     ^~~~~~~~~~~~~~~~~~~~~
/home/zero/tmp/ch340/CH341SER/ch34x.c:1301:21: note: (near initialization for ‘ch34x_device.chars_in_buffer’)
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:297: /home/zero/tmp/ch340/CH341SER/ch34x.o] Error 1
make[1]: *** [Makefile:1903: /home/zero/tmp/ch340/CH341SER] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.15.0-53-generic'
make: *** [Makefile:7: default] Error 2

ipsod avatar Nov 15 '22 21:11 ipsod

Hi, the same error for me. Someone know a way for resolve it?

Best regards

yamelsenih avatar Nov 15 '22 21:11 yamelsenih

I tasted with Ubuntu 20.04 LTS

yamelsenih avatar Nov 15 '22 22:11 yamelsenih

Hi, maybe someone can help me

yamelsenih avatar Nov 22 '22 05:11 yamelsenih

make

make -C /lib/modules/5.15.0-53-generic/build  M=/tmp/CH341SER 
make[1]: Entering directory '/usr/src/linux-headers-5.15.0-53-generic'
  CC [M]  /tmp/CH341SER/ch34x.o
/tmp/CH341SER/ch34x.c:1300:20: error: initialization of ‘unsigned int (*)(struct tty_struct *)’ from incompatible pointer type ‘int (*)(struct tty_struct *)’ [-Werror=incompatible-pointer-types]
 1300 |  .write_room     = ch34x_write_room,
      |                    ^~~~~~~~~~~~~~~~
/tmp/CH341SER/ch34x.c:1300:20: note: (near initialization for ‘ch34x_device.write_room’)
/tmp/CH341SER/ch34x.c:1301:21: error: initialization of ‘unsigned int (*)(struct tty_struct *)’ from incompatible pointer type ‘int (*)(struct tty_struct *)’ [-Werror=incompatible-pointer-types]
 1301 |  .chars_in_buffer = ch34x_chars_in_buffer,
      |                     ^~~~~~~~~~~~~~~~~~~~~
/tmp/CH341SER/ch34x.c:1301:21: note: (near initialization for ‘ch34x_device.chars_in_buffer’)
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:297: /tmp/CH341SER/ch34x.o] Error 1
make[1]: *** [Makefile:1903: /tmp/CH341SER] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.15.0-53-generic'
make: *** [Makefile:7: default] Error 2

yamelsenih avatar Nov 25 '22 19:11 yamelsenih

Hi! First of all sorry for late response. Check out updated README that contains "Tutorial on Ubuntu" (Thanks @ensismoebius ). If this does not help, we will think about it some more, ok?

juliagoda avatar Dec 01 '22 20:12 juliagoda

Ok, thank you too and congrats for the job!

ensismoebius avatar Dec 01 '22 22:12 ensismoebius

Hello, I have the same problem on Ubuntu 20.4 (x86_64) kernel 5.15.0-56... SecureBoot is not active and brltty is not installed. Tell me if you need information about my configuration. __Teddy__

EddyMercier avatar Dec 08 '22 13:12 EddyMercier

As I remember there are mismatches between Arch and Ubuntu and there were already conflicts with it (one solution worked for Arch, but did not work for Ubuntu and vice versa), so I created a separate "ubuntu" branch. Try typing this:

git clone -b ubuntu https://github.com/juliagoda/CH341SER.git

and do the rest according to the tutorial and let me know what came out

juliagoda avatar Dec 08 '22 20:12 juliagoda

@EddyMercier can you post the compiler log?

ensismoebius avatar Dec 08 '22 23:12 ensismoebius

Hello,

I have the same error message with the ubuntu branch ! I don't understand the message because 'ch34x_write_room' is well declared as unsigned (but I am a professional in C++...) Meaby the problem is that the var "room" is not a 'unsigned int' but a 'int' (but I am a professional in C++...)

Thanks for your job !

EddyMercier avatar Dec 09 '22 15:12 EddyMercier

could you put here the results anyway? C language differs often when it comes to types behaviour. Are you sure 100% you are using the branch? I don't have Ubuntu, so I have to rely on someone else's results

juliagoda avatar Dec 09 '22 21:12 juliagoda

No need to put anything, I'll try it on workflow with ubuntu

juliagoda avatar Dec 09 '22 21:12 juliagoda

Ok. Try again

juliagoda avatar Dec 09 '22 22:12 juliagoda

Thanks @juliagoda let me test it in Ubuntu branch

yamelsenih avatar Dec 15 '22 23:12 yamelsenih

hi, I try with the ubuntu branch, but this happend.

asep@sholeh:~/Downloads/installer$ git clone -b ubuntu https://github.com/juliagoda/CH341SER.git
Cloning into 'CH341SER'...
remote: Enumerating objects: 180, done.
remote: Counting objects: 100% (112/112), done.
remote: Compressing objects: 100% (54/54), done.
remote: Total 180 (delta 81), reused 58 (delta 54), pack-reused 68
Receiving objects: 100% (180/180), 424.43 KiB | 471.00 KiB/s, done.
Resolving deltas: 100% (97/97), done.
asep@sholeh:~/Downloads/installer$ cd CH341SER/
asep@sholeh:~/Downloads/installer/CH341SER$ make
make -C /lib/modules/5.15.0-41-generic/build  M=/home/asep/Downloads/installer/CH341SER 
make[1]: Entering directory '/usr/src/linux-headers-5.15.0-41-generic'
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0
  You are using:           gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
  CC [M]  /home/asep/Downloads/installer/CH341SER/ch34x.o
  MODPOST /home/asep/Downloads/installer/CH341SER/Module.symvers
  CC [M]  /home/asep/Downloads/installer/CH341SER/ch34x.mod.o
  LD [M]  /home/asep/Downloads/installer/CH341SER/ch34x.ko
  BTF [M] /home/asep/Downloads/installer/CH341SER/ch34x.ko
Skipping BTF generation for /home/asep/Downloads/installer/CH341SER/ch34x.ko due to unavailability of vmlinux
make[1]: Leaving directory '/usr/src/linux-headers-5.15.0-41-generic'
asep@sholeh:~/Downloads/installer/CH341SER$ sudo make load
modprobe usbserial
insmod ch34x.ko
insmod: ERROR: could not insert module ch34x.ko: Operation not permitted
make: *** [Makefile:12: load] Error 1

I just migrate to Linux Mint 21 "Vanessa" from windows few days ago, and don't still don't know how to resolve this. Thank you

suryasarafe avatar Dec 20 '22 11:12 suryasarafe

hi, I try with the ubuntu branch, but this happend.

asep@sholeh:~/Downloads/installer$ git clone -b ubuntu https://github.com/juliagoda/CH341SER.git
Cloning into 'CH341SER'...
remote: Enumerating objects: 180, done.
remote: Counting objects: 100% (112/112), done.
remote: Compressing objects: 100% (54/54), done.
remote: Total 180 (delta 81), reused 58 (delta 54), pack-reused 68
Receiving objects: 100% (180/180), 424.43 KiB | 471.00 KiB/s, done.
Resolving deltas: 100% (97/97), done.
asep@sholeh:~/Downloads/installer$ cd CH341SER/
asep@sholeh:~/Downloads/installer/CH341SER$ make
make -C /lib/modules/5.15.0-41-generic/build  M=/home/asep/Downloads/installer/CH341SER 
make[1]: Entering directory '/usr/src/linux-headers-5.15.0-41-generic'
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0
  You are using:           gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
  CC [M]  /home/asep/Downloads/installer/CH341SER/ch34x.o
  MODPOST /home/asep/Downloads/installer/CH341SER/Module.symvers
  CC [M]  /home/asep/Downloads/installer/CH341SER/ch34x.mod.o
  LD [M]  /home/asep/Downloads/installer/CH341SER/ch34x.ko
  BTF [M] /home/asep/Downloads/installer/CH341SER/ch34x.ko
Skipping BTF generation for /home/asep/Downloads/installer/CH341SER/ch34x.ko due to unavailability of vmlinux
make[1]: Leaving directory '/usr/src/linux-headers-5.15.0-41-generic'
asep@sholeh:~/Downloads/installer/CH341SER$ sudo make load
modprobe usbserial
insmod ch34x.ko
insmod: ERROR: could not insert module ch34x.ko: Operation not permitted
make: *** [Makefile:12: load] Error 1

I just migrate to Linux Mint 21 "Vanessa" from windows few days ago, and don't still don't know how to resolve this. Thank you

Hi, this is because you have secure boot.

yamelsenih avatar Jan 02 '23 14:01 yamelsenih

I tasted it for Ubuntu and all right but never is loaded the driver when I connect the device. All test was over Ubuntu branch

Also I tasted for Raspbian with main branch and all also is ok but the driver never is loaded for device

yamelsenih avatar Jan 02 '23 14:01 yamelsenih

Is there any log/message about this that can be copied here? If not, maybe a screenshot using scrot -d? Additionally, is there at least one person for whom this driver under Linux Mint/Ubuntu works? If so, please provide some kind of response.

juliagoda avatar Jan 03 '23 18:01 juliagoda

after trying to upload driver, attach the file here, which has the content of the result :

sudo dmesg

juliagoda avatar Jan 03 '23 18:01 juliagoda

Linux Linux Mint 21.1 Cinnamon with Kernel 5.15.0-56-generic #62-Ubuntu SMP using Ubuntu branch:

make -C /lib/modules/5.15.0-56-generic/build M=/root/Downloads/CH341SER make[1]: Entering directory '/usr/src/linux-headers-5.15.0-56-generic' CC [M] /root/Downloads/CH341SER/ch34x.o /root/Downloads/CH341SER/ch34x.c:1294:27: error: initialization of ‘void (*)(struct tty_struct *, struct usb_serial_port *, struct ktermios *)’ from incompatible pointer type ‘void (*)(struct tty_struct *, struct usb_serial_port *, const struct ktermios *)’ [-Werror=incompatible-pointer-types] 1294 | .set_termios = ch34x_set_termios, | ^~~~~~~~~~~~~~~~~ /root/Downloads/CH341SER/ch34x.c:1294:27: note: (near initialization for ‘ch34x_device.set_termios’) cc1: some warnings being treated as errors make[2]: *** [scripts/Makefile.build:297: /root/Downloads/CH341SER/ch34x.o] Error 1 make[1]: *** [Makefile:1903: /root/Downloads/CH341SER] Error 2 make[1]: Leaving directory '/usr/src/linux-headers-5.15.0-56-generic' make: *** [Makefile:7: default] Error 2

linker3000 avatar Jan 26 '23 22:01 linker3000

Have anyone solved this? I'm on Ubuntu 22.04 lts, kernel 5.15.0-58-generic EDIT: Yes i'm using ubuntu branch

jd-apprentice avatar Jan 29 '23 02:01 jd-apprentice

I have the same error using the ubuntu branch on ubuntu 20.04, kernel 5.15.0-58-generic. The output looks exactly the same as linker3000 reported above.

mattm-boop avatar Feb 05 '23 18:02 mattm-boop

For anyone trying to use a chinese arduino (CH340g) I made it work downloading the installer of the 1.8 then using the 2.0+ I wrote a simple guide about it ->

https://gist.github.com/jd-apprentice/f1d1a9a526b42c8313ddb021c968ece7

jd-apprentice avatar Feb 05 '23 19:02 jd-apprentice

I am using Ubuntu 18.04, and meet the same issue. However, I make it successfully after I change to main branch.....

JacobKan avatar Mar 23 '23 10:03 JacobKan