skyrocknroll/CH341SER_LINUX

Unable to compile the latest CH341SER_LINUX driver for nodemcu

skyrocknroll opened this issue · 15 comments

make -C /lib/modules/4.4.0-28-generic/build  M=/home/yuva/embedded/CH341SER_LINUX  
make[1]: Entering directory '/usr/src/linux-headers-4.4.0-28-generic'
  CC [M]  /home/yuva/embedded/CH341SER_LINUX/ch34x.o
/home/yuva/embedded/CH341SER_LINUX/ch34x.c: In function ‘wait_modem_info’:
/home/yuva/embedded/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
scripts/Makefile.build:264: recipe for target '/home/yuva/embedded/CH341SER_LINUX/ch34x.o' failed
make[2]: *** [/home/yuva/embedded/CH341SER_LINUX/ch34x.o] Error 1
Makefile:1403: recipe for target '_module_/home/yuva/embedded/CH341SER_LINUX' failed
make[1]: *** [_module_/home/yuva/embedded/CH341SER_LINUX] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.4.0-28-generic'
Makefile:5: recipe for target 'default' failed
make: *** [default] Error 2

If you have received this error then clone the repo and execute
make
make load

Awesome !
But after clone of me did fix the error on the make command, but when I make make load command, then

modprobe usbserial
modprobe: ERROR: could not insert 'usbserial': Operation not permitted
Makefile:9: recipe for target 'load' failed
make: *** [load] Error 1

How to fix it?
My first time using linux (ubuntu 16:04), looking forward to your help

@trinhduc You need to execute with sudo permissions

sudo make
sudo make load

I made it !
Thanks you so much.

What's is "clone of me"? I write: sudo make and say that:

make -C /lib/modules/4.4.0-64-generic/build M=/home/deivi/Descargas/CH341SER_LINUX make[1]: se ingresa al directorio «/usr/src/linux-headers-4.4.0-64-generic» CC [M] /home/deivi/Descargas/CH341SER_LINUX/ch34x.o /home/deivi/Descargas/CH341SER_LINUX/ch34x.c: In function ‘wait_modem_info’: /home/deivi/Descargas/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 make[2]: *** [/home/deivi/Descargas/CH341SER_LINUX/ch34x.o] Error 1 make[1]: *** [_module_/home/deivi/Descargas/CH341SER_LINUX] Error 2 make[1]: se sale del directorio «/usr/src/linux-headers-4.4.0-64-generic» make: *** [default] Error 2

And then, I write: sudo make load

deivi@N150:~/Descargas/CH341SER_LINUX$ sudo make load modprobe usbserial insmod ch34x.ko insmod: ERROR: could not load module ch34x.ko: No such file or directory make: *** [load] Error 1

What am I making wrong?

Thanks!

My kernel is up to date, it is linux-headers-4.4.0-64-generic, and the driver supports versions of linux kernel range from 2.6.25 to 3.13.x... I have installed older version (3.13.0.24-generic) but it doesn't work... is it recommended uninstall the last version?
Thank you so much!

I've managed to compile after downloading the latest version. But when I tried to run sudo make load, I got the following message:

$ sudo make load
modprobe usbserial
insmod ch34x.ko
insmod: ERROR: could not insert module ch34x.ko: Required key not available
Makefile:9: recipe for target 'load' failed
make: *** [load] Error 1

when i Solve this ?
make -C /lib/modules/3.13.0-24-generic/build M=/home/leaozinho/Downloads/DriveESP/CH341SER_LINUX
make[1]: Entrando no diretório /usr/src/linux-headers-3.13.0-24-generic' Building modules, stage 2. MODPOST 1 modules make[1]: Saindo do diretório /usr/src/linux-headers-3.13.0-24-generic'

i try

➜ CH341SER_LINUX sudo make load
modprobe usbserial
modprobe: ERROR: could not insert 'usbserial': Unknown symbol in module, or unknown parameter (see dmesg)
make: ** [load] Erro 1
➜ CH341SER_LINUX

bug-i commented

I have a similar problem, did someone manage to get CH341SER running with the current raspbian?
I get this error: insmod: ERROR: could not insert module ch34x.ko: Invalid module format

I was getting

insmod: ERROR: could not insert module ch34x.ko: Device or resource busy

and just rebooted Ubuntu and it worked.

I was getting

insmod: ERROR: could not insert module ch34x.ko: Device or resource busy

and just rebooted Ubuntu and it worked.

Funny. I am getting the same thing and try rebooting Ubuntu but it still doesn't work for me. Help, please.

insmod: ERROR: could not insert module ch34x.ko: Operation not permitted.

I'm running it as root user, and all the files in the folder has 744 permission.

Any solutions to this error?

Hi @skyrocknroll

make load
modprobe usbserial
insmod ch34x.ko
insmod: ERROR: could not load module ch34x.ko: No such file or directory
make: *** [Makefile:10: load] Error 1

I also facing the same issue. help out for this.

Check Secure Boot: If your system uses UEFI with Secure Boot enabled, the kernel will only load modules signed with a trusted key. You can either disable Secure Boot or sign the module with your own key.

To disable Secure Boot:

1- Restart your computer and enter the BIOS/UEFI settings (usually by pressing a key like F2, F10, Del, or Esc during boot).
2- Find the Secure Boot option and disable it.
3- Save the changes and reboot.

Sign the Module: If you prefer to keep Secure Boot enabled, you need to sign the kernel module with a key that the system trusts.
please find the details here:
https://ubuntu.com/blog/how-to-sign-things-for-secure-boot
then:
sudo mokutil --import MOK.der
sudo reboot
follow the prompts to enroll the key in the MOK manager: MOK, Continue, Yes then type the configured password.

Sign the module:
sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 MOK.priv MOK.der ch34x.ko

Load the module:
sudo make load
or
sudo insmod ch34x.ko

To check on the modules:
sudo dmesg | grep ch34x