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

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

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: https://developer.nvidia.com/linux-tegra-r213 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”