Changeset View
Changeset View
Standalone View
Standalone View
head/en_US.ISO8859-1/books/handbook/usb-device-mode/chapter.xml
Show First 20 Lines • Show All 121 Lines • ▼ Show 20 Lines | <chapter xmlns="http://docbook.org/ns/docbook" | ||||
Microsoft Windows 10 without the need for special drivers | Microsoft Windows 10 without the need for special drivers | ||||
and INF files. Other host operating systems work with all | and INF files. Other host operating systems work with all | ||||
three templates. Both &man.usb.template.4; and &man.umodem.4; | three templates. Both &man.usb.template.4; and &man.umodem.4; | ||||
kernel modules must be loaded.</para> | kernel modules must be loaded.</para> | ||||
<para>To enable USB device mode serial ports, add those lines | <para>To enable USB device mode serial ports, add those lines | ||||
to <filename>/etc/ttys</filename>:</para> | to <filename>/etc/ttys</filename>:</para> | ||||
<screen>ttyU0 "/usr/libexec/getty 3wire" vt100 onifconsole secure | <programlisting>ttyU0 "/usr/libexec/getty 3wire" vt100 onifconsole secure | ||||
ttyU1 "/usr/libexec/getty 3wire" vt100 onifconsole secure</screen> | ttyU1 "/usr/libexec/getty 3wire" vt100 onifconsole secure</programlisting> | ||||
<para>Then add these lines to | <para>Then add these lines to | ||||
<filename>/etc/devd.conf</filename>:</para> | <filename>/etc/devd.conf</filename>:</para> | ||||
<screen>notify 100 { | <programlisting>notify 100 { | ||||
match "system" "DEVFS"; | match "system" "DEVFS"; | ||||
match "subsystem" "CDEV"; | match "subsystem" "CDEV"; | ||||
match "type" "CREATE"; | match "type" "CREATE"; | ||||
match "cdev" "ttyU[0-9]+"; | match "cdev" "ttyU[0-9]+"; | ||||
action "/sbin/init q"; | action "/sbin/init q"; | ||||
};</screen> | };</programlisting> | ||||
<para>Reload the configuration if | <para>Reload the configuration if | ||||
&man.devd.8; is already running:</para> | &man.devd.8; is already running:</para> | ||||
<screen>&prompt.root; <userinput>service devd restart</userinput></screen> | <screen>&prompt.root; <userinput>service devd restart</userinput></screen> | ||||
<para>Make sure the necessary modules are loaded and the | <para>Make sure the necessary modules are loaded and the | ||||
correct template is set at boot by adding | correct template is set at boot by adding | ||||
Show All 19 Lines | &prompt.root; <userinput>sysctl hw.usb.template=3</userinput></screen> | ||||
mode serial ports, connect the USB host, such as a laptop, to | mode serial ports, connect the USB host, such as a laptop, to | ||||
the boards USB OTG or USB client port. Use | the boards USB OTG or USB client port. Use | ||||
<command>pstat -t</command> on the host to list the terminal | <command>pstat -t</command> on the host to list the terminal | ||||
lines. Near the end of the list you should see a USB serial | lines. Near the end of the list you should see a USB serial | ||||
port, eg "ttyU0". To open the connection, use:</para> | port, eg "ttyU0". To open the connection, use:</para> | ||||
<screen>&prompt.root; <userinput>cu -l /dev/ttyU0</userinput></screen> | <screen>&prompt.root; <userinput>cu -l /dev/ttyU0</userinput></screen> | ||||
<para>After pressing the Enter key a few times you will see | <para>After pressing the <keycap>Enter</keycap> key a few times you will see | ||||
a login prompt.</para> | a login prompt.</para> | ||||
</sect2> | </sect2> | ||||
<sect2> | <sect2> | ||||
<title>Connecting to USB Device Mode Serial Ports from | <title>Connecting to USB Device Mode Serial Ports from | ||||
macOS</title> | &macos;</title> | ||||
<para>To connect to a board configured to provide USB device | <para>To connect to a board configured to provide USB device | ||||
mode serial ports, connect the USB host, such as a laptop, | mode serial ports, connect the USB host, such as a laptop, | ||||
to the boards USB OTG or USB client port. To open the | to the boards USB OTG or USB client port. To open the | ||||
connection, use:</para> | connection, use:</para> | ||||
<screen>&prompt.root; <userinput>cu -l /dev/cu.usbmodemFreeBSD1</userinput></screen> | <screen>&prompt.root; <userinput>cu -l /dev/cu.usbmodemFreeBSD1</userinput></screen> | ||||
</sect2> | </sect2> | ||||
Show All 40 Lines | <para>Virtual network interfaces support is provided by templates | ||||
three templates. Both &man.usb.template.4; and &man.if.cdce.4; | three templates. Both &man.usb.template.4; and &man.if.cdce.4; | ||||
kernel modules must be loaded.</para> | kernel modules must be loaded.</para> | ||||
<para>Make sure the necessary modules are loaded and the correct | <para>Make sure the necessary modules are loaded and the correct | ||||
template is set at boot by adding | template is set at boot by adding | ||||
those lines to <filename>/boot/loader.conf</filename>, creating | those lines to <filename>/boot/loader.conf</filename>, creating | ||||
it if it does not already exist:</para> | it if it does not already exist:</para> | ||||
<screen>if_cdce_load="YES" | <programlisting>if_cdce_load="YES" | ||||
hw.usb.template=1</screen> | hw.usb.template=1</programlisting> | ||||
<para>To load the module and set the template without rebooting | <para>To load the module and set the template without rebooting | ||||
use:</para> | use:</para> | ||||
<screen>&prompt.root; <userinput>kldload if_cdce</userinput> | <screen>&prompt.root; <userinput>kldload if_cdce</userinput> | ||||
&prompt.root; <userinput>sysctl hw.usb.template=1</userinput></screen> | &prompt.root; <userinput>sysctl hw.usb.template=1</userinput></screen> | ||||
</sect1> | </sect1> | ||||
▲ Show 20 Lines • Show All 125 Lines • Show Last 20 Lines |