Usb Otg and Eh 2-0
Usb Otg and Eh 2-0
May 8, 2009
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
Revision History
Revision Issue Date Comment
0.7 11/07/2000 initial draft
1.0 12/18/01 first release
1.0a June 24, 2003 Add definition of “OTG Device”, clarify short versus long debounce,
Update contributor list, set copyright information, and apply minor
editorial changes to all sections
1.2 April 4, 2006 Reformat all sections. Clarify sections 3.3, 5.1.1 and 6.9.1.1. Add
section 5.3.12. Skip version 1.1 to eliminate ongoing confusion with
rev 1.1 of the USB core specification. Replace “DRD” and “Dual Role
Device” with “OTG and “On-The-Go Device”. Clarify SRP and HNP
usage in section 5.3.1 and 6.1, respectively. Add section 6.6.6.1 HS
Electrical Test Mode Support – text from Embedded HSET
document. Delete classes from TPL.
1.3 December 5, 2006 Refer to the USB 2.0 specification and the Micro-USB supplement for
all connector and cable assembly information and replace mini-
connector references with micro-connector references
2.0 May 8, 2009 Supplement now covers all types of Targeted Hosts (new definition)
including OTG devices and Embedded Hosts. Document
restructuring and consolidation of document content. Updated
introduction. Clarification of operation, user experience (including
symmetry principle), TPL and no silent failures requirements.
Dynamic role swaps during active connections (HNP polling). New
power saving protocol (ADP). Removal of VBUS pulsing. HW
changes enabling support for USB battery charging requirements and
general HW design simplification. Updated definitions for power
supply operation. Relaxation of some protocol timing parameters.
Optimization of state machine behavior. Appendix includes
operational sequence diagrams and ADP calculations/examples.
ii
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
Contributors
Jerry Kuo, Alcor Micro Chen Yosef, Jungo Jerome Tjia, Philips
Glen Chandler, Acon Joel Silverman, Kawasaki David Wang, Philips
Oscar De Leon, Analog Devices Microelectronics Hilbert Zhang, Philips
Martin Furuhjelm, Lexar Media
Chris Kolb, ARC International Keith Gallardo, Qualcomm
John Geldman, Lexar Media
Maria Pohlman, Aten Hyun Lee, Qualcomm
Max Bassler, Littelfuse
Francois Ennesser, Axalto Terry Remple (Previous Chair),
Francesco Liburdi, Lumberg Qualcomm
Bruce Balden, Belcarra
Ryan Hashimoto, Maxim David Landsman, SanDisk
Shimon Elkayam, Broadcom
Dave Podsiadlo, Maxim Yoni Shternhell, SanDisk
Kenneth Ma, Broadcom
Paul E. Berg, MCCI Mark Bohm, SMSC
Antonio Pacheco, Chipidea
Microelectronics Trenton Henry, MCCI Dave Haglan, SMSC
Helder Silva, Chipidea Microelectronics Terry Moore, MCCI Rick Holbrook, SMSC
Hans van Antwerpen, Cypress Jason Oliver, MCCI Eric Kawamoto, SMSC
Semiconductor Michael Dallabetta, Mentor Graphics Morgan Monks, SMSC
Ray Asbury, Cypress Semiconductor
Rob Douglas, Mentor Graphics Ken Nagai, SMSC
Dave Cobbs
(Previous Chair), Cypress Ian Parr, Mentor Graphics Joe Meza, SoftConnex
Semiconductor Mark Hanson, Microsoft Wenkai Du, ST-NXP Wireless
David Cross, Cypress Semiconductor Atsushi Nishio, Mitsumi Nicolas Florenchie, ST-NXP Wireless
Kosta Koeman, Cypress Yasuhiko Shinohara, Mitsumi Geert Knapen, ST-NXP Wireless
Semiconductor
David Wright, Cypress Semiconductor Akira Aso, Molex Shaun Reemeyer, ST-NXP Wireless
Israel Zilberman, Cypress Scott Sommers, Molex Subu Sankaran, ST-NXP Wireless
Semiconductor Mark Carlson, Motorola David Wee, ST-NXP Wireless
Dan Ellis, DisplayLink Eric Overtoom, Motorola George Paparrizos, Summit
Morten Christiansen, Ericsson Kenji Oguma, NEC Roger Fiander, Symbian
Jeremy Henson, Ericsson Kazumasa Saito, NEC Systems Dale Self, Symbian
Graham Connolly, Fairchild Thomas Block, Nokia Adam Burns, Synopsys
Semiconductor
Sten Carlsen, Nokia Behram Minwalla, Synopsys
Travis Williams, Fairchild
Semiconductor Jorg Brakensiek, Nokia Suresh Venkatachalam, Synopsys
Alan Berkema, Hewlett-Packard Eugene Gryazin, Nokia Pascal Berten, Testronic Labs
Robert Duncan, Hewlett-Packard Esa Harma, Nokia Cary Snyder, Testronic Labs
Matt Nieberger, Hewlett-Packard Juha Heikkila, Nokia Dan Harmon, Texas Instruments
Trung Le, Imation Jani Heikkinen, Nokia Ivo Huber, Texas Instruments
Eric Huang Mark Jenkins, Nokia Jeff Kacines, Texas Instruments
(Previous Chair), InSilicon/Synopsys
Pasi Palojarvi, Nokia Clarence Lewis, Texas Instruments
Dan Froelich, Intel Corp
Richard Petrie (Chair/Editor), Nokia Grant Ley, Texas Instruments
Venkat Iyer, Intel Corp
Harri Rajalin, Nokia Richard Nie, Texas Instruments
Richard Lawrence, Intel Corp
James Scales, Nokia Wes Ray, Texas Instruments
Jeff Miller, Intel Corp
Tero Soukko, Nokia Sue Vining, Texas Instruments
Sridharan Ranganathan, Intel Corp
Bart Vertenten, NXP Hung Vuong, Texas |nstruments
Robert Leydier, Invia
Sree Iyer, OnSpec Joon Kim, TransDimension
Gilbert Sun, ITRI
Peter Yi, Opti Bill McInerney, TransDimension
Ygal Blum, Jungo
Bill Stanley, Palm Dave Murray, TransDimension
Boris Dinkevich, Jungo
Eric Lu, Philips Jing Wang, TransDimension
Ilya Lifshits, Jungo
Chris Schell (Previous Chair), Philips David Wooten, TransDimension
Mikael Khalifa, Jungo
Rick Stopel, Philips Zong Liang Wu, TransDimension
Oren Manor, Jungo
Kenneth Tan, Philips Charles Brill, Tyco Electronics
iii
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
iv
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
Table of Contents
1 Introduction................................................................................................................................................1
1.1 Overview.............................................................................................................................................1
1.2 Related Documents............................................................................................................................1
1.2 Acronyms and Terms .........................................................................................................................2
2 Operational overview ................................................................................................................................4
2.1 Introduction.........................................................................................................................................4
2.1.1 Powering the USB port .........................................................................................................4
2.1.2 Once connected....................................................................................................................4
2.2 OTG device to standard host or Embedded Host ..............................................................................5
2.3 Targeted Host to peripheral-only B-device.........................................................................................5
2.4 OTG device to OTG device ................................................................................................................5
2.5 Unattached Targeted Host .................................................................................................................5
3 OTG and EH key features .........................................................................................................................6
3.1 Connectors, cable assemblies and cable adapters ...........................................................................6
3.1.1 OTG devices .........................................................................................................................6
3.1.2 SRP-capable peripheral-only B-devices...............................................................................6
3.1.3 Embedded Hosts ..................................................................................................................6
3.2 Symmetry ...........................................................................................................................................6
3.3 Protocols.............................................................................................................................................7
3.3.1 Session Request Protocol ....................................................................................................7
3.3.2 Host Negotiation Protocol .....................................................................................................7
3.3.3 HNP polling ...........................................................................................................................7
3.3.4 Suspend/Resume/Remote wakeup ......................................................................................7
3.3.5 Attach Detection Protocol .....................................................................................................7
3.4 Capability limitation.............................................................................................................................8
3.4.1 Targeted Peripheral List .......................................................................................................8
3.4.2 Device class support.............................................................................................................8
3.4.3 Hub class support .................................................................................................................8
3.4.4 Output Power ........................................................................................................................8
3.4.5 SRP support .........................................................................................................................9
3.4.6 ADP Support .........................................................................................................................9
3.4.7 HNP support .........................................................................................................................9
3.4.8 Functions and configurations................................................................................................9
3.4.9 Operating speeds .................................................................................................................9
3.5 No silent failures .................................................................................................................................9
4 Electrical characteristics ........................................................................................................................11
4.1 Common characteristics...................................................................................................................11
4.1.1 VBUS Leakage ...................................................................................................................11
4.1.2 Data Line Pull-down Resistance.........................................................................................11
4.2 A-device VBUS characteristics.........................................................................................................11
4.2.1 VBUS Output Voltage and Current.....................................................................................11
4.2.2 VBUS Over-current Condition ............................................................................................12
4.2.3 VBUS Capacitance .............................................................................................................12
4.2.4 ID Pin ..................................................................................................................................12
4.3 B-device VBUS characteristics.........................................................................................................13
4.3.1 VBUS Average Input Current .............................................................................................13
4.3.2 VBUS Input Voltage............................................................................................................13
4.3.3 VBUS Inrush and Transient Current...................................................................................13
4.3.4 VBUS Capacitance .............................................................................................................13
4.4 Electrical Parameters .......................................................................................................................14
v
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
5 Signalling..................................................................................................................................................16
5.1 Session Request Protocol ................................................................................................................16
5.1.1 Introduction .........................................................................................................................16
5.1.2 Initial Conditions .................................................................................................................17
5.1.3 Data-line Pulsing.................................................................................................................17
5.1.4 VBUS Pulsing......................................................................................................................17
5.1.5 B-device Session Valid .......................................................................................................17
5.1.6 Response Time of A-device ...............................................................................................17
5.1.7 Initiation of SRP ..................................................................................................................17
5.2 Host Negotiation Protocol.................................................................................................................18
5.2.1 HNP sequence of events ....................................................................................................18
5.2.2 Data Line Discharge Time ..................................................................................................19
5.2.3 Debounce interval...............................................................................................................20
5.2.4 Hi-Speed signalling.............................................................................................................20
5.2.5 Timing Summary.................................................................................................................20
5.3 Suspend, Resume and Remote Wakeup.........................................................................................21
5.3.1 Resume signalling ..............................................................................................................21
5.3.2 Remote wakeup signalling..................................................................................................21
5.4 Attach Detection Protocol.................................................................................................................22
5.4.1 Introduction .........................................................................................................................22
5.4.2 ADP Probing .......................................................................................................................22
5.4.3 ADP Sensing ......................................................................................................................24
5.4.4 ADP Start Up ......................................................................................................................24
5.5 Signalling Timing Parameters ..........................................................................................................25
6 Device Framework...................................................................................................................................27
6.1 OTG descriptor .................................................................................................................................27
6.1.1 SRP support .......................................................................................................................27
6.1.2 HNP support .......................................................................................................................27
6.1.3 ADP Support .......................................................................................................................27
6.1.4 OTG and EH supplement release number .........................................................................28
6.2 Standard Device Features................................................................................................................28
6.2.1 Feature Selectors ...............................................................................................................28
6.2.2 SetFeature Commands.......................................................................................................28
6.2.3 GetStatus commands .........................................................................................................29
6.3 HNP polling mechanism ...................................................................................................................31
6.4 Test Device Support.........................................................................................................................32
6.4.1 High-speed Electrical Test Mode Support..........................................................................32
7 State Diagrams ........................................................................................................................................34
7.1 A-device............................................................................................................................................34
7.1.1 a_idle ..................................................................................................................................36
7.1.2 a_wait_vrise ........................................................................................................................37
7.1.3 a_wait_bcon........................................................................................................................37
7.1.4 a_host .................................................................................................................................37
7.1.5 a_suspend ..........................................................................................................................38
7.1.6 a_peripheral........................................................................................................................39
7.1.7 a_wait_vfall .........................................................................................................................39
7.1.8 a_vbus_err ..........................................................................................................................39
7.2 OTG B-device...................................................................................................................................40
7.2.1 b_idle ..................................................................................................................................41
7.2.2 b_srp_init ............................................................................................................................42
7.2.3 b_peripheral........................................................................................................................42
7.2.4 b_wait_acon........................................................................................................................42
7.2.5 b_host .................................................................................................................................43
vi
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
vii
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
Figures
Figure 5-1: A-device SRP Timing Reference................................................................................................... 16
Figure 5-2: B-device SRP Timing Reference................................................................................................... 16
Figure 5-3: HNP Sequence of Events (FS)...................................................................................................... 18
Figure 5-4: ADP context................................................................................................................................... 22
Figure 5-5: ADP Architecture ........................................................................................................................... 23
Figure 5-6: ADP Probe Timing......................................................................................................................... 23
Figure 7-1: A-device State Diagram................................................................................................................. 34
Figure 7-2: Embedded Host state diagram...................................................................................................... 35
Figure 7-3: OTG B-device State Diagram........................................................................................................ 40
Figure 7-4: SRP-Capable Peripheral-Only B-device State Diagram .............................................................. 44
Figure A-1: OTG device to peripheral-only B-device with a hardwired captive cable ..................................... 53
Figure A-2: Embedded Host to peripheral-only B-device with captive cable................................................... 54
Figure A-3: Peripheral-only B-device with a detachable cable to OTG device................................................ 55
Figure A-4: Peripheral-only B-device with a detachable cable to EH .............................................................. 56
Figure A-5: ADP-Capable peripheral-only B-device to Targeted Host with ADP ............................................ 57
Figure A-6: ADP-Capable peripheral-only B-device to Targeted Host without ADP ....................................... 58
Figure A-7: User interaction with a Targeted Host when no session is active ................................................ 59
Figure A-8: Attachment of OTG devices .......................................................................................................... 60
Figure A-9: Interaction with A-device when no session active ........................................................................ 61
Figure A-10: Interaction with B-device when no session active ...................................................................... 62
Figure A-11: Interaction with A-device during active session .......................................................................... 63
Figure A-12: Interaction with B-device during active session .......................................................................... 64
Figure A-13: Power up of an unattached ADP-capable A-device....................................................................65
Figure A-14: Power up of an attached ADP-capable A-device........................................................................ 65
Figure A-15: Power up of an unattached ADP-capable B-device....................................................................66
Figure A-16: Power up of an attached ADP-capable B-device........................................................................ 66
viii
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
Tables
Table 4-1: Electrical Characteristics ................................................................................................................ 14
Table 5-1: Signalling Timing Parameters......................................................................................................... 25
Table 6-1: OTG Descriptor............................................................................................................................... 27
Table 6-2: OTG Feature Selectors................................................................................................................... 28
Table 6-3: GetStatus Command Format.......................................................................................................... 29
Table 6-4: OTG status selector........................................................................................................................ 30
Table 6-5: OTG Status information .................................................................................................................. 30
Table 6-6: HNP polling timing parameters....................................................................................................... 31
Table 6-7: Test Modes Product ID Definitions ................................................................................................. 32
Table 7-1: A-device states ............................................................................................................................... 35
Table 7-2: A-device state machine parameters ............................................................................................... 36
Table 7-3: OTG B-device States...................................................................................................................... 40
Table 7-4: OTG B-device state machine parameters ...................................................................................... 40
Table 7-5: SRP-capable peripheral-only B-device states................................................................................ 44
Table 7-6: SRP-capable peripheral-only B-device state machine parameters ............................................... 44
Table 7-7: OTG Device Timers ........................................................................................................................ 50
Table B-1: ADP worst cases ............................................................................................................................ 68
Table B-2: ADP ramp time with remote device detached ................................................................................ 68
Table B-3: ADP ramp time with remote device attached ................................................................................. 68
Table B-4: Difference between ADP attach and detach .................................................................................. 69
Table B-5: ADP current consumption assumed parameter values ................................................................. 69
ix
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
1 Introduction
1.1 Overview
The Universal Serial Bus (USB), originally designed as an interface between PCs and peripherals, has
become the most successful general-purpose PC interface in the history of computing.
By definition, USB communication occurs between a host and a peripheral. The original intent was to
place the heavier workload on the PC (host) and to allow USB peripherals to be fairly simple.
Accordingly, the USB specification requires that PCs:
These non-PCs have the computing resources to manage a USB host function, but they need to function
in ways that differ from standard PC hosts. Although they will provide host capability for some devices,
it's unreasonable to require them to support the full range of USB peripherals. For example, connecting
a camera to a printer makes a lot of sense, but the printer manufacturers may not think it is quite as
important for the printer to support a USB GPS dongle. Because this is new territory for USB, developers
need a way to understand what USB functionality they need to provide and what functionality is not
required.
This specification defines these non-PC hosts as Targeted Hosts. A Targeted Host is a USB host that
supports a specific, targeted set of peripherals. The developer of each Targeted Host product defines
the set of supported peripherals on a Targeted Peripheral List (TPL). A Targeted Host needs to provide
only the power, bus speeds, data flow types, etc., that the peripherals on its TPL require.
1. Embedded Hosts: An Embedded Host (EH) product provides Targeted Host functionality over one
or more Standard-A receptacles. Embedded Host products may also offer USB peripheral capability,
delivered separately via one or more Type-B receptacles.
2. On-The-Go: An OTG product is a portable device that uses a single Micro-AB receptacle (and no
other USB receptacles) to operate at times as a USB Targeted Host and at times as a USB
peripheral. OTG devices must always operate as a standard peripheral when connected to a
standard USB host.
OTG devices can also be attached to each other. This specification enables the underlying driver
components to swap between the role of either USB host or USB peripheral, without needing to
physically turn the cable around.
The following referenced documents can be found on the USB-IF website www.usb.org:
1
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
1
An ADP-capable EH is not required to do ADP sensing since it is not able to operate in the B-device
position.
2
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
port when it is attached to the upstream port, and when the downstream device
has pulled either the D+ or D- data line high through a 1.5 kΩ resistor, in order
to enter low-speed, full-speed or high-speed signaling.
EH Embedded Host.
Embedded Host A product that has a Standard-A receptacle supported by a USB Host
Controller. Embedded Hosts have a particular set of targeted peripherals, as
described in their TPL.
FS Full Speed (as defined in [USB2.0]).
HS High Speed (as defined in [USB2.0]).
Host A physical entity that is attached to a USB cable and is acting in the role of the
USB host as defined in [USB2.0]. This entity initiates all data transactions and
provides periodic Start of Frames (SOF’s).
HNP Host Negotiation Protocol (see Section 3.3.2).
ID Identification. Denotes the pin on the Micro connectors that is used to
differentiate a Micro-A plug (ID pin is FALSE) from a Micro-B plug (ID pin is
TRUE). See [Micro-USB1.01] for details.
3
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
2 Operational overview
2.1 Introduction
This section describes a variety of OTG and Embedded Host use cases. Each use case pairs a type of
Targeted Host with a particular type of peripheral and describes how the various protocols in this
document may be used in each case.
A wall-powered Embedded Host that provides power via the downstream port at all times or
An insertion-based OTG device which provides power via its OTG port as soon as a Micro-A plug is
attached (known as the OTG A-device) and continues to do so in either host or peripheral role.
Since a USB A-plug is attached to the power provider in both of these cases, in the following text we will
refer to this as the USB A-port. If the Embedded Host or OTG A-device does not normally provide
power via its USB A-port, when not actively communicating with another device, there are several ways
to restore this power supply.
1. If the only host applications that use USB are user-initiated, then power is provided via the USB A-
port when the user initiates one of these functions.
2. Any OTG A-device or Embedded Host that does not provide power via its USB A-port while a cable
is attached, and has an SRP-capable peripheral on its Targeted Peripheral List, should power the
USB A-port in response to user input on the attached device.
3. If the Targeted Host has applications that will run automatically as soon as attachment to a particular
device is detected, then it is required in this particular case that these hosts support the Attach
Detection Protocol (ADP). As soon as the presence of a device is detected, the host starts providing
power via the USB A-port, waits for connect, and then queries the device type, etc.
In a similar example a printer with an Embedded Host port supports mass storage devices. While the
printer is continually powered with mains power and not in sleep, it constantly provides power via the
USB A-port. When a USB Flash Drive is attached it immediately connects. Once the Embedded Host
learns that it has a mass storage device connected, the printer presents an interface to the user to allow
her to select which of the pictures stored on the mass storage device to print.
A slightly more complicated example is a mobile device that supports HID devices. Since the power on
the mobile device is at a premium, it does not continually provide power via the USB A-port even when a
Micro-A plug is attached. However it is still able to detect device attachment to the Micro-B plug using
ADP. As soon as the keyboard is attached the mobile device will start providing power via the USB A-
port, and start an application that responds to keystrokes.
A parallel example with the same user experience would be a mobile device that doesn't support ADP
and a keyboard with a small battery that supports SRP. The user attaches the keyboard presses a
button. Since the USB A-port is not yet providing power the keyboard requests that the USB A-port
4
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
should start providing power. The phone detects the request, starts providing power via the USB A-port,
and starts an application that handles the keystrokes.
If the user launches an application on the second OTG device while the first OTG device is still using the
bus, then the second OTG device prompts the user if it is okay to terminate any current operations. If
the user agrees, then current operations are terminated, and the second OTG device takes control of the
interface.
2
The A-device can use a variety of methods to determine that there is no device available: 1) Lack of A-
plug insertion, 2) no connect in response to VBUS assertion, or 3) ADP.
5
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
The OTG device with the A-plug inserted is called the A-device and is responsible for powering the USB
interface when required and by default assumes the role of host. The OTG device with the B-plug
inserted is called the B-device and by default assumes the role of peripheral. An OTG device with no
plug inserted defaults to acting as a B-device. If an application on the B-device requires the role of host,
then the HNP protocol is used to temporarily transfer the host role to the B-device.
OTG devices attached either to a peripheral-only B-device or a standard/embedded host will have their
role fixed by the cable since in these scenarios it is only possible to attach the cable one way around.
3.2 Symmetry
OTG devices attached to each other should demonstrate the same behavior to the end user regardless
of whether they are attached as the A-device or the B-device. When the user interacts with one OTG
device, this causes a session to be started, and the user is able to access or control the second OTG
device using applications running on the first OTG device. During a session, the role of host can be
transferred back and forth between the A-device and the B-device any number of times, using HNP. If
the user agrees, then current operations are terminated, and the second OTG device takes control of the
interface. The session ends when applications running on it have completed.
The A-device shall always enable the B-device for HNP whenever it requests to become host (see
Section 3.3.3). Similarly, the B-device shall suspend whenever the A-device requests to become host.
OTG devices attached to non-OTG USB hosts (standard or Targeted) or peripheral-only B-devices will
not demonstrate symmetry since the host and device roles are fixed by the cable.
The symmetry principle also has implications for power management in OTG devices. When choosing
from the available configurations of an attached peripheral, an OTG device acting as host shall consider
the bMaxPower value in exactly the same way regardless of whether it is acting as A-Host or a B-Host.
This prevents a B-Host from selecting a configuration for an A-Peripheral that it would not be able to
support when it acts as an A-Host.
6
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
3.3 Protocols
At the start of a session, the A-device defaults to having the role of host. During a session, the role of
host can be transferred back and forth between the A-device and the B-device any number of times,
using HNP.
3
See [USBBattery1.1] for an exception case with ACA
7
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
For example: The Targeted Host has a Target Peripheral List containing a peripheral supporting device
class "X" but does not contain a peripheral supporting device class "Y". The Targeted Host must
generate a failure message when a peripheral supporting device class "Y" is detected but is allowed to
support any peripheral of device class “X” without reporting a failure.
OTG product designers should be aware that although they are free to decide which peripherals their
product will support as a host, they have no control over which hosts will support them as a peripheral.
Any product using the Micro-AB receptacle must support the various OTG protocols needed for other
OTG products to properly support them as a peripheral, no matter what the cable direction or bus power
state.
8
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
A Targeted Host is required to respond to SRP if it ever turns off VBUS while an A-plug is inserted. A
Targeted Host that keeps VBUS turned on whenever an A-plug is inserted will never have a need to
respond to SRP.
Where such a Targeted Host is battery powered, it is recommended that this host choose a configuration
with sufficiently low power consumption. To maximize interoperability with such battery powered
Targeted Hosts, it is strongly recommended that OTG devices acting as peripherals and SRP-capable
peripheral-only B-devices offer at least one configuration requiring less than or equal to the minimum
rated output current of an A-device or less (see Section 4.2.1).
When two OTG devices are attached messages shall be displayed on the device the user is currently
using; typically the OTG device acting in host role.
9
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
If hubs are supported different messages for hubs and non-hubs are required. If the attached peripheral
is a hub, the embedded host shall be able to display a message indicating that the attached hub is not
supported. Care should be taken to distinguish between standalone hubs and compound peripherals.
10
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
4 Electrical characteristics
This section defines electrical specifications for USB devices that implement the protocols defined in this
specification. Any parameter that is not specified in this section is unchanged from [USB2.0].
If a device is not driving VBUS or doing ADP probing or ADP sensing, then it shall not source more than
IVBUS_LKG_SRC max to VBUS when VBUS is grounded. This is required so that a local device can be
detected by a remote device doing ADP probing.
An ADP-capable device shall have a VBUS resistance to ground of ROTG_VBUS (see Section 5.4.2). If a
remote device were doing ADP probing, and a local device had a VBUS resistance that was too low, then
the ADP probing ramp on VBUS might not cross the VADP_SNS threshold.
When an OTG A-device or B-device is acting as a peripheral, it shall disable the pull-down on the D+
line but shall maintain the D- pull-down.
When an OTG device changes between host and peripheral roles, the D- pull-down shall remain
asserted. This prevents the D- line on the A-device from floating if the B-device is detached. An OTG
device is allowed to disable both pull-down resistors during the interval of a packet transmission while
acting as either a host or a peripheral.
After starting to drive VBUS, an A-device shall continue to drive VBUS for a time of TA_WAIT_BCON. This
ensures an attached B-device has time to connect (see Section 5.2.1).
After configuring a B-device, for any steady state load current that is less than the rated current of the A-
device (IA_VBUS_RATED), the average output voltage from an A-device shall be within VA_VBUS_AVG_LO
(IA_VBUS_RATED ≤ 100mA) or VA_VBUS_AVG_HI (100mA < IA_VBUS_RATED). Voltage is averaged over a
time of TAVG_VBUS, and includes any transient voltages due to step changes in current.
For a step change in load current with any amplitude less than the rated current of the A-device
(IA_VBUS_RATED), and an edge rate of less than 100mA/usec, the transient output voltage from an A-
device shall remain within VA_VBUS_TRNS_LO (IA_VBUS_RATED ≤ 100mA) or VA_VBUS_TRNS_HI (100mA <
IA_VBUS_RATED).
11
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
If an attached B-device draws less current than IA_VBUS_RATED after TA_VBUS_RISE, then VBUS shall
remain valid.
If an attached B-device draws more current than IA_VBUS_RATED after TA_VBUS_RISE, then VBUS may
become invalid. The A-device shall turn off VBUS and indicate to the user that the B-device is not
supported.
For an ADP-capable A-device the VBUS capacitance may be limited to CADP_VBUS by the ADP probing
method described in Section 5.4. If other probing methods are used there must be a probe ramp that
crosses VADP_SNS so detection will still work in the remote end.
An EH with multiple ports shall be designed such that attaching a peripheral to one port does not cause
VBUS to go outside the range of either VA_VBUS_TRNS_LO or VA_VBUS_TRNS_HI (see Section 4.2.1) on an
adjacent port.
4.2.4 ID Pin
When a Micro-A plug is attached the ID pin becomes FALSE 4 as defined in [Micro-USB1.01]. When an
OTG A-device is ready to act in host or peripheral roles, and VBUS is not present, it is required to reach
VOTG_SESS_VLD max within TA_VBUS_ATT of the ID pin becoming FALSE unless an over-current condition
is reached (see Section 4.2.2). The Standard-A plug does not contain an ID pin so this requirement is
not applicable to an EH.
4
See also [USBBattery1.1] for additional ID pin usages with OTG devices.
12
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
A configured B-device (OTG or SRP-capable peripheral-only), acting in peripheral role, shall follow the
rules regarding current draw as set down in [USB2.0] including those relating to suspend current
detailed in Section 7.2.3.
When a configured OTG B-device acting in peripheral role performs HNP and becomes host, it may only
draw a current of IB_UNCFG max.
Except for inrush current, the maximum transient current that a configured SRP-capable B-device can
draw from VBUS is determined based on the following assumptions:
For ADP-capable B-devices the VBUS capacitance may be limited to CADP_VBUS by the ADP probing
method described in Section 5.4. If other probing methods are used there must be a probe ramp that
crosses VADP_SNS so detection will still work in the remote end.
13
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
5
The parameters in this table define the limits based on the full range of operating temperatures and
implementation tolerances. Manufacturers should select the tolerance and value of each parameter at
room temperature necessary to pass USB-IF compliance testing. However, these parameters shall stay
within the defined limits across the full range of temperatures to ensure a functional product.
6
Averaged over TAVG_VBUS
7
See section 7.2.1.2.1 "Over-current protection" in [USB2.0]
14
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
8
Capacitance of this capacitor, including its norminal tolerance, should not go below the minimum value
of 1µF.
15
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
5 Signalling
5.1 Session Request Protocol
5.1.1 Introduction
The following figures (Figure 5-1 and Figure 5-2) show the SRP signaling process from the perspective
of the A-device and the B-device. The process is as follows:
Wait for the end of a session by monitoring VBUS and data lines
B-device signals SRP by generating data line pulsing
A-device detects SRP signaling and responds by asserting VBUS
B-device detects the new session as valid
A2 Legend
A-device pull-down
A1 A3 A4 A5
Bus Reset B-device pull-up
VIH Driven by A-device
D+
A1 TSSEND_LKG
VIL
A2 TA_SRP_RSPNS
A3 TA_VBUS_RISE
4.4 V A4 TA_WAIT_BCON
VBUS
4.0 V A5 TA_BCON_LDB
VOTG_SESS_VLD
0.8 V
VOTG_VBUS_LKG
0V
16
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
It has been observed that some self-powered USB devices do not follow [USB2.0] Section 7.1.5.1.
Devices that violate the above requirement have been observed to pull-up D+ as long as they have
power applied to them, without regard to the presence of VBUS. For this reason, an A-device that
responds to data-line pulsing SRP should be able to disable this capability when an offending device is
attached. On detecting D+ high (while VBUS is low), for a period longer than the maximum D+ pulse
width TB_DATA_PLS max, the A-device shall determine that the B device is not compliant and shall
therefore disable SRP until such time as D+ drops again. When the data line returns low (indicating a
disconnect), then SRP should be re-enabled.
17
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
9
If the bus was operating in HS mode, the B-device will first enter the full-speed mode (see Section
5.2.4).
10
An OTG device is required to operate as a full-speed or high-speed peripheral. Therefore, a B-device
shall only accept a connection from an A-device when D+ is pulled up. If the B-device detects a high on
18
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
low, (i.e. J state). When the B-device has qualified the high level on the D+ line as being from the A-
device., and the level has been present for at least TB_ACON_DBNC min then the A-device is
connected This indicates that the A-device has recognized the HNP request from the B-device. At
this point, the B-device becomes host and asserts bus reset to start using the bus. The B-device
shall assert the bus reset (SE0) within TB_ACON_BSE0 max of the time that the A-device turns on its
pull-up.
E) When the B-device completes using the bus, it stops all bus activity. Optionally, the B-device may
turn on its D+ pull-up when a FS idle condition is detected on the bus.
F) A-device detects lack of bus activity for more than TA_BIDL_ADIS min and turns off its D+ pull-up 11 .
Alternatively, if the A-device has no further need to communicate with the B-device, the A-device
may turn off VBUS and end the session.
G) B-device turns on its pull-up. If the B-device does not connect before TA_WAIT_BCON, then the A-
device is allowed to stop waiting for a connection.
H) After waiting TLDIS_DSCHG min to ensure that the D+ line cannot be high due to the residual effect of
the A-device pull-up, (see Section 5.2.2), the A-device sees that the D+ line is high (and D- line is
low) indicating that the B-device is signaling a connect and is ready to respond as a peripheral.
I) When the A-device has qualified the high level on the D+ line as being from the B-device, and the
level has been present for the debounce interval (see Section 5.2.3) then the A-device knows that
the B-device is connected as a peripheral. At this point, the A-device will either become host and
assert bus reset to start using the bus within TA_BCON_ARST or end the session if it has no further
actions.
As per Table 7-7 of [USB2.0], the maximum capacitance for a downstream facing port is 150 pF (CIND
max), and the maximum capacitance for the upstream port of a device without an attached cable is 100
pF (CINUB max). The differential capacitance of a worst-case USB cable is approximately 340 pF (the
single-ended capacitance is lower but is not specified so assuming that the single-ended capacitance is
the same as the differential capacitance will insure a worst case calculation). The pull-down resistance
of each OTG device is 24.8 k (RPD max) or less. This results in a discharge time constant of:
For the data line to discharge from 3.6 V to 0.8 V requires approximately 1.55 time constants. This gives
a worst case delay for the data line discharge of about 10.4 µs. In previous cases of USB specification
development, time values for RC charge/discharge were used to set timing values. In most cases, these
values did not have a large margin for error or to allow for simple variations in implementation to reduce
costs or complexity. For this reason, the guard-band for the data-line discharge is set at about 2.5 times
the calculated value. Thus, if a device uses this method to ensure the data line is at a logic low level, it
shall wait for a minimum of TLDIS_DSCHG min before checking the state of the data-line.
the D- line after disconnecting, this shall be interpreted as resume signaling from the A-device (see
Section 5.3.1).
11
If the bus was operating in HS mode, the A-device will first enter the full-speed mode (see Section
5.2.4).
19
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
The A-device is only allowed to apply the short debounce to B-device connection in a window of time. If
the A-device waits for the B-device to connect for longer than TA_BCON_SDB_WIN max, then the long
debounce interval applies in every case.
After B-device enters the FS mode and turns on its pull-up resistor; it waits to see if the data line goes
high. If the data line does not go high within TWTRSTHS (from Table 7-14 in [USB2.0]), then the B-device
shall start its HS chirp. Otherwise, if the D+ line does go high for at least TB_FS_BDIS min, then the B-
device may start HNP.
Similarly, when the B-device has finished using the bus, the A-device will first enter the full-speed mode
and turn on its D+ pull-up resistor for at least TA_BIDL_ADIS min before turning off its pull up and waiting
for B-device connection.
After the bus enters the Suspend state, the B-device will transition from acting as a peripheral to waiting
for the A-device to indicate a connect event, which would complete the transfer of control to the B-
device. While waiting for the A-device to indicate a connect event, the B-device may detect a K state on
the bus. This indicates that the A-device is signaling a resume condition and is retaining control of the
bus. In this case, the B-device will return to acting as a peripheral.
If the B-device has had its D+ pull-up turned off for more than TLDIS_DSCHG min and a J is detected on
the bus, then this is an indication that the A-device is acknowledging the HNP request and has become
the peripheral.
The A-device is not allowed to reset the bus during HNP in order to remain as host. The A-device is
always required to complete HNP once it has been initiated.
If the A-device turns on its pull up before TB_ASE0_BRST min of the B-device disconnecting, then the B-
device has to start bus activity by issuing a bus reset before TB_ACON_BSE0 max.
20
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
After the A-device signals a connect, it shall continue to signal a connect for at least TA_BIDL_ADIS min,
while waiting for the B-device to issue a bus reset. This ensures that the B-device has at least
TB_ACON_BSE0 max to detect and respond to the A-device connect.
The A-device can either do a resume by putting a K state on the bus, or it can do a bus reset by
outputting SE0 for longer than TB_ASE0_BRST min. The A-device is not allowed to resume unless the
attached device is supported and:
It has not been enabled for HNP (suspend/resume is being used for power saving), or
until TA_AIDL_BDIS min time has elapsed when the attached device has been enabled for HNP.
However, if the B-device is waiting for the A-device to indicate a connect event (see Section 5.2.5.1),
then only a J-to-K transition is treated as a resume. After the B-device turns off its pull-up resistor the
bus will be pulled to the SE0 state by the pull-downs on the A and B devices. This SE0 is not a resume
indication. If the SE0 persists for more than TB_ASE0_BRST min, then the A-device is not responding to
the HNP request from the B-device. This causes the B-device to inform the user and return to operation
as a peripheral.
However, if the B-device is enabled for HNP, then only a J-to-K transition on the bus will be treated as a
resume. A transition to SE0 will be treated as the start of the HNP handoff. The A-device is expected to
respond by transitioning to peripheral operation and turn on its pull-up resistor on D+.
21
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
5.4.1 Introduction
Attach Detection Protocol (ADP) is a protocol that allows a local device to detect when a remote device
has been attached or detached. The device doing ADP probing can be either an OTG A-device, OTG B-
device, EH or SRP-capable peripheral-only B-device. The remote device can be any USB device.
ADP operates by detecting the change in VBUS capacitance that occurs when two devices are attached
or detached. The capacitance is detected by first discharging the VBUS line, and then measuring the
time it takes VBUS to charge to a known voltage with a known current source. A change in capacitance
is detected by looking for a change in the charge time.
If an A-device is attached to a B-device, and both support ADP, then the A-device is required to perform
ADP probing, while the B-device is allowed to do ADP sensing. During ADP sensing, the B-device looks
for ADP activity on the VBUS line. If ADP activity is detected, then the B-device knows that the A-device
is still attached.
The remote device is assumed to have a complex capacitance Z, and may also be doing ADP probing or
sensing.
Figure 5-5 shows the architecture of the ADP block in the local device.
22
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
VBUS Voltage
D1
D2 D3 Legend
VADP_PRB D1 TA_ADP_PRB or
TB_ADP_PRB
D2 TADP_DSCHG
VADP_SNS D3 TADP_RISE
VADP_DSCHG
Time
To measure the capacitance on the VBUS line, the local device first discharges the VBUS line below
VADP_DSCHG by turning on the current sink (IADP_SINK) for a fixed amount of time. This time
(TADP_DSCHG) must be long enough to ensure that VBUS goes below VADP_DSCHG for all valid
combinations of remote resistance, capacitance and leakage current. After the VBUS voltage is below
VADP_DSCHG, the current sink is turned off, and the current source (IADP_SRC) is turned on. When the
VBUS voltage reaches VADP_PRB, the current source is turned off. The time required for VBUS to rise to
VADP_PRB (TADP_RISE) is measured.
If the time taken for VBUS to rise exceeds what would be expected for a remote device with a
capacitance of CRPB max, then the local device is allowed to terminate the ramp, and simply store the
maximum value as the ramp time.
After a time of either TA_ADP_PRB for an A-device or TB_ADP_PRB for a B-device, this probe cycle is
repeated, and the rise time is again measured. If both devices happen to be probing on attachment the
different values of probe time for A-devices and B-devices prevent repeated collisions between
successive probes. If a remote device is attached or detached, then the rise time changes. The probe
23
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
cycle timing for successive probe measurements on a given device must be within TADP_PRB_JTR. This
allows a B-device to turn on its probe sensing in a small window around the expected probing time in
order to save energy.
When doing ADP probing, a device is required to ignore any changes in capacitance that are less than
CADP_THR min. If the capacitance changes by more than CADP_THR, the device shall detect that as
either an attach or detach event.
When an OTG A-device is ready to act in host or peripheral role or an EH is ready to act as host, and
VBUS is not present, VBUS is required to reach VOTG_SESS_VLD within TA_VBUS_ATT of an attachment
event being detected by ADP unless an over-current condition is reached (see also Section 4.2.4).
After a session has ended, an ADP-capable B-device is required to do ADP sensing until it detects that
the remote device is not doing ADP probing. During ADP sensing, the B-device uses the sensing
comparator to detect the ADP pulses applied to VBUS by the A-device. If the B-device ADP sense
comparator does not toggle for a time of TB_ADP_DETACH, then the B-device is allowed to do ADP
probing.
If a B-device starts doing ADP probing after a session, and it already measured the ramp time before the
session, then it should do SRP if the two ramp times differ by more than CADP_THR.
If a B-device starts doing ADP probing after a session and it has not measured the ramp time before the
session, then it should do SRP immediately after the first ADP probe pulse.
If the ADP ramp time after dropping VBUS differs from the ADP ramp time before asserting VBUS by a
time proportional to CADP_THR or more, then the A-device shall again assert VBUS.
When an ADP-capable B-device is first powered up, and VBUS is not present, it shall perform at least one
ADP probe cycle in order to obtain an initial value for TADP_RISE. The B-device shall then perform SRP
to see if an A-device is attached. If an A-device does not assert VBUS within TB_SRP_FAIL, then the B-
device is allowed to do ADP probing.
If the ADP rise time after SRP differs from the ADP rise time before SRP by a time proportional to
CADP_THR or more, then the B-device shall issue another SRP pulse.
24
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
Common:
Local Disconnect to Data Line 5.2.1,
Discharge
TLDIS_DSCHG 25 µs
5.2.2
ADP cycle to cycle jitter TADP_PRB_JTR 5 % 5.4.2
A-device:
B-device:
Session end to SRP init TB_SSEND_SRP 1.5 sec 5.1.2
12
Time values (with the exception of those for ADP which have their own requirements) should have
precision and accuracy to within 2,500 ppm for FS capable devices and 500 ppm for HS capable
devices.
13
It is expected that a typical implementation would be able to respond in far less time than the
maximum value.
14
An A-device is also allowed to use a probing period of .625sec to .925sec.
15
In order to improve usability an A-device should respond to SRP in much less than 5 seconds.
25
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
16
A B-device is also allowed to use a probing period of .85sec to 1.3sec
26
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
6 Device Framework
6.1 OTG descriptor
During enumeration, an A-device shall request the OTG configuration descriptor from the B-device. Any
B-device that supports either HNP or SRP or ADP shall respond to a GetDescriptor(OTG) request with
its OTG descriptor. This request shall be treated in the same way as any other GetDescriptor command
such that it may be requested in the Default, Addressed or Configured state. A B-device which does not
support the OTG descriptor shall stall the data stage of this request. When present, the OTG descriptor
shall be present in all configurations. The B-device shall also return the OTG descriptor as part of a
GetConfiguration request.
The OTG descriptor consists of the following fields: bLength, bDescriptorType, bmAttributes and
bcdOTG, with bits as defined in Table 6-1. For OTG devices the bmAttributes field only indicates
support provided by a B-device acting in peripheral role.
27
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
A B-device that supports this feature shall be able to accept the SetFeature command in the Default,
Addressed and Configured states. [USB2.0] states that setting a feature in the Default state for other
than test modes is unspecified. This supplement adds to the list of features that can be set in the
Default state.
Setting this feature when it is already set is not an error. The device receiving such a command will
acknowledge the command indicating successful completion.
A SetFeature command for this feature shall be executed on receipt of an uncorrupted command packet.
6.2.2.1 b_hnp_enable
Setting this feature indicates to the B-device that it has been enabled to perform HNP. The A-device is
required to set this feature and suspend the bus within THOST_REQ_SUSP when it determines that the B-
device wishes to become host (host_req_flag = TRUE). An A-device may set this feature if, and only if,
the B-device is connected directly to a Micro-AB port (i.e. no intervening hub between the Host and the
B-device).
This feature is only cleared on a bus reset or at the end of a session. It cannot be cleared with a
ClearFeature(b_hnp_enable) command.
6.2.2.2 a_hnp_support
This feature is required in order for A-devices to maintain compatibility with legacy B-devices supporting
earlier versions of the OTG and EH supplement. Setting this feature indicates to the B-device that it is
28
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
directly attached to an A-device port that supports HNP. This feature is not required to be supported by
B-devices compliant to this or subsequent versions of the OTG and EH supplement.
The A-device shall set this feature on any legacy B-device, complying with OTG supplement version 1.3
or earlier, that is attached to an A-device port that supports HNP. The A-device shall set this feature at
the start of a session, before any B-device configuration is selected. HNP capable B-devices shall not
return STALL in response to setting this feature.
If the A-device port that is attached to the B-device is not HNP capable, then the A-device shall not set
this feature.
Before putting the legacy B-device into a configuration, the A-device has the following three options with
regards to the b_hnp_enable and a_hnp_support features:
If the b_hnp_enable feature is set, the B-device is allowed to do HNP, regardless of whether or not the
a_hnp_support feature is set.
If the a_hnp_support feature is set, but the b_hnp_enable feature is not set, then it is likely that
b_hnp_enable will be set later when the A-device is finished using the bus.
If neither the b_hnp_enable or a_hnp_support features are set before the A-device puts the B-device in
a non-default configuration, then the B-device may indicate to the user that HNP is not supported
through the current connection.
The a_hnp_support feature is only cleared on a bus reset or at the end of a session. It cannot be
cleared with a ClearFeature(a_hnp_support) command.
6.2.2.3 a_alt_hnp_support
This feature is now obsolete.
A B-device that supports this feature shall be able to accept the GetStatus command in the Default,
Addressed and Configured states. [USB2.0] states that requesting status in the Default state is
unspecified. This supplement adds to the list of statuses that can be requested in the Default state and
defines a non-zero value of wIndex.
29
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
Byte D7 D6 D5 D4 D3 D2 D1 D0
0 Reserved shall be set to zero Host
request
flag
30
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
A peripheral device should warn its user of the possible consequences before using HNP polling to force
a role swap in situations where a badly timed role swap may cause data loss or corruption. For example,
a forced role swap in the middle of a long-running low-level disk copy using the Mass Storage Class
could result in a corrupted Mass Storage Device. The peripheral device may choose to warn or not to
warn the user based on knowledge of the current functions it is providing to the host, as some functions
may be more robust to unexpected disconnections than others.
31
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
An OTG A-device is required to perform HNP within TA_SRP_RSPNS max if it enumerates the B-device
and discovers that the test device is attached. An A-device (OTG or EH) is not required to display an
unsupported device message when attached to the test device. If an OTG A-device does display an
unsupported device message, the message shall not delay HNP. When connected to a test device, an
A-device is not allowed to drive a resume signal longer than 30 seconds.
If an OTG A-device has already granted the role of host to the test device once during a session, then
the OTG A-device is not required to grant the role of host to test device again during the same session.
All USB-IF high-speed host electrical compliance tests shall be performed on high-speed hosts. These
high-speed tests utilize the test modes defined in Section 7.1.20 of [USB2.0]. An OTG device or EH
shall support the test device that initiates these test modes. Upon enumeration by the host, the test
device presents a VID/PID pair that defines a test mode or operation to execute. Upon enumerating the
test device with VID of 0x1A0A, the Targeted Host shall perform the following operations based on the
PID presented. The test mode or operation shall occur on the port where the test fixture is attached.
0x0102 Test_J
0x0103 Test_K
0x0104 Test_Packet
0x0105 Reserved.
0x0106 HS_HOST_PORT_SUSPEND_RESUME
0x0107 SINGLE_STEP_GET_DEV_DESC
Test_SE0_NAK
Upon enumerating VID 0x1A0A/PID 0x0101, the host’s downstream port shall enter a high-speed
receive mode as described in Section 7.1.20 [USB2.0] and drives an SE0 until the controller is reset.
32
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
Test_J
Upon enumerating VID 0x1A0A/PID 0x0102, the host’s downstream port shall enter a high-speed J state
as described in Section 7.1.20 of [USB2.0] until the host controller is reset.
Test_K
Upon enumerating VID 0x1A0A/PID 0x0103, the host’s downstream port shall enter a high-speed K
state as described in Section 7.1.20 of [USB2.0] until the host controller is reset.
Test_Packet
Upon enumerating VID 0x1A0A/PID 0x0104, the host shall begin sending test packets as described in
Section 7.1.20 of [USB2.0] until the host controller is reset.
HS_HOST_PORT_SUSPEND_RESUME
Upon enumerating VID:0x1A0A/PID 0x0106, the host shall continue sending SOFs for 15 seconds, then
suspend the downstream port under test per Section 7.1.7.6.1 of [USB2.0]. After 15 seconds has
elapsed, the host shall issue a ResumeK state on the bus, then continue sending SOFs.
SINGLE_STEP_GET_DEVICE_DESCRIPTOR
When the host discovers a device with VID:0x1A0A/PID 0x0107, the following steps are executed by the
host and the device.
1. The host enumerates the test device, reads VID:0x1A0A/PID 0x0107, then completes its
enumeration procedure.
2. The host issues SOFs for 15 seconds allowing the test engineer to raise the scope trigger just
above the SOF voltage level.
3. The host sends a complete GetDescriptor(Device) transfer
4. The device ACKs the request, triggering the scope. (Note: SOFs continue.)
SINGLE_STEP_GET_DEVICE_DESCRIPTOR_DATA
When the host discovers a device with VID:0x1A0A/PID 0x0108, the following steps are executed by the
host and the device.
1. The host enumerates the test device and reads VID:0x1A0A/PID 0x0108, then completes its
enumeration procedure
2. After enumerating the device, the host sends GetDescriptor(Device)
3. The device ACKs the request
4. The host issues SOFs for 15 seconds allowing the test engineer to raise the scope trigger just
above the SOF voltage level
5. The host sends an IN packet
6. The device sends data in response to the IN packet, triggering the scope
7. The host sends an ACK in response to the data. (Note: SOFs may follow the IN transaction).
33
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
7 State Diagrams
This section contains state diagrams provided for the reference of OTG device, EH and SRP-capable
peripheral-only B-device implementers. In the case of any conflict between these diagrams and the
behavior described in the rest of the document, the state machines take precedence.
Figure 7-1 shows the state machine of an OTG A-device. Figure 7-2 shows the state machine of an EH.
Figure 7-3 shows the state machine of an OTG B-device. The HNP state machine for an OTG device is
equivalent to the OTG A-device state machine combined with the OTG B-device state machine. A state
diagram for an SRP-capable peripheral-only B-device is shown in Figure 7-4.
7.1 A-device
The OTG A-device state diagram shown in Figure 7-1 and EH state diagram shown in Figure 7-2
consists of the states listed in Table 7-1 and uses the parameters listed in Table 7-2.There is a transition
to the OTG B-device start state (b_idle) that occurs if the cable is detached. When the A-device is in
any state except the a_idle state, the A-device transitions to the a_wait_vfall state before transitioning to
the a_idle state and then to the b_idle state.
34
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
35
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
7.1.1 a_idle
This is the start state for A-devices.
36
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
if the A-device application is not wanting to drop the bus (a_bus_drop = FALSE), and any of the
following are true:
the A-device Application is requesting the bus (a_bus_req = TRUE), or
SRP is detected on the bus (a_srp_det = TRUE) or
an ADP change has been detected (adp_change = TRUE) or
the A-device has only just powered up its USB system (power_up = TRUE).
OTG devices are configured such that a change in id from TRUE to FALSE causes a_bus_req to be
asserted unless doing ADP probing (see Section 4.2.4) and that a change in id from FALSE to TRUE
causes a transition to the b_idle state. This does not apply to an EH since there is no ID pin in the
Standard-A plug.
7.1.2 a_wait_vrise
In this state, the A-device waits for the voltage on VBUS to go into regulation (a_vbus_vld = TRUE). Upon
entering this state, the A-device starts a timer (a_wait_vrise_tmr).
if the Micro-A plug is detached (id = TRUE, applies to OTG A-devices only), or
if the a_wait_vrise_tmr times out (a_wait_vrise_tmout = TRUE) or
if the A-device application wants to drop the bus (a_bus_drop = TRUE).
7.1.3 a_wait_bcon
In this state, the A-device waits for the B-device to signal a connection. Upon entering this state, the A-
device starts a timer (a_wait_bcon_tmr).
if the Micro-A plug is detached (id = TRUE, applies to OTG A-devices only), or
if the A-device Application wants to drop the bus (a_bus_drop = TRUE), or
if the a_wait_bcon_tmr times out (a_wait_bcon_tmout = TRUE) 17 .
If the A-device detects the B-device signaling a connection (b_conn = TRUE), then the A-device shall
transition to the a_host state and generate a bus reset within TA_BCON_ARST to prepare the B-device for
packet traffic.
If the attached device is unsupported due to an overcurrent condition (see Section 4.2.2), then the A-
device transitions to the a_vbus_err state.
7.1.4 a_host
In this state the A-device performs the following actions:
17
An A-device may set its a_wait_bcon_tmr to an arbitrarily large value and wait an indefinitely long
period of time for the B-device to connect.
37
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
If the B-device disconnects (b_conn = FALSE) then the A-device transitions from the a_host state to the
a_wait_bcon state 18 .
Under the following conditions the A-device transitions from the a_host state to the a_wait_vfall state.
if the Micro-A plug is detached (id = TRUE, applies to OTG A-devices only), or
if the A-device wishes to stop powering VBUS (a_bus_drop = TRUE)
.
Under the following conditions, the A-device transitions from the a_host state to the a_suspend state:
if the application on the A-device no longer wishes to use the bus (a_bus_req = FALSE)
If the attached device is unsupported due to an overcurrent condition (see Section 4.2.2), then the A-
device transitions to the a_vbus_err state.
7.1.5 a_suspend
Upon entering the a_suspend state, if HNP has been enabled (a_set_b_hnp_en = TRUE), an OTG A-
device starts the a_aidl_bdis_tmr. This timer can be set to an arbitrarily long time, but shall be longer
than TA_AIDL_BDIS min.
if the Micro-A plug is detached (id = TRUE, applies to OTG A-devices only), or
if the A-device wishes to stop powering VBUS (a_bus_drop = TRUE), or
if the a_aidl_bdis_tmr times out (a_aidl_bdis_tmout = TRUE)
An EH will transition to the a_wait_vfall state only if it wishes to stop powering VBUS (a_bus_drop =
TRUE)
For the OTG A-device state diagram in Figure 7-1 if the B-device signals a disconnect (b_conn = FALSE),
and the A-device was successful in setting b_hnp_enable (a_set_b_hnp_en = TRUE), then the A-device
transitions to the a_peripheral state 19 .
The A-device transitions to the a_host state if a_bus_req is asserted. If a_bus_req is asserted, then the
A-device can do a resume. If the A-device detects remote wakeup signaling from the B-device this may
cause the A-device to set a_bus_req depending on whether it is prepared to respond to this signalling.
If the B-device signals a disconnect (b_conn = FALSE), and the A-device did not set b_hnp_enable
(a_set_b_hnp_en = FALSE) or is an EH, then the A-device transitions to the a_wait_bcon state 20 .
18
If the same B-device subsequently reconnects the A-device should examine its descriptors to ensure
that the B-device is supporting the same device class as when it was previously connected.
19
If b_conn became FALSE due to the removal of the B-plug (rather than a disconnect) then
the a_bidl_adis_tmr will subsequently expire and the A-device will transition to a_wait_bcon. After this
the a_wait_bcon_tmr will expire and the A-device will transition to a_wait_vfall.
38
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
If the attached device is unsupported due to an overcurrent condition (see Section 4.2.2), then the A-
device transitions to the a_vbus_err state.
7.1.6 a_peripheral
This state is not applicable to an EH. In this state, the A-device signals a connection to the B-device
(loc_conn = TRUE) and responds to requests from the OTG B-device. If the A-device is capable of HS
operation, then it shall begin the high-speed detection handshake whenever a bus reset is detected.
The A-device transitions from the a_peripheral state to the a_wait_vfall state:
if the Micro-A plug is detached (id = TRUE), or
if the A-device wants to power down VBUS (a_bus_drop = TRUE)
The A-device transitions from the a_peripheral state to the a_wait_bcon state if the a_bidl_adis_tmr
times out (a_bidl_adis_tmout = TRUE). If the A-device detects more than TA_BIDL_ADIS min of continuous
idle (i.e. J_state), on the bus, then the A-device may transition to the a_wait_bcon state. If no activity is
detected after TA_BIDL_ADIS max the A-device shall transition back to the a_wait_bcon state.
If the attached device is unsupported due to an overcurrent condition (see Section 4.2.2), then the A-
device transitions to the a_vbus_err state.
This is the only state in which the A-device will signal a connection to the B-device.
7.1.7 a_wait_vfall
In this state the A-devices stops driving VBUS (drv_vbus = FALSE) and waits for VBUS to fall to
VOTG_VBUS_LKG.
The A-device transitions from the a_wait_vfall state to the a_idle state:
7.1.8 a_vbus_err
In this state, the A-device waits for recovery of the overcurrent condition that caused it to enter this state.
The A-device transitions to the a_wait_vfall state under the following conditions:
if the Micro-A plug is detached (id = TRUE, applies to OTG A-devices only), or
if the A-device is no longer capable of powering VBUS (a_bus_drop = TRUE)
upon assertion of a_clr_err (nominally by system software),
To preserve the integrity of the circuitry supplying power to VBUS, on entering this state it is
recommended that the A-device application no longer requires a drive to VBUS (a_bus_drop = TRUE).
20
If b_conn became FALSE due to the removal of the B-plug rather than a disconnect the
a_wait_bcon_tmr will subsequently expire and the A-device will transition to a_wait_vfall.
39
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
40
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
7.2.1 b_idle
In this state, the OTG B-device waits for a session to start by monitoring if VBUS rises above the Session
Valid threshold (b_sess_vld = TRUE). If VBUS rises above this threshold, the OTG B-device enters the
b_peripheral state and signals a connect (loc_conn = TRUE).
41
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
and if VBUS has been below the Session End threshold for at least TB_SSEND_SRP (b_ssend_srp
= TRUE),
and if the bus has been in the SE0 state for the minimum time before generating SRP
(b_se0_srp = TRUE).
If the Micro-A plug is inserted (id = FALSE), then the OTG B-device transitions to the a_idle state and
becomes an A-device.
7.2.2 b_srp_init
Upon entering this state, the OTG B-device attempts to initiate a session via SRP. Upon completion,
(b_srp_done = TRUE) the OTG B-device returns to the b_idle state, to wait for the A-device to drive VBUS
above the Session Valid threshold (b_sess_vld = TRUE).
If the Micro-A plug is inserted (id = FALSE), then the OTG B-device transitions to the b_idle state.
7.2.3 b_peripheral
In this state, the OTG B-device acts as the peripheral, and responds to requests from the A-device.
if the Application indicates that it wants to start a session (b_bus_req = TRUE) and
the A-device has granted the OTG B-device permission (b_hnp_en = TRUE) and
the bus is in the Suspend state, (a_bus_suspend = TRUE)
When a high-speed capable B-device enters this state it shall enable its pull-up on D+. After the B-
device enables its pull-up, it shall monitor the state of the bus to determine if a bus reset is being
signaled by the A-device. If the pull-up is turned on for TWTRSTHS 21 (Table 7-14 in [USB2.0]) and the
bus is in the SE0 state then a reset condition exists. If the B-device is capable of HS, it shall begin the
high-speed detection handshake any time that a bus reset condition exists.
7.2.4 b_wait_acon
In this state, the OTG B-device has received a SetFeature(b_hnp_enable) giving it permission to
assume the role of host and it has detected that the bus has gone to the Suspend state. Upon entering
this state, the OTG B-device turns off its pull-up resistor on D+, starts a timer (b_ase0_brst_tmr), and
waits for the A-device to signal a connect.
21
The TWTRSTHS is a sample point that occurs at a device dependent time after the pull-up resistor is
turned on.
42
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
If the A-device signals a connect (a_conn = TRUE) before the b_ase0_brst_tmr expires, then the B-
device transitions to the b_host state. The B-device shall be able to detect the connect from the A-
device and transition to the b_host state within TB_ACON_BSE0 max after D+ is detected to be high at the
B-device.
7.2.5 b_host
Upon entering this state, the B-device issues a bus reset, and starts generating SOF’s. The B-device
may query the A-device for its descriptors.
While the B-device is in this state, the A-device responds to requests from the B-device. If the B-device
does not support the A-device, then the B-device shall provide a message to the user informing them of
this.
The B-device stops generating bus activity (loc_sof = FALSE) and transitions to the b_peripheral state:
once the B-device has completed its usage of the A-device (b_bus_req = FALSE), or
if the B-device detects that the A-device has signaled a disconnect (a_conn = FALSE), or
within 30 seconds of the OTG B-device detecting that a test device, as defined in section 6.4, is
attached (test_device =TRUE)
43
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
START
bp_idle
loc_conn/
b_sess_vld/ adp_sns or adp_prb
44
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
7.3.1 bp_idle
In this state, the SRP-capable peripheral-only B-device waits for a session to start by monitoring if VBUS
rises above the VBUS Session Threshold (b_sess_vld = TRUE). If VBUS rises above this threshold, the
SRP-capable peripheral-only B-device enters the bp_peripheral state.
The B-device transitions from the bp_idle state to the bp_srp_init state:
7.3.2 bp_srp_init
Upon entering this state, the SRP-capable peripheral-only B-device attempts to start a session via SRP
defined. Upon completion (b_srp_done = TRUE) the B-device returns to the bp_idle state, to wait for the
A-device to drive VBUS above the Session Valid threshold (b_sess_vld = TRUE).
7.3.3 bp_peripheral
In this state, the B-device acts as a [USB2.0] compliant device.
If VBUS drops below the Session Valid threshold (b_sess_vld = FALSE), then the device transitions to the
bp_idle state.
45
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
7.4.1 Inputs
7.4.1.1 id
The identification (id) input is FALSE when a Micro-A plug is inserted in the device’s Micro-AB receptacle.
Otherwise, this input is TRUE.
7.4.1.2 adp_change
The ADP change value (adp_change) is TRUE when an OTG device, EH or SRP-capable peripheral-only
B-device is doing ADP probing (adp_prb = TRUE) and two successive ADP measurement values are
different by more than CADP_THR (see section 5.4.2).
The ADP change value (adp_change) is TRUE when a B-device is doing ADP sensing of an ADP-capable
A-device and then detects that the ADP probing signal is no longer present.
Both of these indicate a potential change in the attachment status of the remote device. An ADP change
will cause the local device to determine whether the remote device is responsive by starting or
requesting a new session.
7.4.1.3 power_up
The power up value (power_up) is TRUE when the device first powers up its USB system.
7.4.1.4 test_device
The test device value (test_device) is TRUE when the OTG device or EH is attached to a test device (see
Section 6.4).
7.4.1.5 a_bus_drop
The “A-device bus drop” (a_bus_drop) input is TRUE when the Application running on the A-device wants
to power down the bus, and is FALSE otherwise. When this input is TRUE, then the a_bus_req input shall
be FALSE.
7.4.1.6 a_bus_req
The “A-device bus request” (a_bus_req) input is TRUE during the time that the Application running on the
A-device wants to use the bus, and is FALSE when the Application no longer wants to use the bus.
a_bus_req can also be set to TRUE in response to remote wakeup signaling from the B-device should the
A-device decide to resume the bus.
7.4.1.7 a_sess_vld
The “A-device session valid” (a_sess_vld) input is TRUE if the A-device detects that the voltage on VBUS
is above its Session Valid threshold (VOTG_SESS_VLD) (see Table 4-1).
46
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
7.4.1.8 a_srp_det
The “A-device SRP detect” (a_srp_det) input is TRUE if the A-device detects SRP as defined in Section
5.1. This bit is set when data line pulsing is detected. This variable is set to FALSE on initial power up of
the A-device (power_up = TRUE) or whenever the A-device transitions to the a_wait_vfall state.
7.4.1.9 a_vbus_vld
The “A-device VBUS valid” (a_vbus_vld) input is TRUE when the VBUS voltage is in regulation.
7.4.1.10 b_conn
The “B-device connect” (b_conn) variable is used by the A-device as a condition for transitioning
between the following states:
If b_conn is FALSE, it is set to TRUE if the B-device pulls D+ or D- high for longer than the debounce
interval. The debounce interval varies depending on how the a_wait_bcon state was entered, and how
long it has been since either D+ or D- has been pulled high. If the a_wait_bcon state was entered from
the a_peripheral, a_host or a_suspend states, then the short debounce interval (TA_BCON_SDB) is
allowed. If the a_wait_bcon state was entered from the a_wait_vrise state then the long debounce
interval (TA_BCON_LDB) is required.
The A-device is only allowed to apply the short debounce to b_conn in a window of time. If the A-device
stays in the a_wait_bcon state for longer than TA_BCON_SDB_WIN max, then the long debounce interval
applies no matter how the a_wait_bcon state was entered. If the state machine is timing the short
debounce interval, changes to D- and D+ do not affect the setting of b_conn if they occur before
TLDIS_DSCHG min.
While the A-device is in the a_host or a_suspend state, then the A-device will set b_conn FALSE if the A-
device detects that the B-device has disconnected, as described in Section 7.1.7.3 of [USB2.0]. The A-
device also sets b_conn to FALSE whenever it transitions to any state other than a_host or a_suspend.
[USB2.0] insures at least 100 ms from the time the device indicates a connect until the device will be
reset to start the session. This is not the case for OTG devices. They are not assured in all cases of a
100 ms interval after indicating a connect. When an OTG device signals connect, it shall be prepared to
receive the bus reset that starts the session.
7.4.1.11 a_bus_resume
The “A-device bus resume” (a_bus_resume) variable is TRUE when the B-device detects that the A-
device is signaling a resume (i.e. K state) on the bus.
If the B-device has transitioned to the b_wait_acon state, then a resume (i.e. K state) from the A-device
will cause the B-device to return to the b_peripheral state.
47
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
7.4.1.12 a_bus_suspend
The “A-device bus suspend” (a_bus_suspend) variable is TRUE when the B-device detects that the A-
device has put the bus into suspend 22 .
If the B-device has been enabled to become host (b_hnp_enable feature has been set), then the B-
device uses this variable to transition from the b_peripheral state to the b_wait_acon state
7.4.1.13 a_conn
The “A-device connect” (a_conn) variable is used by the B-device as a condition for entering or exiting
the b_host state.
If the B-device is in the b_wait_acon state, the B-device sets a_conn TRUE if the B-device detects a
connection from the A-device.
While the B-device is in the b_host state, it will set a_conn FALSE if the B-device detects that the A-
device has disconnected, as described in Section 7.1.7.3 of [USB2.0]. The B-device also sets a_conn to
FALSE whenever it goes to any state other than the b_host state.
7.4.1.14 b_bus_req
The “B-device bus request” (b_bus_req) input is TRUE during the time that the Application running on the
B-device wants to use the bus, and is FALSE when the Application no longer wants to use the bus.
7.4.1.15 b_se0_srp
The “B-device SE0 before SRP” (b_se0_srp) variable is TRUE when the B-device is in the b_idle state,
and the line has been at SE0 for more than the minimum time before generating SRP (TB_SE0_SRP) (see
Table 5-1)
7.4.1.16 b_ssend_srp
The “B-device session end SRP” (b_ssend_srp) input is TRUE if the B-device detects that the voltage on
VBUS has been below the Session Valid threshold (VOTG_SESS_VLD) for at least TB_SSEND_SRP
(see Table 4-1).
7.4.1.17 b_sess_vld
The “B-device session valid” (b_sess_vld) input is TRUE when the B-device detects that the voltage on
VBUS is above its B-device Session Valid threshold (VOTG_SESS_VLD) (see Table 4-1).
7.4.2 Outputs
7.4.2.1 data_pulse
The “data line pulsing” (data_pulse) signal is TRUE when a B-device is performing data line pulsing (see
Section 5.1.3).
22
As per Section 7.1.7.6 of [USB2.0], the downstream device (in this case the B-device) interprets more
than 3 ms of idle as an indication that the upstream device has suspended the bus.
48
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
7.4.2.2 drv_vbus
The “drive VBUS” (drv_vbus) signal is TRUE when an A-device is driving VBUS.
7.4.2.3 loc_conn
The “local connect” (loc_conn) variable is TRUE when the local device has signaled that it is connected to
the bus. This variable is FALSE when the local device has signaled that it is disconnected from the bus
(see Section 7.4.1.12).
7.4.2.4 loc_sof
The “local SOF” (loc_sof) bit is TRUE when the local device is generating activity on the bus. Activity
begins with a bus reset followed by start of frame packets (SOF’s) or low-speed keep-alives or any other
bus activity that occurs with enough frequency to prevent the peripheral device from sensing a lack of
bus activity.
7.4.2.5 adp_prb
The ADP probe variable (adp_prb) is TRUE when the local device is doing ADP probing (see section
5.4.2).
A B-device also has the option of doing ADP sensing if the remote A-device is doing ADP probing (see
Section 5.4.3).
7.4.2.6 adp_sns
The ADP sense variable (adp_sns) is TRUE when the local device is doing ADP sensing. This output is
used in preference to adp_prb when the B-device detects that the A-device is doing ADP probing (see
Section 5.4.3).
7.4.3.1 a_set_b_hnp_en
The “A-device set b_hnp_enable” (a_set_b_hnp_en) bit is TRUE when the A-device has successfully set
the b_hnp_enable bit in the B-device. The A-device sets this bit after it successfully sends a SetFeature
(b_hnp_enable) command to the B-device. The A-device clears a_set_b_hnp_en, upon entry into the
a_wait_bcon state or when the A-device asserts a bus reset.
7.4.3.2 b_srp_done
The “B-device SRP done” (b_srp_done) bit is TRUE when the B-device has completed initiating SRP.
7.4.3.3 b_hnp_en
The “B-device set b_hnp_enable” (b_hnp_en) bit is TRUE when the B-device has accepted the
SetFeature(b_hnp_enable). b_hnp_en is cleared on a bus reset or when b_sess_vld is FALSE (see
Section 6.2.2.1).
7.4.3.4 a_clr_err
The A-Device clear error (a_clr_err) is asserted to clear a_vbus_err due to an overcurrent condition and
causes the A-device to transition to a_wait_vfall.
49
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
a_bus_req
a_bus_drop
a_clr_err
b_bus_req
While the device shall demonstrate behavior related to these variables (i.e. the A-device shall turn on
VBUS in response to some activity, corresponding to receiving an a_bus_req) the actual implementation
and use of these variables is at the designer’s discretion. The inclusion of these variables within the
following state machines is not meant to convey required operation, but is an informative example only
to show the behavior of the system.
7.4.5 Timers
The HNP state machines make use of the timers in Table 7-7. All timers are started on entry to and
reset on exit from their associated states.
7.4.5.1 a_wait_vrise_tmr
This timer is used by an A-device in the a_wait_vrise state to wait for the voltage on VBUS to go into
regulation (a_vbus_vld = TRUE). If VBUS is not in regulation before and after TA_VBUS_RISE
(a_wait_vrise_tmout = TRUE), then this is an indication that the B-device is drawing too much current.
7.4.5.2 a_wait_vfall_tmr
This timer is used by an A-device in the a_wait_vfall state while waiting for the voltage on VBUS to fall
below the VBUS leakage voltage VOTG_VBUS_LKG. When this timer expires the A-device transitions to
a_idle.
7.4.5.3 a_wait_bcon_tmr
This timer is used by an A-device in the state to wait for the B-device to signal a connection, (b_conn =
TRUE). If the B-device does not connect before TA_WAIT_BCON, (a_wait_bcon_tmout = TRUE), then the A-
device is allowed to stop waiting for a connection.
50
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
7.4.5.4 a_aidl_bdis_tmr
This timer is started by an A-device when it enters the a_suspend state if HNP has been enabled
(a_set_b_hnp_en = TRUE). If the A-device does not detect a disconnect before TA_AIDL_BDIS
(a_aidl_bdis_tmout = TRUE), then the A-device is allowed to stop waiting for a disconnect and end the
session.
7.4.5.5 b_ase0_brst_tmr
This timer is used by a B-device in the b_wait_acon state, to wait for an A-device to signal a connection,
(a_conn = TRUE). If the A-device does not connect before TB_ASE0_BRST (b_ase0_brst_tmout = TRUE),
then the B-device shall return to the b_peripheral state.
7.4.5.6 a_bidl_adis_tmr
This timer is used by the A-device in the a_peripheral state. The “B-device idle timeout”
(a_aidl_bdis_tmout) variable is TRUE when the A-device detects that the B-device has been idle for a
sufficient amount of time to allow the B-device to have performed a reset 23 . The A-device uses this
variable to transition from the a_peripheral state to the a_wait_bcon state
23
In Section 7.1.7.6 of [USB2.0] the downstream device (in this case the A-device) interprets more than
3 ms of idle as an indication that the upstream device has suspended the bus. TA_BIDL_ADIS min is
much larger than this value. This means that it is possible for the B-device to suspend and resume the
bus provided that this is for less than TA_BIDL_ADIS min. Suspending the bus for more than TA_BIDL_ADIS
max indicates that the B-device no longer wants to act as host.
51
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
EHs are required to follow the USB 2.0 specification except where certain features are not required for
the proper functioning of the intended set of supported peripherals. EHs are at liberty to choose whether
they leave VBUS always powered, and whether they support SRP or ADP. These EHs must comply with:
EHs which support SRP and/or ADP or place limitations on their functionality based on their TPL (e.g.
output power) must comply with all of the electrical and protocol requirements of an OTG A-device
except for those relating to HNP. This includes:
Key features detailed in Section 3 (excluding the Micro-AB connector and HNP related features)
Operation as detailed in Sections 2, A.3.1, and A.3.2
Electrical characteristics for A-device host operation detailed in Sections 4.1 and 4.2.
Support for SRP as detailed for the A-device in Section 5.1
Support for suspend, resume, remote wakeup as defined in [USB2.0]
Support for ADP as detailed for the A-device in Section 5.4
Embedded Host state machine as detailed in Section 7.1
52
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
Figure A-1: OTG device to peripheral-only B-device with a hardwired captive cable
53
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
54
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
Peripheral-only Peripheral-only
OTG device OTG device
B-device B-device
Configure peripheral
24
If the Targeted Host does not support ADP it has no way to detect the B-plug attachment. The
Targeted Host can either leave VBUS turned on or raise VBUS in response to a user input (see Section
2.1.1).
55
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
Peripheral-only Peripheral-only
EH B-device EH B-device
B-plug attached
Disconnect
ADP change
B-plug detached
Switch VBUS on
ADP change
Session valid
Stop ADP probing
Connect
Switch VBUS on
Peripheral connection detected
No peripheral detected
Start host stack, Read descriptors,
check for OTG, check classes
Switch VBUS off
A-plug detached
Application completes USB activity
Continue ADP probing
(Cable unattached)
Switch VBUS off
56
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
No peripheral detected
Switch VBUS on Generate SRP
Switch VBUS off
Session valid
Start ADP probing
Connect (B-device unattached)
Configure peripheral
25
An EH without ADP capability will not be able to switch on VBUS in response to cable attachment.
57
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
26
An EH without ADP capability will not be able to switch on VBUS in response to cable attachment.
58
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
Targeted Peripheral-only
Host B-device
Start application
Switch VBUS on
Session valid
Connect
Configure B-device
Stop application
Figure A-7: User interaction with a Targeted Host when no session is active
59
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
A.2.1 Attachment
Figure A-8 shows the operation when attaching two OTG devices, and assumes full support for HNP,
SRP, and ADP (see also Section 3.4). In this case the devices are attached and then proceed to each
take the host role in order to discover each other’s capabilities.
27
It is recommended but not mandatory for the B-device to take the host role and carry out its own
discovery on attachment. This helps the B-device to determine whether it makes sense for it to carry out
HNP at a later stage based on the A-device’s capabilities as a peripheral.
60
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
OTG A OTG B
device device
Start application
Switch VBUS on
Session valid
Connect
GetStatus(OTG status)
Configure B-device
GetStatus(OTG status)
Stop application
61
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
Start application
Generate SRP
Start host stack,
Read descriptors,
Detect SRP check for OTG,
check classes
Switch VBUS on
Configure A-device
Session valid
Poll host request flag
Connect
GetStatus(OTG status)
Stop application
GetStatus(OTG status)
SetFeature( B_HNP_ENABLE )
Switch VBUS off
62
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
OTG A OTG B
device device
GetStatus(OTG status)
Start application
GetStatus(OTG status)
Configure B-device
GetStatus(OTG status)
63
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
64
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
65
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
66
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
67
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
The conditions for the two worst cases can be seen inTable B-1.
The ramp time with the remote device detached (shown in Table B-2) is calculated as:
TDET = CLCL * [(VADP_PRB - VADP_DSCHG) +/- (VADP_NOISE ) / IADP_SRC * 32kHz
The ramp time with the remote device attached (shown in Table B-3) is calculated as:
TATT = (CLCL + CRMT) * [(VADP_PRB - VADP_DSCHG) +/- (VADP_NOISE ) / (IADP_SRC – ILKG_RMT / 2) * 32kHz
The reason that only half the remote leakage current is used in the above calculation is that the remote
leakage current is maximum when VBUS is at ground, and it is zero when VBUS is at VOTG_VBUS_LKG.
The minimum time difference between attached versus detached is shown in Table B-4.
68
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
At the start of an ADP probe cycle, the ADP circuit must first discharge VBUS. The time required to
discharge VBUS from VVBUS_LKG to VADP_DSCHG is, to a first approximation:
TADP_RISE (the time required to charge VBUS from VADP_DSCHG to VADP_PRB) is the same as the
discharge time, TADP_DSCHG, or 2.2msec.
The average current consumption of the charging and discharging circuitry is then:
69
On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification May 8, 2009
Revision 2.0
Additional current will also be consumed by the control and timing circuitry.
70