EasyManuals Logo

ST STM32F102 series User Manual

ST STM32F102 series
690 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 #496 background imageLoading...
Page #496 background image
USB full speed device interface (USB) RM0008
496/690
Reception buffer address n (USB_ADDRn_RX)
Address offset: [USB_BTABLE] + n*16 + 8
USB local Address: [USB_BTABLE] + n*8 + 4
Reception byte count n (USB_COUNTn_RX)
Address offset: [USB_BTABLE] + n*16 + 12
USB local Address: [USB_BTABLE] + n*8 + 6
This table location is used to store two different values, both required during packet
reception. The most significant bits contains the definition of allocated buffer size, to allow
buffer overflow detection, while the least significant part of this location is written back by the
USB peripheral at the end of reception to give the actual number of received bytes. Due to
the restrictions on the number of available bits, buffer size is represented using the number
of allocated memory blocks, where block size can be selected to choose the trade-off
between fine-granularity/small-buffer and coarse-granularity/large-buffer. The size of
allocated buffer is a part of the endpoint descriptor and it is normally defined during the
enumeration process according to its maxPacketSize parameter value (See “Universal
Serial Bus Specification”).
1514131211109876543210
ADDRn_RX[15:1] -
rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw -
Bits 15:1 ADDRn_RX[15:1]: Reception Buffer Address
These bits point to the starting address of the packet buffer, which will contain the data received by
the endpoint associated with the USB_EPnR register at the next OUT/SETUP token addressed to it.
Bit 0 This bit must always be written as ‘0’ since packet memory is word-wide and all packet buffers must be
word-aligned.
151413121110987654321 0
BLSIZE NUM_BLOCK[4:0] COUNTn_RX[9:0]
rwrwrwrwrwrwrrrrrrrrr r
Bit 15 BL_SIZE: BLock SIZE.
This bit selects the size of memory block used to define the allocated buffer area.
If BL_SIZE=0, the memory block is 2 byte large, which is the minimum block allowed in a word-wide
memory. With this block size the allocated buffer size ranges from 2 to 62 bytes.
If BL_SIZE=1, the memory block is 32 byte large, which allows to reach the maximum packet
length defined by USB specifications. With this block size the allocated buffer size ranges from 32 to
1024 bytes, which is the longest packet size allowed by USB standard specifications.
Bits 14:10 NUM_BLOCK[4:0]: Number of blocks.
These bits define the number of memory blocks allocated to this packet buffer. The actual amount of
allocated memory depends on the BL_SIZE value as illustrated in Table 141.
Bits 9:0 COUNTn_RX[9:0]: Reception Byte Count
These bits contain the number of bytes received by the endpoint associated with the USB_EPnR
register during the last OUT/SETUP transaction addressed to it.

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

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

ST STM32F102 series Specifications

General IconGeneral
BrandST
ModelSTM32F102 series
CategoryMicrocontrollers
LanguageEnglish

Related product manuals