Customize Legato Yocto USB

This topic provides details on how to customize the USB behavior of the Legato Yocto distribution when working with the following Sierra Wireless devices:

  • AR755x
  • AR8652
  • WP85

The information is based on the USB Driver Developer Guide available from the Source.

Enumeration Sequence

USB endpoints are enumerated during the boot sequence as follows:

First, the USB boot script (S41usb) starts /usr/bin/usb/boot_hsusb_composition.

This script executes the following:

IF /etc/legato/usbmode exists
THEN execute /etc/legato/usbsetup
ELSE setup default composition

The actions taken are described in the rest of this topic.

Default Endpoints

The table shows all the possible USB interfaces available on the AR7 family.

USB_interfaces_AR7.png

These endpoints are grouped into compositions, and a fixed set of compositions is provided as shown in the next table. Switching between these compositions is done using the AT!USBCOMP command. The default composition for the AR7 is composition 2.

USB_endpointCompositions_AR7.png

Customize Endpoints

If none of the provided compositions meet your needs it's possible to fine-tune the USB configuration using a mechanism built into Legato. The first step is to create /etc/legato/usbmode. An example file is shipped in this directory in the default distribution, called usbmode.ex. usbmode contains a list, one per line, of the endpoints you wish to enumerate. For example, the default file contains

ecm
acm
nmea

The full list of supported modes is:

Name Interface Type Description Target endpoint Sample host endpoint
ecm CDC-ECM Providing an IP connection over USB NIC usb0 or ecm0 NIC (eg enp0s20u6i22)
eem CDC-EEM Providing an IP connection over USB NIC usb0 or ecm0 NIC (eg enp0s20u6i22)
acm CDC-ACM Providing an AT command port N/A /dev/ttyACM0
nmea serial NMEA strings when positioning is enabled N/A /dev/ttyUSB0
audio USB audio Expose the target as a sound card N/A pcmC2D0c
pcmC2D0p
serial serial A serial interface to the embedded Linux /dev/ttyGS0 /dev/ttyUSB0
usb_mbim CDC-MBIM Mobile Broadband Interface Model
(an extension of CDC-NCM)
N/A NIC (eg wwp0s20u6i12)
+ cdc-wdm0