AT32F425
Series Reference Manual
2022.03.30
Page 377
Ver 2.01
The INCOMPISOIN interrupt in the OTGFS_GINTSTS register is a global interrupt. Therefore, when
more than one synchronous endpoints are in active state, the application must determine which one of
the synchronous IN endpoints has not yet completed data transfers.
To achieve this, read the DSTS and DIEPCTLx bits of all synchronous endpoints. If the current endpoing
has been enabled, and the read value of the SOFFN bit in the OTGFS_DSTS register is equal to the
target frame number of the endpoint, it indicates that this endpoint has not finished data transfers. The
application must keep track of nd update the target frame number of the synchronous endpoint.
If data transfer is not yet complete on an endpoint, then Odd/Even bits have to be toggled.
Next:
(1) When the DPID is set to 1 (an odd frame) in the OTGFS_DIEPCTLx register, write 1 to the
SETD0PID bit in the OTGFS_DIEPCTLx register makes it an even frame, then data transmission starts
when there is an IN token input in the next frame.
(2) When the DPID is set to 0 in the OTGFS_DIEPCTLx register, write 1 to the SETD1PID bit in the
OTGFS_DIEPCTLx register makes it an odd frame, then data transmission starts when there is an IN
token input in the next frame.
20.5.4.18
Incomplete synchronous OUT data transfers
To initialize the controller after power-on reset, the application must perform the steps list in OTGFS
Initializtion. Before communicating with a host, the controller must follow the steps defined in Endpoint
Initializtion to initialize endpoints. This section describes the application programming sequence when
the controller drops synchronous OUT data packets.
【
Internal data flow
】
1. For synchronous OUT endpoints, the XFERC interrupt (in the OTGFS_DOEPINTx register) may not
always be generated. If the controller drops synchronous OUT data packets, the application may fail to
detect the XFERC interrupt in the OTGFS_DOEPINTx register.
When the receive FIFO cannot accommodate the complete ISO OUT data packet, the controller
drops the received ISO OUT data.
When the synchronous OUT data packet is received with CRC errors.
When the synchronous OUT token received by the controller is corrupted.
When the application is very slow in reading the receive FIFO
2. When the controller detects the end of periodic frames before transfer complete to all synchronous
OUT endpoints, an interrupt of incomplete synchronous OUT data is generated, indicating that an
XFERC interrupt in the OTGFS_DOEPINTx register is not set on at least one of the synchronous OUT
endpoints. At this point, the endpoint with the incomplete data transfer remains enabled, but no valid
transfers are in progress on this endpoint.
【
Application programming sequence
】
1. The assertion of the incomplete synchronous OUT data interrupt indicates that at least one
synchronous OUT endpoint has an incomplete data transfer in the current frame.
2. If this occurs because the synchronous OUT data is not completely read out from the endpoint, the
application must empty all synchronous OUT data (data and status) in the receive FIFO before
proceeding.
When all data are read from the receive FIFO, the application can detect the XFERC interrupt in
the OTGFS_DOEPINTx register. In this case, the application must re-enable the endpoint to receive
the synchronous OUT data in the enxt frame by following the steps listed in “SETUP/Data IN/Status
OUT”
3. When it receives an incomplete synchronous OUT data interrupt, the application must read the control
registers of all synchronous OUT endpoints to determine which one of the endpoints has an incomplete
data transfer in the current frame. An endpoint transfer is regarded as incomplete if both of the following
conditions are met:
OTGFS_DOEPCTLx. Even/Odd frame bit= OTGFS_DSTS.SOFFN[0]
OTGFS_DOEPCTLx. Endpoint enable = 0x1
4.
。
The pervious step must be performed before the SOF interrupt of the GINTSTS register is detected
to ensure that the current frame number is not changed.
5. For synchronous OUT endpoints with incomplete transfers, the application must drop the data in
memory, and disable the endpoint through the endpoint disable bit in the OTGFS_DOEPCTLx register.