Table 133. Double-Buffering Buffer Flag Definition; Table 134. Bulk Double-Buffering Memory Buffers Usage - ST STM32F102 Series Reference Manual

Hide thumbs Also See for STM32F102 Series:
Table of Contents

Advertisement

RM0008
Table 133.
Buffer flag
The memory buffer which is currently being used by the USB peripheral is defined by DTOG
buffer flag, while the buffer currently in use by application software is identified by SW_BUF
buffer flag. The relationship between the buffer flag value and the used packet buffer is the
same in both cases, and it is listed in the following table.

Table 134. Bulk double-buffering memory buffers usage

Endpoint
Type
IN
OUT
1. Endpoint in NAK Status.
Double-buffering feature for a bulk endpoint is activated by:
Writing EP_TYPE bit field at '00' in its USB_EPnR register, to define the endpoint as a
bulk, and
Setting EP_KIND bit at '1' (DBL_BUF), in the same register.
The application software is responsible for DTOG and SW_BUF bits initialization according
to the first buffer to be used; this has to be done considering the special toggle-only property
that these two bits have. The end of the first transaction occurring after having set
DBL_BUF, triggers the special flow control of double-buffered bulk endpoints, which is used
for all other transactions addressed to this endpoint until DBL_BUF remain set. At the end of
each transaction the CTR_RX or CTR_TX bit of the addressed endpoint USB_EPnR
register is set, depending on the enabled direction. At the same time, the affected DTOG bit
in the USB_EPnR register is hardware toggled making the USB peripheral buffer swapping
completely software independent. Unlike common transactions, and the first one after
DBL_BUF setting, STAT bit pair is not affected by the transaction termination and its value
remains '11' (Valid). However, as the token packet of a new transaction is received, the
Double-buffering buffer flag definition
DTOG
DTOG_TX (USB_EPnRbit 6)
SW_BUF
USB_EPnR bit 14
DTOG SW_BUF
ADDRn_TX_0 / COUNTn_TX_0
0
1
Buffer description table locations.
ADDRn_TX_1 / COUNTn_TX_1
1
0
Buffer description table locations
0
0
1
1
ADDRn_RX_0 / COUNTn_RX_0
0
1
Buffer description table locations.
ADDRn_RX_1 / COUNTn_RX_1
1
0
Buffer description table locations.
0
0
1
1
USB full speed device interface (USB)
'Transmission' endpoint
Packet buffer used by USB
Peripheral
(1)
None
(1)
None
(1)
None
(1)
None
'Reception' endpoint
DTOG_RX (USB_EPnRbit 14)
USB_EPnR bit 6
Packet buffer used by
Application Software
ADDRn_TX_1 / COUNTn_TX_1
Buffer description table locations.
ADDRn_TX_0 / COUNTn_TX_0
Buffer description table locations.
ADDRn_TX_0 / COUNTn_TX_0
Buffer description table locations.
ADDRn_TX_0 / COUNTn_TX_0
Buffer description table locations.
ADDRn_RX_1 / COUNTn_RX_1
Buffer description table locations.
ADDRn_RX_0 / COUNTn_RX_0
Buffer description table locations.
ADDRn_RX_0 / COUNTn_RX_0
Buffer description table locations.
ADDRn_RX_1 / COUNTn_RX_1
Buffer description table locations.
479/690

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

This manual is also suitable for:

Stm32f101 seriesStm32f103 series

Table of Contents