Open main menu

DAVE Developer's Wiki β

Changes

DESK-MX8M-L/Peripherals/USB2 OTG

2,548 bytes added, 14:42, 16 February 2023
no edit summary
===Accessing the peripheral SBC ORCA===
====Linux messages at boot time in host mode====
When a USB 2.0 peripheral is inserted, in the following example a memory mass storage device, the kernel recognizes the device (i.e. class, vendor id, product id, etc.)
</pre>
==== Usage in device mode with [https://www.kernel.org/doc/Documentation/usb/mass-storage.txt mass-storage] ==== <pre class="workstation-terminal">root@desk-mx8mp:~# dd if=/dev/zero of=mass_storage count=256 bs=1M256+0 records in256+0 records out268435456 bytes (268 MB, 256 MiB) copied, 16.173 s, 16.6 MB/sroot@desk-mx8mp:~# mkfs.msdos mass_storagemkfs.fat 4.1 (2017-01-24)root@desk-mx8mp:~# mkdir looproot@desk-mx8mp:~# mount -o loop mass_storage looproot@desk-mx8mp:~# echo "Test USB OTG with mass storage device" > loop/usb.txtroot@desk-mx8mp:~# umount looproot@desk-mx8mp:~# </pre> then insert the <code>g_mass_storage</code> kernel module driver enabling an Windows PC to see it as a ''removable device'' <pre class="workstation-terminal">root@desk-mx8mp:~# modprobe g_mass_storage removable=y file=mass_storage[ 1492.938536] Mass Storage Function, version: 2009/09/11[ 1492.943718] LUN: removable file: (no medium)[ 1492.948194] LUN: removable file: /home/root/mass_storage[ 1492.953574] Number of LUNs=1[ 1492.956850] g_mass_storage gadget: Mass Storage Gadget, version: 2009/09/11[ 1492.963863] g_mass_storage gadget: userspace failed to provide iSerialNumber[ 1492.970944] g_mass_storage gadget: g_mass_storage readyroot@desk-mx8mm:~#</pre> Once the USB cable is connected to the PC, the kernel prints the following messages: <pre class="workstation-terminal">root@desk-mx8mp:~# [ 1493.477167] g_mass_storage gadget: high-speed config #1: Linux File-Backed Storage</pre> and the Windows PC activate the driver and the disk is available as a Drive Unit (with the ''usb.txt'' file available). ===Accessing the peripheral MITO 8M Mini=== ====Linux messages==== When a USB 2.0 peripheral is inserted, in the following example a memory mass storage device, the kernel recognizes the device (i.e. class, vendor id, product id, etc.) <pre class="workstation-terminal">root@desk-mx8mm:~# [ 22.858909] usb 1-1: new high-speed USB device number 2 using ci_hdrc[ 23.022240] usb-storage 1-1:1.0: USB Mass Storage device detected[ 23.028819] scsi host0: usb-storage 1-1:1.0[ 24.045317] scsi 0:0:0:0: Direct-Access SanDisk Cruzer Force 1.00 PQ: 0 ANSI: 6[ 24.055280] sd 0:0:0:0: [sda] 60088320 512-byte logical blocks: (30.8 GB/28.7 GiB)[ 24.063993] sd 0:0:0:0: [sda] Write Protect is off[ 24.069617] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA[ 24.142194] sda: sda1[ 24.150358] sd 0:0:0:0: [sda] Attached SCSI removable disk</pre>  === Additional information in host mode ===
If the root file system configuration does not automatically mount the partition, it is possible to mount the device using the following command:
-rwxr-xr-x 1 root root 531 Nov 17 15:27 settings.txt
</pre>
 
<section end=Body/>
dave_user
427
edits