FTDI VCP driver on A20. How?

Started by forOliTri, February 11, 2015, 04:11:51 PM

Previous topic - Next topic

forOliTri

Hello,

FT232 board with 4 ports has been connected to A20 board into one of the USB ports, however there are no ttyUSBX devices in the system which told me that there is no FTDI driver installed.

I am using a Debian image downloaded from olimex site.

I downloaded the FTDI driver sources from the manufacturer website.
Downloaded the linux-sunxi sources using this guide (only the part No. 3): https://olimex.wordpress.com/2013/11/05/building-the-ultimate-debian-sd-card-for-linux-with-kernel-3-4-for-a20-olinuxino-micro/
Tried to compile the driver, but ended up with lots and lots of 'file not found'. I resolved the issues (i thought so) but then i got stuck at compile errors of lots of 'use of incomplete types' which actually came from linux source files.

I stopped trying to compile the driver as it was making me want to head-desk.

Then i read that FTDI CAN be enabled while building the whole linux from source through make ARCH=arm menuconfig.
So having those linux sources i downloaded earlier i thought i will give it a go. I found the driver entry in the menuconfig. It was listed as <M>. I'm not a linux expert, but i read <M> means it is a module and is not compiled with the rest of the system? Otherwise it would have been already enabled in the image i had, right??

So i tried to compile the linux sources ignoring the Part 1 and 2 of that guide, and of course it resulted in tons of errors.

I rebooted my head and started from scratch.
Wrote an image into flash card;
Downloaded linux sources;
Started reading guide from the beginning;
AND i stop right away.

apt-get update worked good, however
apt-get install gcc-4.7-arm-linux-gnueabihf told me there was no such package.
Running apt-get install gcc-*-arm-linux-gnueabihf had also negative results.

I then added deb http://www.emdebian.org/debian squeeze main to the sources.list.
Running
apt-get update told me
QuoteErr http://www.emdebian.org squeeze/main armhf Packages
  404  Not Found
Ign http://www.emdebian.org squeeze/main Translation-en_US
Ign http://www.emdebian.org squeeze/main Translation-en

so i am stuck. I can't compile linux sources because i don't have a tool chain. And i don't have a tool chain, because somebody moved the resouces to who know where.

Could somebody direct me to the recent guide on how to build Debian linux sources for the Olimex A20 board?

Everything i try, i end up in a dead end because either resources are moved, links no longer work, or i need to install packages which are not supported or have so many dependencies, that it will take 100 years to find all of them.

Gerrit

#1
It's not clear to me, are you trying to compile on the a20 or an other Linux system, and if so which one ?

The instructions you are following are for an other Linux, with a different architecture (not arm)

forOliTri

I am doing everything on a A20 through a ssh session using a putty from windows.

JohnS

#3
This
apt-get install gcc-4.7-arm-linux-gnueabihf
asks to install a cross compiler.

You probably already have gcc on the A20

Anything marked <M> does indeed mean module.  You may just need modprobe / insmod to load it.

You can check if it's already built.  I think its name is ftdio_sio.ko (ko being kernel object i.e. module) and it'll be in somewhere like /lib/modules/XXX/kernel/drivers/usb/serial where XXX is what uname -a shows is your version -- but just look under /lib/modules

John

jmyreen

#4
The ftdi_sio module depends on the usbserial (CONFIG_USB_SERIAL) module, so you need both modules. Doing a 'modprobe ftdi_sio' automatically loads both modules (if available). On the other hand, on a modern Linux this should be done automatically when the USB device is plugged in.

JohnS

Does lsusb even see it?  dmesg?

John

forOliTri

lsusb returned this:
QuoteBus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

dmesg | grep ftdi returned no results by default.
After i executed
modprobe ftdi_sio
dmesg now outputs
Quote[  606.221585] usbcore: registered new interface driver ftdi_sio
[  606.246135] ftdi_sio: v1.6.0:USB FTDI Serial Converters Driver

And now i confirm, the driver is there. I checked for the ftdi_sio.ko and it is present in
/lib/modules/XXX/kernel/drivers/usb/serial

The board is connected to mini-USB port on the Olimex A20 board.
I checked the /dev and there is no ttyUSB devices after the driver has been loaded.
Performing
find / -name ttyUSB*
returned no results either.

Wonder if it depends on the USB port, as this mini-USB port is set on auto mode and should automatically determine if its working as HOST or the DEVICE.

I'll give it a go and change that in the script.bin and set it to be the HOST only. Will see if that works out.

Thanks people. I spent several days trying to compile the driver and the linux itself and turns out it only takes 1 command to load the driver which already comes with the system :)

forOliTri

As i said, i have changed the mini-USB to work as a HOST only. After i rebooter the A20 i ran the dmesg command and the output was
Quote[    6.752275] usbcore: registered new interface driver ftdi_sio
[    6.777014] ftdi_sio 1-1:1.0: FTDI USB Serial Device converter detected
[    6.847254] ftdi_sio 1-1:1.1: FTDI USB Serial Device converter detected
[    6.914350] ftdi_sio 1-1:1.2: FTDI USB Serial Device converter detected
[    6.983120] ftdi_sio 1-1:1.3: FTDI USB Serial Device converter detected
[    7.047108] ftdi_sio: v1.6.0:USB FTDI Serial Converters Driver
So the previous 'modprobe' command actually loaded the driver and set it to be loaded on system start, correct?

Now i see all of the ttyUSB devices in /dev which i was looking for.

Thank you people! Couldn't have done it without your help.

JohnS

Good to hear!

(Not sure why it needed a reboot.)

John