29.01.2015 Views

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

RM0008<br />

USB on-the-go full-speed (OTG_FS)<br />

Disable Channel<br />

if (STALL)<br />

{<br />

Transfer Done = 1<br />

}<br />

}<br />

else<br />

if (NAK or TXERR)<br />

{<br />

Rewind Buffer Pointers<br />

Reset Error Count<br />

Mask ACK<br />

Unmask CHH<br />

Disable Channel<br />

}<br />

else<br />

if (CHH)<br />

{<br />

Mask CHH<br />

if (Transfer Done or (Error_count == 3))<br />

{<br />

De-allocate Channel<br />

}<br />

else<br />

{<br />

Re-initialize Channel (in next b_interval - 1 Frame)<br />

}<br />

}<br />

else<br />

if (ACK)<br />

{<br />

Reset Error Count<br />

Mask ACK<br />

}<br />

The application is expected to write the data packets into the transmit FIFO when the<br />

space is available in the transmit FIFO <strong>and</strong> the Request queue up to the count<br />

specified in the MCNT field before switching to another channel. The application uses<br />

the NPTXFE interrupt in OTG_FS_GINTSTS to find the transmit FIFO space.<br />

b) Interrupt IN<br />

Unmask (NAK/TXERR/XFRC/BBERR/STALL/FRMOR/DTERR)<br />

if (XFRC)<br />

{<br />

Reset Error Count<br />

Mask ACK<br />

if (OTG_FS_HCTSIZx.PKTCNT == 0)<br />

{<br />

De-allocate Channel<br />

}<br />

else<br />

{<br />

Transfer Done = 1<br />

Unmask CHH<br />

Doc ID 13902 Rev 9 803/995

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!