juliagoda / CH341SER

CH341SER driver with fixed bug

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`make` error on Linux Mint 20.2

ipsod opened this issue · comments

commented
➜  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

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

Best regards

I tasted with Ubuntu 20.04 LTS

Hi, maybe someone can help me

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

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?

Ok, thank you too and congrats for the job!

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__

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

@EddyMercier can you post the compiler log?

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 !

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

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

Ok. Try again

Thanks @juliagoda let me test it in Ubuntu branch

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, 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.

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

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.

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

sudo dmesg

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

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

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.

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

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