This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

What is wrong in this module build?

Hi,

I want to build a module for Sitara Processor SDK 1.00.00.03 on Ubuntu PC. The make error message is as following:

uj@uj-7696:~/Documents/Linux_drv$ make
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -C /home/u64rj/ti-processor-sdk-linux-am335x-evm-01.00.00.03/board-support/linux-3.14.43+gitAUTOINC+875c69b2c3-g875c69b M=`pwd` modules -I/home/u64rj/AM335X_StarterWare_02_00_01_01/include/hw 
make[1]: Entering directory `/home/u64rj/ti-processor-sdk-linux-am335x-evm-01.00.00.03/board-support/linux-3.14.43+gitAUTOINC+875c69b2c3-g875c69b'

  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 /home/u64rj/ti-processor-sdk-linux-am335x-evm-01.00.00.03/board-support/linux-3.14.43+gitAUTOINC+875c69b2c3-g875c69b/Module.symvers
           is missing; modules will have no dependencies and modversions.

  CC [M]  /home/u64rj/Documents/Linux_drv/hello_mdvr.o
In file included from <command-line>:0:0:
/home/u64rj/ti-processor-sdk-linux-am335x-evm-01.00.00.03/board-support/linux-3.14.43+gitAUTOINC+875c69b2c3-g875c69b/include/linux/kconfig.h:4:32: fatal error: generated/autoconf.h: No such file or directory
compilation terminated.
make[2]: *** [/home/u64rj/Documents/Linux_drv/hello_mdvr.o] Error 1
make[1]: *** [_module_/home/u64rj/Documents/Linux_drv] Error 2
make[1]: Leaving directory `/home/u64rj/ti-processor-sdk-linux-am335x-evm-01.00.00.03/board-support/linux-3.14.43+gitAUTOINC+875c69b2c3-g875c69b'
make: *** [all] Error 2
uj@uj-7696:~/Documents/Linux_drv$ ls -l
total 12
-rw-rw-r-- 1 u64rj u64rj 2939 Sep 22 19:46 hello_mdvr.c
-rw-rw-r-- 1 u64rj u64rj  593 Sep 22 20:25 Makefile
-rw-rw-r-- 1 u64rj u64rj  592 Sep 22 20:23 Makefile~
uj@uj-7696:~/Documents/Linux_drv$ 

Sitara StarterWare is downloaded and its header file path is included in the Makefile:

#PATH=${PATH}:/home/uj/ti-processor-sdk-linux-am335x-evm-01.00.00.03/linux-devkit/sysroots/i686-arago-linux/usr/bin
obj-m += hello_mdvr.o
INC=-I/home/u64rj/AM335X_StarterWare_02_00_01_01/include/hw
all:
	make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -C /home/uj/ti-processor-sdk-linux-am335x-evm-01.00.00.03/board-support/linux-3.14.43+gitAUTOINC+875c69b2c3-g875c69b M=`pwd` modules $(INC) 

clean:
	make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -C /home/uj/ti-processor-sdk-linux-am335x-evm-01.00.00.03/board-support/linux-3.14.43+gitAUTOINC+875c69b2c3-g875c69b M=`pwd` clean

There are two header files missing from the error message. How can I fix it?

Thanks,

  • Now it turns out make cannot find the header file even though it is set by '-I' in the Makefile. Here is the Makefile:

    obj-m += hello_mdvr.o
    export INC=-I /home/u64rj/AM335X_StarterWare_02_00_01_01/include/hw
    all:
    	make ARCH=arm CROSS_COMPILE=/home/u64rj/ti-processor-sdk-linux-am335x-evm-01.00.00.03/linux-devkit/sysroots/i686-arago-linux/usr/bin/arm-linux-gnueabihf- -C /home/u64rj/ti-processor-sdk-linux-am335x-evm-01.00.00.03/board-support/linux-3.14.43+gitAUTOINC+875c69b2c3-g875c69b/ M=`pwd` modules $(INC) 
    
    clean:
    	make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -C /home/u64rj/ti-processor-sdk-linux-am335x-evm-01.00.00.03/board-support/linux-3.14.43+gitAUTOINC+875c69b2c3-g875c69b/ M=`pwd` clean

    On the echo message, make utility enters to Linux source directory. Then it cannot find the header file. This is a Linux shell or something issue. I don't know how to let 'make' utility remember the set header file path. Could you help?

    Thanks,

  • Hi Jeff,
    Did you build the following kernel source code ?
    /home/u64rj/ti-processor-sdk-linux-am335x-evm-01.00.00.03/board-support/linux-3.14.43+gitAUTOINC+875c69b2c3-g875c69b

    You can build the module drivers once you built the kernel source.
  • Yes, after build the kernel, the first error (yesterday post) was gone.
    The new problem is on header file. On line search shows that it relates to kbuild, but I don't find a solution yet. A general Makefile doesn't work any more. A further complicate thing is here is cross build, which is different from some examples.
    Thanks,
  • Hi Jeff,
    What do you have on this file "hello_mdvr.c" ?
    Its just simple driver ?
    Write some printks and compile it and see.

    You have to copy those soc_AM335x.h files into linux include structure and need to modify the hello_mdvr.c as well.

    I think, you are trying to build the starterware code with linux ?
  • Could you point me a link with an example on Sitara AM335x Starter Kit? There are some posts on the forum, but they are for different boards which had different folder structures from the new processor SDK 1.00.00.03.

    What folder should I work on a reloadable module? A StarterWare header is used and I don't find a way to make the module build accept the header path yet. Thanks,

  • 4035.hello_mdvr.c

    The source .c file is from the forum. I hope that is a starting point for me. The problem looks like at the build file stuff setting. Thanks,

  • Hi, Titusrathinaraj:

    I see one of your post on the forum:

    It is very useful to my project. When I follow it, the problem is from an external header file form Sitara StarterWare kit soc_AM335x.h.

    The makefile content is:

    obj-m += hello_mdvr.o
    export INC=-I /home/u64rj/AM335X_StarterWare_02_00_01_01/include/hw
    all:
        make ARCH=arm CROSS_COMPILE=/home/u64rj/ti-processor-sdk-linux-am335x-evm-01.00.00.03/linux-devkit/sysroots/i686-arago-linux/usr/bin/arm-linux-gnueabihf- -C /home/u64rj/ti-processor-sdk-linux-am335x-evm-01.00.00.03/board-support/linux-3.14.43+gitAUTOINC+875c69b2c3-g875c69b/ M=`pwd` modules $(INC)

    clean:
        make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -C /home/u64rj/ti-processor-sdk-linux-am335x-evm-01.00.00.03/board-support/linux-3.14.43+gitAUTOINC+875c69b2c3-g875c69b/ M=`pwd` clean

    Some on-line posts said it needs Kbuild to include the header file information, but I don't know how to do it. I don't see it used in your past post:

    Here is the error message:

    Hopefully you can direct me to solve this problem.

    Thanks,