USBD power-up sequence

nRF5340 Product Specification

The physical layer interface (PHY) of the USB transceiver has its own power-supply pin VBUS, which affects USBD power-up sequence.

The nRF5340 device is not able to properly signal its presence to the USB host and handle traffic from the USB host, unless the PHY power supply is enabled and stable. Turning the PHY power supply on or off is directly linked to register ENABLE. nRF5340 provides events that help synchronizing software to the various steps during the power-up sequence.

To make sure that all resources in USBD are available and the dedicated USB voltage regulator stabilized, the following is recommended:
  • Enable USBD only after VBUS has been detected
  • Turn the USB pull-up on after the following events have occurred:
    • USBPWRRDY
    • USBEVENT, with the READY condition flagged in EVENTCAUSE
The following sequence chart illustrates a typical handling of VBUS power-up.
Figure 3. VBUS power-up sequence
Page-1 Dynamic connector.647 Dynamic connector.643 Dynamic connector.644 Dynamic connector.645 Dynamic connector.646 Sheet.531 VBUS VBUS Sheet.534 POWER POWER Sheet.537 CLOCK CLOCK Sheet.540 Software Software Sheet.543 USBD USBD Sheet.609 Sheet.610 USBPULLUP=Enabled USBPULLUP=Enabled Dynamic connector.651 Sheet.602 HFCLKSTARTED HFCLKSTARTED Dynamic connector.650 Sheet.594 USBPWRRDY USBPWRRDY Dynamic connector.649 Sheet.656 Sheet.584 USBEVENT USBEVENT Sheet.586 EVENTCAUSE=READY EVENTCAUSE=READY Dynamic connector.655 Sheet.552 VBUS in valid range VBUS in valid range Dynamic connector Sheet.560 USBDETECTED USBDETECTED Dynamic connector.633 Sheet.576 HFCLKSTART HFCLKSTART Dynamic connector.640 Sheet.568 ENABLE=Enabled ENABLE=Enabled Dynamic connector.639 Sheet.657 HFCLK crystal oscillator now starting HFCLK crystal oscillator now starting Sheet.659 USBD has been initialized, but PHY has not powered up USBD has been initialized, but PHY has not powered up Sheet.661 PHY is now powered PHY is now powered Sheet.663 Enumeration starts Enumeration starts

Upon detecting VBUS removal, it is recommended to wait for ongoing EasyDMA transfers to finish before disabling USBD (relevant ENDEPIN[n], ENDISOIN, ENDEPOUT[n], or ENDISOOUT events, see EasyDMA). The USBREMOVED event, described in USBREG — USB regulator control, signals when the VBUS is removed. Reading the ENABLE register will return Enabled until USBD is completely disabled.