4

I'm trying to cross compile the FTDI VCP Driver for my embedded arch linux arm machine. I downloaded the source files from http://www.ftdichip.com/Drivers/VCP.htm onto my host machine which is running kernel:

2.6.32-54-generic-pae

When running the Makefile, I get errors related to kernel headers, ie: asm/thread_info.h file not found. I realize that this means that my asm symlink is broken, so I tried linking it to

linux-headers-2.6.32-54/include/asm-generic

but the contents of that directory does not include thread_info.h either, which I'm trying to find.

Has anyone cross compiled the FTDI VCP Driver for embedded arch linux arm using Ubuntu as their host and can point me in the right direction? I'm new to building kernel modules and cross compiling and any help would be appreciated.

If anyone requires more information I'd be more than happy to add it.

user3215598
  • 103
  • 1
  • 3
  • 9
  • What's your target kernel version? If it is also 2.6.32, then FTDI driver is already there and if it is not activated it must be activated via `make menuconfig`. – yegorich Jan 20 '14 at 15:48
  • My kernel version is 2.6.32. I know that it is already there and activated on my Ubuntu (host) machine, but I need to cross compile the driver to add usb to serial port functionality to my embedded linux machine (the target I'm cross compiling for). – user3215598 Jan 20 '14 at 15:51
  • Can I use make menuconfig to activate it on my embedded linux arm? I used dmesg to search for installed FTDI modules, but none exist. – user3215598 Jan 20 '14 at 15:52
  • You should be able to, check and see if it's in the source tree. Building something already there will likely be easier than trying to merge isolated vendor code back into your tree. – Chris Stratton Jan 20 '14 at 16:00
  • I have no experience with Arch Linux. But on embedded Debian you have `gcc` and other needed tools, so one can compile the kernel directly on the machine, but it will be very slow process. So normally you just have a toolchain on your host PC and you specify `ARCH` and `CROSS_COMPILE` env vars and do your `make menuconfig` and then `make`. – yegorich Jan 20 '14 at 16:01
  • Small [tutorial](https://romanrm.net/a10/cross-compile-kernel) for Kernel cross-compilation on Debian. See this [presentation](http://elinux.org/images/2/2a/Using-buildroot-real-project.pdf) too. – yegorich Jan 20 '14 at 16:03
  • @ChrisStratton I checked the kernel source tree, and the source files for the FTDI driver exist (in /drivers/usb/serial). How do I proceed to build the source files for my linux arm (Is there a way to configure this from my host machine)? I tried make menuconfig on the linux arm, but it says: "make: not found". – user3215598 Jan 20 '14 at 16:17
  • If you are not finding `make` it sounds like your host machine is not configured for development in even the most basic way, let alone dealing with cross compilation challenges. On a debian style distro you'd get make from the build-essential package, but your are going to have many configuration challenges to go before you can even cross compile the embedded system *without* making any changes to it. – Chris Stratton Jan 20 '14 at 17:03

3 Answers3

2

Basically u need cross-compile kernel in host x86 machine.

First check the source code is already configured and built if so.

make ARCH=arm menuconfig

window ll appear and enable ftdi in driver .

if source code is clean.

then u need to copy /proc/config.gz file from target machine to host and untar it.

copy to source top folder like `cp config .config'

make ARCH=arm menuconfig

and enable your driver After this make ARCH=arm CROSS_COMPILE=<your tool chain> zImage

e.g make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- zImage

make ARCH=arm CROSS_COMPILE=<your tool chain> modules

e.g make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- modules

vinay hunachyal
  • 3,781
  • 2
  • 20
  • 31
2

The FTDI "VCP" driver has been a part of the linux kernel for a good while now. You don't need to download anything, except for the kernel itself. As long as you can cross-compile your kernel, you're all set.

Kuba hasn't forgotten Monica
  • 95,931
  • 16
  • 151
  • 313
2

make ARCH=arm menuconfig

Make and install modules: make modules and make modules_install

Don't forget: insmod usbserial.ko and insmod ftdi_sio.ko if you need to, and depmod -a to have them load after a power cycle.

Don't forget to include your cross compiling chains.

diddles
  • 124
  • 6