USB on-the-go full-speed (OTG_FS)
1.
When the application sets the IN NAK for a particular endpoint, the core stops
transmitting data on the endpoint, irrespective of data availability in the endpoint's
transmit FIFO.
2.
Non-isochronous IN tokens receive a NAK handshake reply
–
3.
The core asserts the INEPNE (IN endpoint NAK effective) interrupt in OTG_DIEPINTx
in response to the SNAK bit in OTG_DIEPCTLx.
4.
Once this interrupt is seen by the application, the application can assume that the
endpoint is in IN NAK mode. This interrupt can be cleared by the application by setting
the CNAK bit in OTG_DIEPCTLx.
Application programming sequence:
1.
To stop transmitting any data on a particular IN endpoint, the application must set the
IN NAK bit. To set this bit, the following field must be programmed.
–
2.
Wait for assertion of the INEPNE interrupt in OTG_DIEPINTx. This interrupt indicates
that the core has stopped transmitting data on the endpoint.
3.
The core can transmit valid IN data on the endpoint after the application has set the
NAK bit, but before the assertion of the NAK Effective interrupt.
4.
The application can mask this interrupt temporarily by writing to the INEPNEM bit in
OTG_DIEPMSK.
–
5.
To exit endpoint NAK mode, the application must clear the NAK status bit (NAKSTS) in
OTG_DIEPCTLx. This also clears the INEPNE interrupt (in OTG_DIEPINTx).
–
6.
If the application masked this interrupt earlier, it must be unmasked as follows:
–
•
IN endpoint disable
Use the following sequence to disable a specific IN endpoint that has been previously
enabled.
Application programming sequence:
1108/1163
Isochronous IN tokens receive a zero-data-length packet reply
SNAK = 1 in OTG_DIEPCTLx
INEPNEM = 0 in OTG_DIEPMSK
CNAK = 1 in OTG_DIEPCTLx
INEPNEM = 1 in OTG_DIEPMSK
RM0402 Rev 6
RM0402
Need help?
Do you have a question about the STM32F412 and is the answer not in the manual?
Questions and answers