Universal serial bus full-speed host/device interface (USB) RM0444
1304/1390 RM0444 Rev 5
Channel/endpoint receive buffer descriptor n
(USB_CHEP_RXTXBD_n)
Address offset: n*8 + 4
This register description applies when corresponding CHEPnR register does not program
use of double buffering (otherwise refer to following register description).
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/channel descriptor and it is normally defined during
the enumeration process according to its maxPacketSize parameter value (see “Universal
Serial Bus Specification”).
16 (10000) 32 bytes
... ... ...
29 (11101) 58 bytes ...
30 (11110) 60 bytes 992 bytes
31 (11111) 62 bytes 1023 bytes
Table 228. Definition of allocated buffer memory (continued)
Value of
NUM_BLOCK[4:0]
Memory allocated
when BLSIZE=0
Memory allocated
when BLSIZE=1
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
BLSIZE NUM_BLOCK[4:0] COUNTn_RX[9:0]
rwrwrwrwrwrwrrrrrrrrrr
1514131211109876543210
ADDRn_RX[15:0]
rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw
Bit 31 BLSIZE: Block size
This bit selects the size of memory block used to define the allocated buffer area.
– If BLSIZE = 0, the memory block is 2-byte large, which is the minimum block
allowed in a half-word wide memory. With this block size the allocated buffer size
ranges from 2 to 62 bytes.
– If BLSIZE = 1, the memory block is 32-byte large, which permits to reach the
maximum packet length defined by USB specifications. With this block size the
allocated buffer size theoretically ranges from 32 to 1024 bytes, which is the longest
packet size allowed by USB standard specifications. However, the applicable size is
limited by the available buffer memory.
Bits 30:26 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 BLSIZE value as illustrated in Table 228.