Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm using Buildroot for compiling embedded linux. It works well because I have target Makefile configurations, but now I need driver for my usb devices. I manage to compile Qt appilactions(c++) on my host linux to target linux by using buildroots /output/host/usr/bin/arm-none-linux-gnueabi-c++ . Works well.

Now I'm trying to compile c-files for this driver http://www.ftdichip.com/Drivers/VCP.htm

I'm calling it like

 /output/host/usr/bin/arm-none-linux-gnueabi-gcc -Wall -D__KERNEL__ -DMODULE -I/home/buildroot-2012.08/output/build/linux-2.6.35.3/include -DMODVERSIONS -include /home/buildroot-2012.08/output/build/linux-2.6.35.3/include/config/modversions.h -I /home/buildroot-2012.08/output/build/linux-2.6.35.3/drivers/usb/serial/ -O   -c -o ftdi_sio.o ftdi_sio.c

Now I'm getting error: output/build/linux-2.6.35.3/include/linux/linkage.h:5: fatal error: asm/linkage.h: No such file or directory

  1. How I should configurate the driver compiling?
  2. Is there some other way to do it for target linux. Mayby I'm not doing it the right way.
share|improve this question
    
Buildroot is an integrated build environment, so you better take a look how to create a recipe for kernel module to integrate it to kernel build process. There is no point in using Buildroot if you still compile applications, kernel modules manually. –  KBart Oct 23 '13 at 10:10
add comment

1 Answer

up vote 2 down vote accepted

asm/ is a symbolic link to your target architecture, if it doesn't exist probably you're missing some target in your kernel build directory, configure (if not, maybe just module_headers can make it)

It is not clear from your question if you're using the command line, a custom Makefile, or a Buildroot package (which version of Buildroot are you using).

Your command line is building a C object .o not a kernel module (.o was the extension for kernel modules till the version 2.4, from 2.6 it is .ko)

If you are not sure about the flags increase the verbosity for the build of the kernel modules, build and log, then use the same.

The kernel have its way to build modules and the Buildroot have its way for packages, the best is probably to create a new package to build your module (take a look if there's already some other package that build a module).

This example is a bit old but maybe help.

edit

The ftdi_sio.ko module is generated into the directory /lib/modules/$(uname -r)/kernel/drivers/usb/serial/

But it could be configured as builtin also, so that no .ko is generated, check the symbol USB_SERIAL_FTDI_SIO in your configuration (should be y for builtin m for module).

If it is builtin or inserted there should be a /proc interface at runtime on the target called ftdi_sio, find it.

share|improve this answer
    
thanks. I will try the buildroot package –  user257980 Oct 23 '13 at 4:36
    
It looks like that driver should be FTDI USB UART built in to kernel. How I can check that on buildroot? –  user257980 Oct 23 '13 at 6:00
    
Looks like its on output also, /buildroot-2012.08/output/build/linux-2.6.35.3/drivers/usb/serial/ftdi_sio.c But how it's not on the target distor? –  user257980 Oct 23 '13 at 6:09
    
I mange to install it and added it by # modprobe ftdi_sio vendor=0x0403 product=0x6001, but I can't get any infromation from ttyUSB0 –  user257980 Oct 23 '13 at 13:45
    
That's another question :) see here and here hope it help. sertest.c. –  Alex Oct 23 '13 at 13:54
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.