Changes

Jump to: navigation, search

Physical devices mapping (XUELK)

1,349 bytes added, 13:36, 5 October 2016
no edit summary
[1] This type of cables forces the ID signal of the USB port to be connected to ground, selecting the host mode on SBC Lynx side.
===Device mode===
The following examples shows how to configure SBC Lynx to act as a mass storage device.
 
First, a local file named <code>mass</code> is created to emulate a mass storage disk that is populated with a file named <code>file.txt</code>:
<pre>
root@sbc-lynx:~# dd if=/dev/zero of=mass count=16 bs=1M
16+0 records in
16+0 records out
root@sbc-lynx:~# mkfs.msdos mass
mkfs.msdos 2.11 (12 Mar 2005)
root@sbc-lynx:~# mkdir loop
root@sbc-lynx:~# mount -o loop mass loop
root@sbc-lynx:~# echo dummy > loop/file.txt
root@sbc-lynx:~# umount loop
</pre>
Then the proper drivers are loaded on target side:
<pre>
root@sbc-lynx:~# insmod modules/libcomposite.ko
root@sbc-lynx:~# insmod modules/usb_f_mass_storage.ko
root@sbc-lynx:~# insmod modules/g_mass_storage.ko file=mass
Number of LUNs=8
Mass Storage Function, version: 2009/09/11
LUN: removable file: (no medium)
Number of LUNs=1
LUN: file: /home/root/mass
Number of LUNs=1
g_mass_storage gadget: Mass Storage Gadget, version: 2009/09/11
g_mass_storage gadget: userspace failed to provide iSerialNumber
g_mass_storage gadget: g_mass_storage ready
</pre>
Last, SBC Lynx is connected to a PC with a USB cable like this one:
 
[[File:USB-cable-micro-host-a.png|thumb|center|400px|USB cable used to connect SBC Lynx to PC]]
 
 
On PC side, SBC Lynx is detected as a common USB mass storage device.
4,650
edits

Navigation menu