frank-zago / ch341-i2c-spi-gpio

WinChipHead CH341 linux driver for I2C, SPI and GPIO mode
GNU General Public License v2.0
70 stars 29 forks source link

could not insert module ch341-core.ko: Invalid module format #19

Open botoxparty opened 1 year ago

botoxparty commented 1 year ago

Hi,

I get the following error when I try to insert the modules.

(base) ➜  ch341-i2c-spi-gpio git:(master) ✗ sudo insmod ch341-core.ko   
insmod: ERROR: could not insert module ch341-core.ko: Invalid module format

I saw on a previous issue that it could have been built against the wrong kernel headers, how would I build against the right ones?

This is what modprobe returns:

(base) ➜  ch341-i2c-spi-gpio git:(master) ✗ modinfo ch341-core.ko
filename:       /home/adam/apps/ch341-i2c-spi-gpio/ch341-core.ko
license:        GPL
description:    CH341 USB to I2C/SPI/GPIO adapter
author:         Frank Zago <frank@zago.net>
srcversion:     76BBA2A35D7BD3BEBADD4D8
alias:          usb:v1A86p5512d*dc*dsc*dp*ic*isc*ip*in*
depends:        
retpoline:      Y
name:           ch341_core
vermagic:       6.2.0-26-generic SMP preempt mod_unload modversions 

Thanks

frank-zago commented 1 year ago

It's likely the module has not been built for the running kernel. 'dmesg' may show the real error. Try a "make clean" then "make" again to rebuild. If that doesn't work, check the installed packages. The kernel and its dev or devel package must match.