ST STM32F405 Reference Manual page 1372

Hide thumbs Also See for STM32F405:
Table of Contents

Advertisement

USB on-the-go full-speed (OTG_FS)
3.
The application must read the Endpoint Control register for all isochronous IN
endpoints to detect endpoints with incomplete IN data transfers.
4.
The application must stop writing data to the Periodic Transmit FIFOs associated with
these endpoints on the AHB.
5.
Program the following fields in the OTG_FS_DIEPCTLx register to disable the
endpoint:
6.
The assertion of the Endpoint Disabled interrupt in OTG_FS_DIEPINTx indicates that
the core has disabled the endpoint.
Stalling non-isochronous IN endpoints
This section describes how the application can stall a non-isochronous endpoint.
Application programming sequence
1.
Disable the IN endpoint to be stalled. Set the STALL bit as well.
2.
EPDIS = 1 in OTG_FS_DIEPCTLx, when the endpoint is already enabled
3.
Assertion of the Endpoint Disabled interrupt (in OTG_FS_DIEPINTx) indicates to the
application that the core has disabled the specified endpoint.
4.
The application must flush the non-periodic or periodic transmit FIFO, depending on
the endpoint type. In case of a non-periodic endpoint, the application must re-enable
the other non-periodic endpoints that do not need to be stalled, to transmit data.
5.
Whenever the application is ready to end the STALL handshake for the endpoint, the
STALL bit must be cleared in OTG_FS_DIEPCTLx.
6.
If the application sets or clears a STALL bit for an endpoint due to a
SetFeature.Endpoint Halt command or ClearFeature.Endpoint Halt command, the
STALL bit must be set or cleared before the application sets up the Status stage
transfer on the control endpoint.
Special case: stalling the control OUT endpoint
The core must stall IN/OUT tokens if, during the data stage of a control transfer, the host
sends more IN/OUT tokens than are specified in the SETUP packet. In this case, the
application must enable the ITTXFE interrupt in OTG_FS_DIEPINTx and the OTEPDIS
interrupt in OTG_FS_DOEPINTx during the data stage of the control transfer, after the core
has transferred the amount of data specified in the SETUP packet. Then, when the
application receives this interrupt, it must set the STALL bit in the corresponding endpoint
control register, and clear this interrupt.
34.17.7
Worst case response time
When the OTG_FS controller acts as a device, there is a worst case response time for any
tokens that follow an isochronous OUT. This worst case response time depends on the AHB
clock frequency.
1372/1749
SNAK = 1 in OTG_FS_DIEPCTLx
EPDIS = 1 in OTG_FS_DIEPCTLx
At this point, the application must flush the data in the associated transmit FIFO or
overwrite the existing data in the FIFO by enabling the endpoint for a new transfer
in the next microframe. To flush the data, the application must use the
OTG_FS_GRSTCTL register.
STALL = 1 in OTG_FS_DIEPCTLx
The STALL bit always takes precedence over the NAK bit
RM0090 Rev 18
RM0090

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the STM32F405 and is the answer not in the manual?

Questions and answers

Table of Contents

Save PDF