Exec format Erro adding Kernel modules in R21.3

hello,

Im a student from Germany, i want to add some kernel modules to the existing kernel from the Jetpack. I tried the tutorial from elinux http://elinux.org/Jetson/Tutorials/Program_An_Arduino.
i get an error from modprobe:

modprobe: ERROR: could not insert 'ftdi_sio': Exec format error

modprobe -f shows the same error.

i compiled the newest source 3.10.40 and add the ftdi as module.
the command make module shows a warning:

WARNING: Symbol version dump /home/ubuntu/L4T_Kernel_R21.3/kernel/Module.symvers
is missing; modules will have no dependencies and modversions.

but the process finish without an error.

Any idea what I did wrong?

About the first error. ā€œdmesgā€ might tell more precise reason for the exec format error.

looks like the zImage version is not matching your ftdi driver.

could you provide more informationas below three?

  1. ā€œubuntu@tegra-ubuntu:~$ uname -rā€
  2. ā€œubuntu@tegra-ubuntu:~$ modinfo ftdi_sioā€
  3. ā€œubuntu@tegra-ubuntu:~$ ls -l /lib/modulesā€

The zImage version and vermagic of module must be the same as folder name of ā€œ/lib/modules/3.10.40-gc017b03ā€, if the BSP version is 21.3.

If the zImage and module version is not the same as 3.10.40-gc017b03, please make with argument like ā€œmake KERNELVERSION=3.10.40-gc017b03ā€.

1 Like

Additional question: Was this compiled on Jetson, or cross-compiled? If cross-compiled, which compiler did you use?

Hi,
dmesg prints:

ubuntu@tegra-ubuntu:~/L4T_Kernel_R21.3/kernel$ sudo modprobe ftdi_sio
[sudo]password for ubuntu: 
modprobe: ERROR: could not insert 'ftdi_sio': Exec format error
ubuntu@tegra-ubuntu:~/L4T_Kernel_R21.3/kernel$ dmesg -c 
dmesg: klogctl failed: Operation not permitted
ubuntu@tegra-ubuntu:~/L4T_Kernel_R21.3/kernel$

@BingTang : I post the three answers as fast as I can.
@linuxdev : The modules are compiled on the jetson board.

Thanks

1 Like

Try the dmesg command without the ā€œ-cā€ or with sudo.

This ā€œnewest sourceā€ for the kernel…I assume it is the one that is available with R21.3 on its download page (versus something from git). Is this correct?

Also, was this configured with a working /proc/config.gz prior to adding the ftdi module? Was the entire kernel installed separate from the default R21.3 install, or just the module?

I use the kernels source from: [url]https://developer.nvidia.com/linux-tegra-r213[/url] Kernel version 3.10.40 there are two different versions available on the website!
The board is flashed with the Jetpack; I used the config.gz from the jetson root fs. I think this should work. Only the module is newly installed.

The version from the web link provided, label ā€œKernel sources [sha1sum:34ae773bf3a32aceb9bef4ce05cda852fea15cbf]ā€, is correct. However, there is one minor config detail often overlooked when using /proc/config.gz. That’s the ā€œlocal versionā€. The /proc/config.gz will be a perfect start point for kernel build, except for that one setting. If CONFIG_LOCAL_VERSION is not set to the working ā€œuname -rā€ (with an added left hyphen), versioning might break.

Was LOCALVERSION set?

Thanks linuxdev,

i solved the problem, the modinfo shows only version 3.10.40. I had to add ā€œ-gc017b03ā€ in the .config file. Next step I write a tutorial an post it.

The other method is make with label ā€œKERNELVERSIONā€ instead of modify .config as below. It should be workable.
ā€œmake modules KERNELVERSION=3.10.40-gc017b03ā€