How to cross compile kernel driver on iMX6S ?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to cross compile kernel driver on iMX6S ?

ソリューションへジャンプ
3,300件の閲覧回数
toanjunifer
Senior Contributor I

Hi,

I'm using iMX6S-EVK with kernel version 4.9.88. I'm writing some simple kernel driver. I also download kernel linux 4.9.88. But when I compile, I got this error: 

ERROR: Kernel configuration is invalid.
include/generated/autoconf.h or include/config/auto.conf are missing.
Run 'make oldconfig && make prepare' on kernel src to fix it.
WARNING: Symbol version dump ./Module.symvers
is missing; modules will have no dependencies and modversions.

CC [M] /home/user1/Desktop/exploringBB/extras/kernel/gpio_test/gpio_test.o
In file included from <command-line>:0:0:
././include/linux/kconfig.h:4:32: fatal error: generated/autoconf.h: No such file or directory
compilation terminated.

This is my Makefile: 

KERNEL ?= /home/user1/Desktop/linux
ARCH ?= arm
CROSS_COMPILE ?= arm-linux-gnueabihf-
obj-m+=hello.o

all:
make ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KERNEL) M=$(PWD) modules
clean:
make ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KERNEL) M=$(PWD) clean

I execute this command to build: 

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-

Did I missing something ? What should I do now ?

Thank you so much,

Toan

ラベル(1)
1 解決策
3,191件の閲覧回数
shivanipatel
Senior Contributor II

Hi toanjunifer@gmail.com‌,

You need to give a compiled kernel path in the "KERNEL" variable in your Makefile.

Do you have the yocto setup for i.MX6S EVK? If so then you need to give this path in your {yocto_build_dir}/tmp/work/imx6slevk-poky-linux-gnueabi/linux-imx/4.9.88-r0/build to KERNEL variable in Makefile. Then after try to compile your module.

Let us know in case of any concerns.

Hope this will help you.

Regards,

Shivani

元の投稿で解決策を見る

2 返答(返信)
3,192件の閲覧回数
shivanipatel
Senior Contributor II

Hi toanjunifer@gmail.com‌,

You need to give a compiled kernel path in the "KERNEL" variable in your Makefile.

Do you have the yocto setup for i.MX6S EVK? If so then you need to give this path in your {yocto_build_dir}/tmp/work/imx6slevk-poky-linux-gnueabi/linux-imx/4.9.88-r0/build to KERNEL variable in Makefile. Then after try to compile your module.

Let us know in case of any concerns.

Hope this will help you.

Regards,

Shivani

3,191件の閲覧回数
toanjunifer
Senior Contributor I

Hi shivanipatel‌,

Sorry for late response. I also done it like your guide.

Thank you so much.

Have a nice day !