USB Host

From ArmadeusWiki
Revision as of 17:59, 29 June 2008 by JulienB (Talk | contribs) (Controller)

Jump to: navigation, search

How-To use the USB Host functionnality of Armadeus boards under Linux.

Controller

To use USB devices on your Armadeus board, you will need to have a USB Host controller on your development board.

Using USB devices

USB keyboard/mouse (HID: Human Interface Device)

Driver installation

Adding USB keyboard support

$ make linux-menuconfig
select Device Drivers ---> [*] HID Devices  ---> <*>   Generic HID support  (static)
select Device Drivers ---> [*] HID Devices  ---> <M>   USB Human Interface Device (full HID) support  (module)

Starting the driver

# modprobe usbhid

Plug the keyboard

  • you should see on console:
usb 1-1.1: new low speed USB device using isp1761 and address 3
usb 1-1.1: configuration #1 chosen from 1 choice
input: NOVATEK USB Keyboard as /class/input/input0
input: USB HID v1.10 Keyboard [NOVATEK USB Keyboard] on usb-platform-1.1
input: NOVATEK USB Keyboard as /class/input/input1
input: USB HID v1.10 Mouse [NOVATEK USB Keyboard] on usb-platform-1.1
  • To change keyboard keymap (by default us one):
# loadkmap < /etc/i18n/fr.kmap

Plug the mouse

  • you should see on console:
usb 1-1.2: new low speed USB device using isp1761 and address 6
usb 1-1.2: configuration #1 chosen from 1 choice
input: Logitech USB-PS/2 Optical Mouse as /class/input/input6
input: USB HID v1.10 Mouse [Logitech USB-PS/2 Optical Mouse] on usb-platform-1.2

USB Flash memory / USB key

Driver installation

Adding USB Flash support

$ make linux-menuconfig
select Device Drivers  ---> SCSI device support  ---> <*> SCSI device support         (static)
select Device Drivers  ---> SCSI device support  ---> [*] legacy /proc/scsi/ support  (static)
select Device Drivers  ---> SCSI device support  ---> <*> SCSI disk support           (static)
select Device Drivers  ---> [*] USB support  ---> [*]   USB device filesystem     (static)
select Device Drivers  ---> [*] USB support  ---> <*>   USB Mass Storage support  (static)

Starting the driver

  • if sda1 has not been previoulsy created
# mknod /dev/sda1 b 8 1
  • create a mount directory "memstick"
# mkdir -m 777 /mnt/memstick
  • mount the USB Flash device
# mount -t vfat /dev/sda1 /mnt/memstick
  • check what is present on the USB Flash device
# ls -al /mnt/memstick

USB Performances

A performance test has been performed by means of the usb_perf.sh script.
A high speed USB stick (corsair memory flash voyager) has been used.

Test result (mean values): read -> 2980 kBytes/sec   write -> 2095 kBytes/sec

The maximal bandwidth has been also measured by using a scope and by tranferring 4096 octets from the USBstick to a buffer of a kernel driver

Result: ~10Mo/sec  

Links