RM0402
The channel-specific interrupt service routine for bulk and control OUT/SETUP
transactions is shown in the following code samples.
•
Interrupt service routine for bulk/control OUT/SETUP and bulk/control IN
transactions
a)
Unmask (NAK/TXERR/STALL/XFRC)
if (XFRC)
{
Reset Error Count
Mask ACK
De-allocate Channel
}
else if (STALL)
{
Transfer Done = 1
Unmask CHH
Disable Channel
}
else if (NAK or TXERR )
{
Rewind Buffer Pointers
Unmask CHH
Disable Channel
if (TXERR)
{
Increment Error Count
Unmask ACK
}
else
{
Reset Error Count
}
}
else if (CHH)
{
Mask CHH
if (Transfer Done or (Error_count == 3))
{
De-allocate Channel
}
else
{
Re-initialize Channel
}
}
Bulk/control OUT/SETUP
USB on-the-go full-speed (OTG_FS)
RM0402 Rev 6
1077/1163
1122
Need help?
Do you have a question about the STM32F412 and is the answer not in the manual?
Questions and answers