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.

Cross compiling error, usb-serial functions not found

Hello,

I'm trying to compile some 3rd party drivers for the beaglebone black.  I can compile on my ubuntu 12.04 host system, and the driver modules work.

I modified the driver Makefile to include

BEAGLE_KDIR := ~/ti-sdk-am335x-evm-07.00.00.00/board-support/linux-3.12.10-ti2013.12.01/
BEAGLE_CCPREFIX := ~/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/i686-arago-linux/usr/bin/arm-linux-gnueabihf-
BEAGLE_OUTPUTDIR=~/ti-sdk-am335x-evm-07.00.00.00/targetNFS/lib/modules/3.12.10-ti2013.12.01/kernel/drivers/usb/serial

and added beagle options to the makefile

beagle:
$(MAKE) ARCH=arm CROSS_COMPILE=${BEAGLE_CCPREFIX}  -C $(BEAGLE_KDIR) M=$(PWD) modules

beagleinstall:
mkdir -p $(BEAGLE_OUTPUTDIR)
cp -f GobiSerial.ko $(BEAGLE_OUTPUTDIR)

unfortunately, when I run the make beagle, it can't find generic usb serial functions.

make ARCH=arm CROSS_COMPILE=~/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/i686-arago-linux/usr/bin/arm-linux-gnueabihf- -C ~/ti-sdk-am335x-evm-07.00.00.00/board-support/linux-3.12.10-ti2013.12.01/ M=/home/roedy/Cell_API/driver/GobiSerial modules
make[1]: Entering directory `/home/roedy/ti-sdk-am335x-evm-07.00.00.00/board-support/linux-3.12.10-ti2013.12.01'
Building modules, stage 2.
MODPOST 1 modules
WARNING: "usb_serial_resume" [/home/roedy/Cell_API/driver/GobiSerial/GobiSerial.ko] undefined!
WARNING: "usb_serial_deregister_drivers" [/home/roedy/Cell_API/driver/GobiSerial/GobiSerial.ko] undefined!
WARNING: "usb_serial_register_drivers" [/home/roedy/Cell_API/driver/GobiSerial/GobiSerial.ko] undefined!
WARNING: "usb_serial_generic_open" [/home/roedy/Cell_API/driver/GobiSerial/GobiSerial.ko] undefined!
WARNING: "usb_serial_suspend" [/home/roedy/Cell_API/driver/GobiSerial/GobiSerial.ko] undefined!
make[1]: Leaving directory `/home/roedy/ti-sdk-am335x-evm-07.00.00.00/board-support/linux-3.12.10-ti2013.12.01'

These functions that are missing are declared in the BEAGLE_KDIR/include/linux/usb/serial.h  file.

Any suggestions as to how to get this compiled?

Thanks

  • Hi Chris,

    This "undefined" issue is due to un-exported symbols of linux driver API used in module driver.

    Try to export those undefined APIs in driver.

    Ex:

    ti-sdk-am335x-evm-07.00.00.00/board-support/linux-3.12.10-ti2013.12.01/include/linux/usb/serial.h

    ti-sdk-am335x-evm-07.00.00.00/board-support/linux-3.12.10-ti2013.12.01/drivers/usb/serial/usb-serial

    These functions that are missing are declared in the BEAGLE_KDIR/include/linux/usb/serial.h  file.

    The above files have support for API "usb_serial_resume"


    Please make sure that you have compiled the linux kernel with usb serial support.

  • Hi Titus,

    I'm not sure I'm doing this correctly.

    I went to the linux directory, set ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- and the path for the SDK compiler

    I ran:
    make tisdk_am335x-evm_defconfig
    make menuconfig
        -> enabled the usb serial converter as built in
              ->enabled usb generic serial simple and usb simple serial

    save changes to .config

    then went to <tisdk_root_dir> and ran
    make linux

    when I rebooted the beaglebone and ran lsmod I did not see the serial drivers... also when I went back into the menuconfig it looks like the usb serial driver changes I made had been overwritten

    Is it possible the running the "make linux" command from the sdk over wrote my kernel changes and wrote the tisdk_am335x-evm_defconfig instead?

  • Hi Titus,

    I reran the steps

     make tisdk_am335x-evm_defconfig
    make menuconfig

    then after I saved the changes, I saved the .config file as ./arch/arm/configs/tisdk_am335x-evm_defconfig

    I went back to the tisdk root and ran

    make clean
    make

    Then I was able to build the drivers correctly.

    then I manually copied the zImage from the arch/arm/boot folder to /tftpboot/zImage-am335x-evm.bin and rebooted the beaglbone

    I had to manually insert the drivers
    insmod /lib/modules<etc/etc>/GobiSerial.ko and GobiNet.ko 

    and when I plugged in my cell device I kernel messages that the device was found and the drivers were loaded.  I'm a little confused as to why a 
     modinfo GobiSerial  results in 
    ERROR: Module GobiSerial not found.

    Is there any way I can take these drivers and build them into the linux kernel so I don't have to manually insert them?

  • Hi Chris,

    Yes you can have the driver as inbuilt with kernel by modifying the Makefile and Kconfig file of "driver/usb/serial" location.

    After that you have to select "*" for that driver option and "M" for loadable module.

    Try "lsmod" command to check loadable modules or available or not.

  • Hi Titus,  

    When I mentioned the built in drivers, I was referring to the 3rd party drivers that I have.  How can I compile them into the kernel?

    I noticed the modules.builtin file located in the <kernel>/drivers folder with a list of .ko modules that I assume are the modules built into the kernel.

    Can I, for example, drop my usb serial .ko file into the kernel/drivers/usb/serial/ folder and then just include it on the modules.builtin?

  • Hi Chris,

    As I told you earlier,

    You have to put one entry for your 3rd party driver into the kernel location of "driver/usb/serial" by modifying the Makefile and Kconfig.

    You have to put new entry in Makefile for the driver file and need to create help and description and driver depend settings into Kconfig file.

    http://processors.wiki.ti.com/index.php/TI-Android-DevKit-Camera_Porting_Guide#Adding_Camera_Module_to_Linux_Kernel

    http://stackoverflow.com/questions/11710022/adding-new-driver-code-to-linux-source-code

  • Thanks Titus.  Sorry I'm still a linux newbie.  You've been a great help!