AT32F425
Series Reference Manual
2022.03.30
Page 351
Ver 2.01
Figure 20-4 Reading the receive FIFO
Mask RXFLVL interrupt
RXFLVL
interrupt?
Start
Read
GRXSTSP
PKTSTS=0x2 ?
BCNT > 0?
Unmask RXFLVL
interrupt
Unmask RXFLVL
interrupt
Read the received
packet from the
Receive FIFO
No
Yes
Yes
Yes
No
No
20.5.3.5 Special cases
(
1
)
Handling babble conditions
The OTGFS controller handles two cases of babble: packet babble and port babble. Packet babble
occurs if the device sends more than the largest packet size for the channel. Port babble occurs if the
controller continues to receive data from the device at EOF2 (the end of frame 2, which is very close to
SOF)
When the OTGFS controller detects a packet babble, it stops writing data to the receiver buffer and waits
for the completion of packet. When it detects the end of packet, the OTGFS flushes the data already
written in the receiver buffer and generates a babble interrupt.
When the OTGFS controller detects a port babble, it flushes the receive FIFO and disables the port.
Then the controller generates a Port disable interrupt. Once receiving the interrupt, the application must
determine that this is not caused by an overcurrent condition (another cause of the port disable
interrupt )by checking the PRTOVRCACT bit in the OTGFS_HPRT register, then perform a software
reset. The controller does not send any more tokens if a port babble signal is detected.
(
2
)
Handling device disconnected conditions
If the device is suddently disconnected, an interrupt is generated on a disconnect event (DISCONINT bit
in the OTGFS_GINTSTS register). Upon receiving this interrupt, the application must start a software
reset through the CSFTRST in the OTGFS_GRSTCTL register.
20.5.3.6 Host HFIR feature
The host frame interval register (HFIR) defines the interval between two consecutive SOFs (full-speed)
or Keep-Alive tokens. This field contains the number of PHY clock for the required frame interval. This
is maily used to adjust the SOF duration based on PHY clock frequencies.