I want to tryout different MIPI-DSI displays on the I.MX8M MINI EVK board with pre build linux kernel: 5.15.71+g3313732e9984. therefore i want to compile different drivers on the EVK board. for example i aded:
panel-ilitek-ili9881c.c
Makefile:
obj-m += panel-ilitek-ili9881c.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
To be able to compile the driver for the imx8 processor. but everytime i get an: "make: *** No targets. Stop." error.
I also tried to compile a driver module on a ubuntu system with linux5.15.0-60-generic kernel. the driver compilation goes right but if want to add it in the imx8mm it says:
root@imx8mmevk:"# insmod ili9881c.ko
[15633.739185] Invalid architecture in ELF header: 62
insmod: ERROR: could not insert module ili9881c.ko: Invalid module format
Is it even possible to add driver.c files and compile them on the processor or do i need to do something else.
Hello,
The file is not compiled a for 5.15.71 or not compiler for arm 64bits, please check it.
Regards
Hello,
Thanks for your reply! Yes you are right i compiled it with linux 5.15.0-60 kernel. i try to install linux-headers-5.15.71 but i get get:
$ apt search linux-headers-5.15.71
Sorting... Done
Full Text Search... Done.
$ sudo apt install linux-headers-5.15.71
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package linux-headers-5.15.71
E: Couldn't find any package by glob 'linux-headers-5.15.71'
is there a way to install those headers to be able to compile a driver for the linux kernel running on my imx8mmevk?
Update:
I manage to compile the module with a linux kernel 5.15.71 on a linux machine with ubuntu installed. but still get the error:
# insmod ili9881c.ko
[ 1139.309754] Invalid architecture in ELF header: 62
insmod: ERROR: could not insert module ili9881c.ko: Invalid module format
Do you compile the driver just with the GCC for the PC (AMD/Intel architecure) or did you switch to the toolchain for Arm64. The kernel version is relevant, but in a first step the toolchain must be the right one.
Regards,
Bernhard.
Thanks for the suggestion,
I am trying to compile with the Arm64 toolchain but if i want to compile my driver i get this error:
$ make
make -C /usr/src/linux-headers-5.15.71-051571-generic M=/home/user/Documents/LDD/ili9881c modules
make[1]: Entering directory '/usr/src/linux-headers-5.15.71-051571-generic'
warning: the compiler differs from the one used to build the kernel
The kernel was built by: gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0
You are using: aarch64-linux-gnu-gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
CC [M] /home/user/Documents/LDD/ili9881c/ili9881c.o
aarch64-linux-gnu-gcc: error: unrecognized command-line option ‘-mrecord-mcount’
make[1]: Leaving directory '/usr/src/linux-headers-5.15.71-051571-generic'
make: *** [Makefile:12: all] Error 2
There still seems to be a setup mismatch between the host (= your PC) and the target (= i.MX 8M). I need to check more details on my Linux machine.
Our recommendation for an i.MX8 toolchain (SDK) is this one:
Follow this guide for a build of imx-image-full: (it can take long, depending on you machine, a build for imx-image-core would work as well for the toolchain generation)
https://www.nxp.com/docs/en/user-guide/IMX_YOCTO_PROJECT_USERS_GUIDE.pdf
Then use "bitbake imx-image-full -c populate_sdk".
Install SDK:
tmp/deploy/sdk/xxx.sh
Do before using SDK:
source /opt/fsl-imx-xwayland/xxx/environment-setup-aarch64-xxxx
If I do this, then I'm able to compile a Hello World which runs fine on the i.MX8M.
Regards,
Bernhard.
thanks for your reply,
I followed the i.MX Yocto Project User's Guide but i'm stuck again.
If i use bitbake i get the following error:
$ bitbake imx-image-full -c populate_sdk
Traceback (most recent call last):
File "/home/danny/imx-yocto-bsp/sources/poky/bitbake/bin/bitbake", line 21, in <module>
import bb
^^^^^^^^^
File "/home/danny/imx-yocto-bsp/sources/poky/bitbake/lib/bb/__init__.py", line 135, in <module>
from bb import fetch2 as fetch
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/danny/imx-yocto-bsp/sources/poky/bitbake/lib/bb/fetch2/__init__.py", line 26, in <module>
import bb.persist_data, bb.utils
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/danny/imx-yocto-bsp/sources/poky/bitbake/lib/bb/persist_data.py", line 20, in <module>
import sqlite3
^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/sqlite3/__init__.py", line 57, in <module>
from sqlite3.dbapi2 import *
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/sqlite3/dbapi2.py", line 27, in <module>
from _sqlite3 import *
^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named '_sqlite3'
sqlite seems to be installed,, i tried to install:
$ sudo apt-get install -y libsqlite3-dev
[sudo] password for danny:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package libsqlite3-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'libsqlite3-dev' has no installation candidate
Is there a sollution for this i cant find anything on internet.
Did you do this in two steps:
$ bitbake imx-image-full
$ bitbake imx-image-full -c populate_sdk
or
$ bitbake imx-image-core
$ bitbake imx-image-core -c populate_sdk
One reason for problems:
Unfortunately the RAM requirements for a full build are quite high, from time to time you run into build errors caused by underflows/overflows of the build setup with rather strange and misleading error messages.
Other reasons:
Python is also one of the topics generating problems from time to time, but in general problems like the one you experience are caused by a wrong Linux setup on the build machine.
I made good experience with Ubuntu 20.04 and 22.04. Still recommended from our side is 20.04, but so far I had no problems with 22.04, except one Python mismatch.
I detected one thread with the same error patter and it was solved by installing a clean build setup:
https://community.nxp.com/t5/i-MX-Processors/Bitbake-failing-to-build/m-p/688733
Regards,
Bernhard.
A reinstall of ubuntu did the job!
thanks!