Steps to do external compilation of hello-world module [ Apalis iMX6 ]

Hi ,
I am trying to do an compilation an simple hello-world module using the setup Yocto SDK for Apalis iMX6
( created by bitbake command i.e bitbake angstrom-lxde-image )

I am getting below mentioned error for hello world module

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/ashish/ashish_files/template/hello-world/hello.o
In file included from :0:0:
././include/linux/kconfig.h:4:32: fatal error: generated/autoconf.h: No such file or directory
compilation terminated.

The log & steps are attached in snapshot .
alt text

Rather than trying the kernel which has been build with OE, one should try the process described here. I have the below Makefile

CROSS_COMPILE ?= /home/sanchayan/Toradex/gcc-linaro/bin/arm-linux-gnueabihf-
ARCH          ?= arm
SOURCE_DIR    ?= /home/sanchayan/Toradex/linux-toradex

AS          = $(CROSS_COMPILE)as
LD          = $(CROSS_COMPILE)ld
CC          = $(CROSS_COMPILE)gcc
CPP         = $(CC) -E
AR          = $(CROSS_COMPILE)ar
NM          = $(CROSS_COMPILE)nm
STRIP       = $(CROSS_COMPILE)strip
OBJCOPY     = $(CROSS_COMPILE)objcopy
OBJDUMP     = $(CROSS_COMPILE)objdump

obj-m += hello_world.o
ccflags-y += -I$(SOURCE_DIR)/arch/arm

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

clean:
	rm *.o *.ko *.symvers *.order

The compilation output

 make
make ARCH=arm CROSS_COMPILE=/home/sanchayan/Toradex/gcc-linaro/bin/arm-linux-gnueabihf- -C /home/sanchayan/Toradex/linux-toradex M=/home/sanchayan/Toradex/Applications/hello_world modules
make[1]: Entering directory '/home/sanchayan/Toradex/linux-toradex'
  CC [M]  /home/sanchayan/Toradex/Applications/hello_world/hello_world.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /home/sanchayan/Toradex/Applications/hello_world/hello_world.mod.o
  LD [M]  /home/sanchayan/Toradex/Applications/hello_world/hello_world.ko
make[1]: Leaving directory '/home/sanchayan/Toradex/linux-toradex'

Thanks Sanchayan for pointer , would try this way & share the outcome

Dear Sanchayan ,

  1. Is there any other git repo / branch from where we can download Linux source code
    I am trying git clone -b toradex_4.1-2.0.x-imx git://git.toradex.com/linux-toradex.git, but it gets struck after Receiving object : 34%

  2. Will there be any counter action if the below mentioned steps (from the link you shared) are being executed at ~/oe-core/build/tmp-glibc/work-shared/apalis-imx6/kernel-source/include/?

Steps :-

make -j3 uImage LOADADDR=10008000 LD=${CROSS_COMPILE}ld.bfd 2>&1
make imx6q-apalis-ixora.dtb

Will there be any counter action if the below mentioned steps ( from the link you shared ) are being executed at ~/oe-core/build/tmp-glibc/work-shared/apalis-imx6/kernel-source/include/?

That would not be recommended.