PLEASE NOTE: This article is obsolete or related to a discontinued product.

USB memory key

FOX Board has two USB 1.1 host connectors where it is possible to plug USB memory keys, Digital cameras, iPods, PSPs, MP3 players, USB disk drivers and any device that works like an USB memory device. This article show how to mount and use them

To check what happen when we insert an USB memory key type this command from a telnet session:

# tail -f /var/log/messages

In this way it will be possible to see the Kernel messages to see if all is running correctly. The messages that should appear are as follows:

kernel: drivers/usb/host/hc_crisv10.c: USB controller in host mode.
kernel: drivers/usb/host/hc_crisv10.c: USB controller started.
kernel: drivers/usb/host/hc_crisv10.c: USB controller in host mode.
kernel: drivers/usb/host/hc_crisv10.c: USB controller started.
kernel: drivers/usb/host/hc_crisv10.c: USB controller running.
kernel: usb 1-2: new full speed USB device using ETRAX 100LX and address 2
kernel: scsi0 : SCSI emulation for USB Mass Storage devices
kernel:   Vendor: USB Mass  Model:  Storage Drive 2  Rev: 002 
kernel:   Type:   Direct-Access                      ANSI SCSI revision: 02
kernel: SCSI device sda: 503808 512-byte hdwr sectors (258 MB)
kernel: sda: Write Protect is off
kernel: sda: assuming drive cache: write through
kernel: SCSI device sda: 503808 512-byte hdwr sectors (258 MB)
kernel: sda: Write Protect is off
kernel: sda: assuming drive cache: write through
kernel:  sda: sda1
kernel: Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0

From those messages you can see that the USB memory key has been correctly identified and assigned to the device /dev/sda.

To be able to have access the memory file system you have to mount the partition /dev/sda1 on the /mnt/1 folder typing:

# mount -t vfat /dev/sda1 /mnt/1

Now you can have access to the USB memory key file system starting from the /mnt/1 folder:

# cd /mnt/1
# ls
...

To see how many memory space is available on the USB memory key type:

# df
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/flash3               5032      5032         0 100% /
/dev/flash2                640       240       400  38% /mnt/flash
tmpfs                     6984        72      6912   1% /var
/dev/sda1               253156         0    253156   0% /mnt/1
In this case a 256MB memory key has been used.

To remove a memory key, exit from the key file systems and unmount it typing:

# cd /
# umount /mnt/1
# df
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/flash3               5032      5032         0 100% /
/dev/flash2                640       240       400  38% /mnt/flash
tmpfs                     6984        72      6912   1% /var

Mount automaticaly a memory key at the boot time

There is the special folder /etc/init.d/boottime where to save bash scripts to start at boot time. To create an automatic mount script type:
# cd /etc/init.d/boottime
# echo "mount -t vfat /dev/sda1 /mnt/1" > usbmount.sh
# cat usbmount.sh
mount -t vfat /dev/sda1 /mnt/1
# chmod +x usbmount.sh
Insert the memory key and reboot.

Unfortunately the fstab method doesn't work because at the startup it is managed before the the USB devices acknoledge.