USB OTG Capabilities of SmartFusion2
2.3.3.1 USB OTG Mode Execution Flow
Figure 3
describes the USB OTG mode execution flow.
Figure 3 • USB OTG Execution Flow
The demo application configures MMUART_1 for serial communication, SPI_0 to access SPI-Flash, and
GPIO to keep the USB controller out of reset. The application registers the USB callback functions and
USB interrupt service routine to handle the USB events like connect/disconnect, Host mode specific
events, and Device mode specific events.
When the SmartFusion2 device is connected to the host PC with Micro-B to A USB cable, the USB
connect interrupt is generated and the Host mode flag is set to 0. The USB controller enters into mass
storage class device mode and starts responding to the commands from the host PC. The SmartFusion2
on-board SPI-Flash is accessed by the host PC as a disk drive/volume in the USB Device mode.
When the Micro-A to B receptacle USB cable with the USB mass storage device is connected to the
SmartFusion2 device, the connect interrupt is generated and the Host mode flag is set to 1. The USB
controller switches to the Host mode from the Device mode and accesses the USB mass storage device.
When the USB mass storage device is unplugged from the SmartFusion2 device, the Host mode flag is
set to 0 and disconnect interrupt is generated. The application releases the Host mode driver and waits
to enter into either the Device mode or Host mode based on the target device and type of plug connected
to the USB controller.
Revision 6
9
Need help?
Do you have a question about the SmartFusion2 and is the answer not in the manual?