Mounting an USB drive on the DM365 Leopard Board

From RidgeRun Developer Connection
Jump to: navigation, search

LeopardBoard 365 USB Host Examples

USB Host Hardware Setup

Leopardboard v1.3 and newer supports USB device mode and host mode. The hardware ships from the factory set to device mode.

For host mode, you need to make sure J1 and J4 are set properly. These jumpers are located on the opposite side of the board as the USB connector. For host mode, install a jumper on J1 pins 1 and 2. On J4, jumper pins 2 and 3. J4 pin 3 is the pin closest to R31.

When J2 pins 1 and 2 are jumpered then the Leopardboard powers the USB VBUS, so the USB device connected to the Leopardboard will have power.

When J4 pins 2 and 3 are jumpered, the USB ID signal is pulled low.

To use common USB devices, a USB A Female to Mini B Male converter is needed.

USB Mass Storage Device Example

In order to do this an USB A Female to Mini B Male converter is needed. Connect the converter to the board and then the USB drive to the A female side. The USB drive mounting point will be /dev/sda1 so in order to explore the drive contents the following commands must be executed on the target:

cat /proc/partitions
mkdir /tmp/drive
mount /dev/sda1 /tmp/drive
cd /tmp/drive

Example output

Plug in the USB mass storage device:

usb 1-1: new high speed USB device using musb_hdrc and address 2
usb 1-1: configuration #1 chosen from 1 choice
scsi0 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 2
usb-storage: waiting for device to settle before scanning
scsi 0:0:0:0: Direct-Access     Memorex  TD Classic 003C  1.04 PQ: 0 ANSI: 0 CCS
sd 0:0:0:0: [sda] 501760 512-byte logical blocks: (256 MB/245 MiB)
sd 0:0:0:0: [sda] Write Protect is off
usb-storage: device scan complete
sd 0:0:0:0: [sda] Mode Sense: 23 00 00 00
sd 0:0:0:0: [sda] Assuming drive cache: write through
device: 'sda': device_add
sd 0:0:0:0: [sda] Assuming drive cache: write through
 sda: sda1
sd 0:0:0:0: [sda] Assuming drive cache: write through
sd 0:0:0:0: [sda] Attached SCSI removable disk

Output when running the suggested commands:

/ # cat /proc/partitions
major minor  #blocks  name

  31        0       3968 mtdblock0
  31        1        128 mtdblock1
  31        2       4480 mtdblock2
  31        3     204800 mtdblock3
   8        0     250880 sda
   8        1     250864 sda1
/ # mkdir /tmp/drive
/ # mount /dev/sda1 /tmp/drive
/ # mount
rootfs on / type rootfs (rw)
/dev/root on / type nfs (rw,noatime,vers=2,rsize=4096,wsize=4096,namlen=255,hard,nolock,proto=udp,port=65535,timeo=11,retrans=3,sec=sys,addr=
proc on /proc type proc (rw,relatime)
none on /sys type sysfs (rw,relatime)
none on /tmp type tmpfs (rw,relatime)
none on /var type tmpfs (rw,relatime)
none on /dev type tmpfs (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620)
/dev/sda1 on /tmp/drive type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1,errors=remount-ro)
/ # cd /tmp/drive
/tmp/drive # ls
dvflashutils          normal-123-nand