
GD32F403xx User Manual
640
USB transaction request or a channel operation request.
Application needs to write packet into data FIFO via AHB register interface if it wants to start
an OUT transaction on USB bus. USBFS hardware will automatically generate a transaction
request entry in request queue after the application wro te a whole packet.
The request entries in request queue are processed in order by transaction control module.
USBFS always tries to process periodic request queue f irstly and secondly process non-
periodic request queue.
Af ter a start of f rame, USBFS begins to process periodic queue until the queue is empty or
bus time required by the current periodic request is not enough, and then process the non-
periodic queue. This strategy ensures the bandwidth of periodic transactions in a f rame. Each
time the USBFS reads and pops a request entry f rom request queue. If this is a channel
disable request, it immediately disables the channel and prepares to process the next entry.
If the current request is a transaction request and the USB bus time is enough f or this
transaction, USBFS will employ SIE to generate this transaction on USB bus.
When the required bus time for the current request is not enough in the current frame, and if
this is a periodic request, USBFS stops processing the periodic queue and starts to process
non-periodic request. If this is a non-periodic queue, the USBFS will stop processing any
queue and wait until the end of current frame.
23.5.3.
USB device function
USB Device Connection
In device mode, USBFS stays at power-off state after initialization. After connecting to a USB
host with 5V power supply through VBUS pin or setting VBUSIG bit in USBFS_GCCFG
register, USBFS enters into powered state. USBFS begins to switch on the pull -up resistor
on DP line, thus, host side will detect a connection event.
Reset and Speed-Identification
The USB host always starts a USB reset when it detects a device connection, and USBFS in
device mode will trigger a reset interrupt by hardware when it detects the reset event on USB
bus.
Af ter reset sequence, USBFS will trigger an ENUMF interrupt in USBFS_GINTF register and
reports current enumerated device speed in ES bits in USBFS_DSTAT register, this bit field
is always 11(f ull-speed).
As describing in
USB 2.0 protocol, USBFS doesn’t support low-speed in device mode.
Suspend and Wake-up
A USB device will enter into suspend state if the USB bus stays at IDLE state and there is no
change on data lines f or 3ms. When USB device is in suspend state, most of its clock are
closed to save power. The USB host is able to wake up the suspended device by generating