Operation

This chapter describes how the USB-Mux is used in day-to-day work.

Software

Note

Make sure you have installed the control software as described in Software Commissioning.

Using multiple USB-Muxes on a single host is considered a common use case. Thus, it is a good practice to access a USB-Mux based on its serial number. The following examples are based on a USB-Mux with the serial number 22.

  • To create a connection between the host and the device on the "Device"-Port:

    $ usbmuxctl --serial 22 connect --host-device
                                         +-----------------------+
                                         | USB-Mux               |
                                      +--|                       |
                                      |  | SN:   22              |
                                      |  | Path: 1-3.1           |
                                      |  +-----------------------+
           VCC: 4.95V    +---------+  |
    Host |>--------------|       1 |--+         ID: High
                         |         |           VCC: 0.00V
                         |       2 |----x    ------------|> DUT
                         |         |
                         |       3 |---------------------|> Device
                         +---------+           VCC: 4.62V
    

Note

The usbmuxctl tool will, by default, output a graphical representation of the current USB-Mux status. Use the --json or --raw commandline parameters to generate machine-readable commandline output.

  • To create a connection between the DUT and the device on the device -port:

    $ usbmuxctl --serial 22 connect --dut-device
                                         +-----------------------+
                                         | USB-Mux               |
                                      +--|                       |
                                      |  | SN:   22              |
                                      |  | Path: 1-3.1           |
                                      |  +-----------------------+
           VCC: 4.95V    +---------+  |
    Host |>--------------|       1 |--+         ID: Low
                         |         |           VCC: 0.00V
                         |       2 |----x    +-----------|> DUT
                         |         |         |
                         |       3 |----x    +-----------|> Device
                         +---------+           VCC: 0.15V
    
  • To create a connection between the host and the DUT:

    $ usbmuxctl --serial 22 connect --host-dut
                                         +-----------------------+
                                         | USB-Mux               |
                                      +--|                       |
                                      |  | SN:   22              |
                                      |  | Path: 1-3.1           |
                                      |  +-----------------------+
           VCC: 4.95V    +---------+  |
    Host |>--------------|       1 |--+         ID: High
                         |         |           VCC: 4.71V
                         |       2 |---------------------|> DUT
                         |         |
                         |       3 |----x    ------------|> Device
                         +---------+           VCC: 0.15V
    

Warning

This mode is potentially dangerous, as it connects the voltage line that supplies the USB-Mux to the voltage line on the DUT and the DUT data lines to the USB-Hub on the USB-Mux. This mode can be disabled using the "DUT Power" switch on the USB-Mux, preventing it's accidental selection.

  • To disconnect all devices:

    $ usbmuxctl --serial 22 disconnect
                                         +-----------------------+
                                         | USB-Mux               |
                                      +--|                       |
                                      |  | SN:   22              |
                                      |  | Path: 1-3.1           |
                                      |  +-----------------------+
           VCC: 4.95V    +---------+  |
    Host |>--------------|       1 |--+         ID: High
                         |         |           VCC: 0.15V
                         |       2 |----x    ------------|> DUT
                         |         |
                         |       3 |----x    ------------|> Device
                         +---------+           VCC: 0.15V
    

Controlling the ID Pin

The USB-Mux has an ID pin output in the DUT connection. By default this pin is switched according to the connection made to the DUT.

  • When the DUT is multiplexed to the host the ID pin is not pulled low signaling that the DUT is connected to a host port.

  • When the DUT is multiplexed to the device the ID pin is pulled low signaling a device to the DUT.

This behavior can be disabled by passing the --no-id parameter to usbmuxctl connect. In this case the behavior of the ID pin can be controlled using usbmuxctl id.

DUT-to-host Lock

The USB-Mux has a switch DUT Power that can be either switched to Off or Auto. This switch controls if a connection between the host- and DUT- ports can be made.

  • In Auto-Mode the connection is possible.

  • In OFF-Mode the connection can not be made.

Warning

With the switch set to Auto it is possible to connect two USB host controllers to the same USB bus. This should not cause electrical damage to either host controller but will probably lead to a loss of communication to some or all participants of the bus.

Note

We suggest to set this switch to OFF for every DUT that will not be used as USB device.

Tool Integration

The labgrid project has support for the USB-Mux. Once you have defined a LXAUSBMux resource you can use the labgrid-client or a strategy to control the state of an USB-Mux.

Custom DUT Cables

Building custom cables for connection of a DUT is a common task when working with the USB-Mux. That is why we decided to use a connector that is compatible with 2.54mm (0.1") "DuPont"-style connectors.

On the USB-Mux a 78208-106HLF connector from Amphenol is used.

Our cables use the 78211-006LF housing from Amphenol. We use the crimp contacts with the higher mating force 47445-000LF (also from Amphenol).

Warning

These connectors do not have a natural Pin 1 marking. Take extra care when connecting / manufacturing your own cable to match the pinout on the housing.

Note

If using unshielded cable (e.g. single "DuPont"-style cables) make sure to keep the connections as short as possible.