background image

 
 

 

Introduction to EZ-USB® FX3’s High-Speed USB Host Controller 

 

 

www.cypress.com

 

Document No. 001-77960 Rev. ** 

FX3 High-Speed USB Host Controller 

The FX3 high-speed USB host controller has the following 
features: 

 

Complies with the USB 2.0 standard for high-speed 
(480 Mbps), full-speed (12 Mbps) and low-speed (1.5 
Mbps) functions 

 

Supports all transfer types: control, bulk, isochronous, 
and interrupt 

 

Supports SRP and HNP 

 

Supports suspend/resume and remote wakeup 

 

Supports high-bandwidth isochronous and interrupt 
transfers 

 

15 IN endpoints and 15 OUT endpoints in addition to 
control endpoint 0 

 

Flexible endpoint configurations  with the following 
properties: 

o

 

All endpoints are mapped to system memory 

o

 

All available memory can be allocated to 
endpoints 

o

 

Can be dynamically sized by firmware 

 

Performs all transaction scheduling in hardware 

FX3 USB Host API from SDK v1.1 

The  architecture of the  USB host is complicated. In most 
cases,  developers  are required to know about the host 
internal, as well as USB’s  protocol,  to program a USB 
host.  The  FX3 SDK  v1.1  includes a set of plug-and-play 
building blocks, including the USB host API module,  to 
reduce 

the complexity 

and 

simplify the system 

development of the FX3 USB host. Available API functions 
are highlighted below.  

 

Start and stop the USB host stack 

 

Enable/disable the USB host port 

 

Reset/suspend/resume the USB host port 

 

Get/set the device address 

 

Add/remove/reset an endpoint 

 

Schedule and perform EP0 transfers 

 

Set up/abort data transfers on endpoints 

Details  of each function call and its  usage  are  described 
and documented in the following C header file. 

${FX3_INSTALL_PATH}\firmware\u3p_firmware\inc\cyu3u
sbhost.h 

Running the FX3 USB Host Example 

Available in the FX3 SDK v1.1 are a set of examples that 
demonstrates the usage case of the FX3 high-speed USB 
host. These examples include: 

cyfxusbhost

 – FX3 as a USB host 

This example demonstrates the use of FX3 as a USB 2.0 
single-port  host. It supports simple HID-class and simple 
MSC-class devices. 

cyfxusbotg

 – FX3 as an OTG device 

This example demonstrates  the use of FX3 as an OTG 
device. When FX3 is connected to a PC USB host, it acts 
as  a bulk  loopback  peripheral  device. When  it is 
connected to a USB mouse, it can detect and track the 
mouse clicks, X-Y coordinates, and scroll changes. 

cyfxbulklpotg

 – FX3 connected to FX3 as an OTG device 

This example demonstrates the full OTG capability  of the 
FX3. When FX3 is connected to a PC USB host, it acts as 
a bulk loopback peripheral device. When it is connected to 
another FX3 running the same the firmware, it 
demonstrates SRP and HNP. 

Although a  step-by-step procedure is given only to the 

cyfxusbhost

 example in this section of the document, the 

other two examples follow the same idea. 

Figure 2. cyfxusbhost Example Setup 

 

To successfully run  the  cyfxusbhost  example,  you 
need the following software tools  and hardware 
components: 

 

FX3 SDK Version 1.1 Release 

o

 

Eclipse CDT IDE with Zylin GDB plug-in 

o

 

Example source and API libraries 

o

 

GNU ARM compiler 

 

Segger J-Link and J-Link GDB server application 

 

UART terminal and application (e.g., Teraterm) 

 

FX3 DVK with 5-V power supply 

 

Standard USB mouse and USB flash disk 

 

USB micro-B to standard-A adapter 

Summary of Contents for AN77960

Page 1: ...as almost completely replaced other communication methods between peripheral devices and a PC This holds true both for general purpose devices such as flash drives and mice and special purpose devices for specific applications According to the standard USB 2 0 specifications USB peripherals may not communicate directly with one another they may communicate only with a USB host which fully controls...

Page 2: ...vices or both supports only transfer types required by the supported peripheral devices offers optional hub support and has a relaxed power requirement These restrictions allow an embedded host to be implemented on a device with fixed limited memory USB On The Go OTG USB On The Go OTG allows two USB peripherals to talk to each other without requiring a personal computer Although OTG appears to add...

