Open ESLHemantSangle opened 6 years ago
That usually happens when we build the module using kernel headers of a different version from the kernel being used. Have you built the module in the same system into which you are trying to load it? Have you updated the kernel?
Thanks for the reply @adrianomarto , Yes actually I got that and also upgraded the Linux kernel headers but the make file was still trying to find Linux-headers-4.4.50-v7+ so I downloaded them from web and installed it but its still giving me the same error.
And Yes I am using the same Raspberry PI Model 3 to built and load the module.(using the steps given by you on the https://github.com/adrianomarto/soft_uart )
Hello @adrianomarto can you please help me out for the solution. As I need this in my production. Thanks,
Hi @ESLHemantSangle, I would try the following:
You can also try to load the module using "insmod ./soft_uart.ko" to make sure you are loading the module in the current folder instad of something in the search path. You can also use the command modinfo to verify the module parameters. If that does not help, please send the output of all those commands. That can help me to understand what is going on.
Cheers, Adriano.
Hi @adrianomarto I did as you suggested but still the error is same please find the output of steps given by you below
uname -a
command output
root@raspberrypi:/home/pi/soft_uart# uname -a
Linux raspberrypi 4.4.50-v7+ #970 SMP Mon Feb 20 19:18:29 GMT 2017 armv7l GNU/Linux
make clean
command output
root@raspberrypi:/home/pi/soft_uart# make clean
make -C /usr/src/linux-headers-4.4.50-v7+ M=/home/pi/soft_uart clean
make[1]: Entering directory '/usr/src/linux-headers-4.4.50-v7+'
CLEAN /home/pi/soft_uart/.tmp_versions
CLEAN /home/pi/soft_uart/Module.symvers
make[1]: Leaving directory '/usr/src/linux-headers-4.4.50-v7+'
make
command output
root@raspberrypi:/home/pi/soft_uart# make
make -C /usr/src/linux-headers-4.4.50-v7+ M=/home/pi/soft_uart modules
make[1]: Entering directory '/usr/src/linux-headers-4.4.50-v7+'
CC [M] /home/pi/soft_uart/module.o
CC [M] /home/pi/soft_uart/raspberry_soft_uart.o
CC [M] /home/pi/soft_uart/queue.o
LD [M] /home/pi/soft_uart/soft_uart.o
Building modules, stage 2.
MODPOST 1 modules
CC /home/pi/soft_uart/soft_uart.mod.o
LD [M] /home/pi/soft_uart/soft_uart.ko
make[1]: Leaving directory '/usr/src/linux-headers-4.4.50-v7+'
make install
command output
root@raspberrypi:/home/pi/soft_uart# make install
sudo install -m 644 -c soft_uart.ko /lib/modules/4.4.50-v7+
sudo depmod
insmod soft_uart.ko
command output
root@raspberrypi:/home/pi/soft_uart# insmod soft_uart.ko
insmod: ERROR: could not insert module soft_uart.ko: Invalid module format
insmod ./soft_uart.ko
command output
root@raspberrypi:/home/pi/soft_uart# insmod ./soft_uart.ko
insmod: ERROR: could not insert module ./soft_uart.ko: Invalid module format
modinfo soft_uart.ko
command output
root@raspberrypi:/home/pi/soft_uart# modinfo soft_uart.ko
filename: /home/pi/soft_uart/soft_uart.ko
version: 0.1
description: Software-UART for Raspberry Pi
author: Adriano Marto Reis
license: GPL
srcversion: 583A908CEF3BB3E6F1F7BE3
depends:
vermagic: 4.4.50-v7 SMP mod_unload modversions ARMv7
parm: gpio_tx:int
parm: gpio_rx:int
As the output of step 1,2 and 3 referring to same kernel version i.e. linux-headers-4.4.50-v7+
but still the module is not starting.
Thanks, Hemant
Hi @ESLHemantSangle,
Have you noticed that the version indicated by modinfo is 4.4.50-v7 whilst your kernel is 4.4.50-v7+? I don't know exactly from where you downloaded the kernel headers, but it is not exactly the same version as the kernel you are using.
I would try to use the linux kernel and linux-headers from raspbian repository instead of downloading them from anywhere else.
Just some tips:
Cheers, Adriano.
Thank very much @adrianomarto with your help I have solved the issue of kernel and the soft_uart module is running now thank you so much for your code and time
I am glad that the problem is solved.
Hi @adrianomarto, I am trying to connect GSM module as PPP modem to ttySOFT0 but the connection is failing. I tried steps given by you to test the SOFT UART and they are working but still the connection is failing. So is there any way I can test the SOFT UART using different steps if yes then please let me know.
Thanks, Hemant
How can we load the driver for 2 devices such as SOFT0 and SOFT1 (and select the appropriated pins) ? As both will run on very low baud rate I believe we will not face any performance issue. Thanks
There is a error while using "insmod soft_uart.ko" command on Raspberry PI 3
ERROR insmod: ERROR: could not insert module soft_uart.ko: Invalid module format
OS Detials PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)" NAME="Raspbian GNU/Linux" VERSION_ID="8" VERSION="8 (jessie)" ID=raspbian ID_LIKE=debian
so can you help me solve this error Thanks,