EasyManuals Logo

ST STM32F101xx User Manual

ST STM32F101xx
1096 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #923 background imageLoading...
Page #923 background image
RM0008 USB on-the-go full-speed (OTG_FS)
Doc ID 13902 Rev 12 923/1096
Examples
This section describes and depicts some fundamental transfer types and scenarios.
Bulk OUT transaction
Figure 319 depicts the reception of a single Bulk OUT Data packet from the USB to the AHB
and describes the events involved in the process.
Figure 319. Bulk OUT transaction
After a SetConfiguration/SetInterface command, the application initializes all OUT endpoints
by setting CNAK = 1 and EPENA = 1 (in OTG_FS_DOEPCTLx), and setting a suitable
XFRSIZ and PKTCNT in the OTG_FS_DOEPTSIZx register.
1. host attempts to send data (OUT token) to an endpoint.
2. When the core receives the OUT token on the USB, it stores the packet in the RxFIFO
because space is available there.
3. After writing the complete packet in the RxFIFO, the core then asserts the RXFLVL
interrupt (in OTG_FS_GINTSTS).
4. On receiving the PKTCNT number of USB packets, the core internally sets the NAK bit
for this endpoint to prevent it from receiving any more packets.
5. The application processes the interrupt and reads the data from the RxFIFO.
6. When the application has read all the data (equivalent to XFRSIZ), the core generates
an XFRC interrupt (in OTG_FS_DOEPINTx).
7. The application processes the interrupt and uses the setting of the XFRC interrupt bit
(in OTG_FS_DOEPINTx) to determine that the intended transfer is complete.
init_out_ep
Host DeviceUSB
O
U
T
A
C
K
RXFLVL intr i
wr_reg (DOEPTSIZx)
wr_reg(DOEPCTLx)
64 bytes
O
U
T
N
A
K
xact _1
Application
XFRC
i
n
t
r
D
O
E
P
C
T
L
x
.
N
A
K
=
1
PKTCNT
0
XFRSIZ = 0
r
idle until intr
rcv_out _pkt()
idle until intr
On new xfer
or RxFIFO
not empty
1
2
3
4
5
6
7
8
XFRSIZ
= 64 bytes
PKTCNT = 1
EPENA = 1
CNAK = 1
ai15679b

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

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

ST STM32F101xx Specifications

General IconGeneral
BrandST
ModelSTM32F101xx
CategoryMicrocontrollers
LanguageEnglish

Related product manuals