Page 3: ...ints Details of each function call and its usage are described and documented in the following C header file FX3_INSTALL_PATH firmware u3p_firmware inc cyu3u sbhost h Running the FX3 USB Host Example Available in the FX3 SDK v1 1 are a set of examples that demonstrates the usage case of the FX3 high speed USB host These examples include cyfxusbhost FX3 as a USB host This example demonstrates the u...

Page 4: ...on 2 Within the Eclipse IDE select File Import 3 An Import window pops up Select Existing Projects into Workspace then click Next 4 Click the radio button for Select root directory then click Browse 5 Browse to the example project directory and select the cyfxusbhost example then click OK The example project directory is usually located at FX3_INSTALL_PATH firmware basic_examples ...

Page 5: ...and recompile the project From the Project Explorer pane expand the USBHost project and then double click cyfxusbhost h to open the file Within the file change lines 44 and 45 from define CY_FX_HOST_VBUS_ENABLE_VALUE CyFalse define CY_FX_HOST_VBUS_DISABLE_VALUE CyTrue to define CY_FX_HOST_VBUS_ENABLE_VALUE CyTrue define CY_FX_HOST_VBUS_DISABLE_VALUE CyFalse After you make the changes it is ready t...

Page 6: ...w Zylin Embedded debug Native On the left pane under the Main tab the Project and C C Application fields automatically populate If not click on Browse and select them manually 4 On the left pane select the Debugger tab Type arm none eabi gdb exe in the GDB debugger field Select Verbose console mode 5 Select Commands tab type in target remote localhost 2331 monitor memU32 0xE0052000 0x15 under the ...

Page 7: ...ttings Figure 3 Required Jumper and Switch Settings OTG_ID J50 Close VBUS_IN J47 Close V5P0 J40 Close UART J101 104 1 2 PMOD 2 0 Routing J96 2 3 J97 2 3 J98 Open VBUS_CTRL J100 2 3 PMOD 2 0 SW40 1 ON SW40 2 ON SW40 3 OFF SW40 4 OFF OTG_ID J50 Close VBUS_IN J47 Close V5P0 J40 Close UART J101 104 1 2 PMOD 2 0 Routing J96 2 3 J97 2 3 J98 Open VBUS_CTRL J100 2 3 PMOD 2 0 SW40 1 ON SW40 2 ON SW40 3 OFF...

Page 8: ...st Project on FX3 DVK 1 Start the Segger J Link GDB Server by Start All Programs SEGGER J Link ARM Vx xxx J Link GDB Server via JTAG The SEGGER J Link GDB Server Vx xxx window pops up Power up the FX3 DVK board and then the ARM9 Core Id 0x07926069 shows up in the Target field Change the initial JTAG speed to 1000 kHz and select Little endian ...

Page 9: ...Introduction to EZ USB FX3 s High Speed USB Host Controller www cypress com Document No 001 77960 Rev 9 2 Now it is time for the firmware download Under Debug Configurations click Debug ...

Page 10: ...irmware execution stops at the breakpoint in main function 4 On top of the Debug pane select the Resume button If the FX3 USB host controller is running a line that says OTG Event 2 Input 1 shows up in the UART terminal set to 1152008N1N 5 Plug in either the USB flash drive or mouse to the DVK s USB port using the Micro B to A adapter The respective output shows in the UART terminal ...

Page 11: ...ost controller showed you a simple way to bring USB host capability to embedded applications Included in the document were associated library and firmware examples in the SDK As a result this application note gave you everything you need to start an implementation with ease About the Author Name Hingkwan Huen Title Systems Engineer Sr Staff Contact hkh cypress com ...

Page 12: ... www cypress com Document No 001 77960 Rev 12 Document History Document Title Introduction to EZ USB FX3 s High Speed USB Host Controller Document Number 001 77960 Revision ECN Orig of Change Submission Date Description of Change 3606545 HKH 05 2 2012 New Spec ...

Page 13: ...s where a malfunction or failure may reasonably be expected to result in significant injury to the user The inclusion of Cypress products in life support systems application implies that the manufacturer assumes all risk of such use and in doing so indemnifies Cypress against all charges This Source Code software and or firmware is owned by Cypress Semiconductor Corporation Cypress and is protecte...

Reviews: