DART-6UL USB OTG: Difference between revisions

From Variscite Wiki
No edit summary
Line 26: Line 26:
<br>
<br>
Example using the g_mass_storage module to expose the BOOT partition on our recovery SD card to a PC:<br>
Example using the g_mass_storage module to expose the BOOT partition on our recovery SD card to a PC:<br>
Connect a micro-A plug to Standard-A plug cable between the board and a PC, and run the following on the board:
Connect a micro-B plug to Standard-A plug cable between the board and a PC, and run the following on the board:
<pre>
<pre>
# umount /dev/mmcblk0p1
# umount /dev/mmcblk0p1

Revision as of 12:25, 18 September 2016

DART-6UL - USB "OTG"

Configuring the USB1 port under Linux

By default, the USB1 port is configured as host in the device tree, and a USB type-A receptacle is assembled on the VAR-MX7CustomBoard.
To use it as peripheral (OTG is not supported in the VAR-6ULCustomBoard) you need to change the value of the dr_mode property, under the usbotg1 node, in the imx6ul-var-dart.dtsi device tree, and assemble a USB Micro-AB receptacle at J23 on the bottom of the VAR-6ULCustomBoard.

For example:

  • Get the toolchain and the Linux source code by following the Build Linux from source code guide.
  • Edit arch/arm/boot/dts/imx6ul-var-dart.dtsi:
 &usbotg1 {
-       dr_mode = "host";
+       dr_mode = "peripheral";
	disable-over-current;
        status = "okay";
 };
  • Continue following the Build Linux from source code guide to build the device trees only and to copy them to your SD card.

Using the USB1 port under Linux

As host (default)

USB host

As peripheral

In order to use the board as a peripheral, an appropriate module needs to be loaded.
For example, there is an Ethernet gadget module called g_ether, and a mass storage gadget called g_mass_storage.

Example using the g_mass_storage module to expose the BOOT partition on our recovery SD card to a PC:
Connect a micro-B plug to Standard-A plug cable between the board and a PC, and run the following on the board:

# umount /dev/mmcblk0p1
# modprobe g_mass_storage file=/dev/mmcblk0p1

The partition should be loaded on the PC as a mass storage device.