Цитата
In the following pages, two address locations are reported for devices with “1 x 16 bits/word”
access scheme: the one to be used by application software while accessing the packet
memory, and the local one relative to USB peripheral access. To obtain the correct memory
address value to be used in the application software while accessing the packet memory,
the actual memory location address must be multiplied by two.
On devices with “2 x 16 bits/word” access scheme, the address location to be used by
application software is the same as the local one relative to USB peripheral access. The
packet memory on these devices should be accessed only by byte (8-bit) or half-word (16-
bit) accesses. Word (32-bit) accesses are not allowed.
access scheme: the one to be used by application software while accessing the packet
memory, and the local one relative to USB peripheral access. To obtain the correct memory
address value to be used in the application software while accessing the packet memory,
the actual memory location address must be multiplied by two.
On devices with “2 x 16 bits/word” access scheme, the address location to be used by
application software is the same as the local one relative to USB peripheral access. The
packet memory on these devices should be accessed only by byte (8-bit) or half-word (16-
bit) accesses. Word (32-bit) accesses are not allowed.
Допустим, понять еще... ладно, и понять не могу

Кубописатели в stm32f3xx_hal_pcd_ex.h предлагают такое решение:
CODE
/**
* @brief Gets address in an endpoint register.
* @param USBx: USB peripheral instance register address.
* @param bEpNum: Endpoint Number.
* @retval None
*/
#if defined(STM32F302xC) || defined(STM32F303xC) || \
defined(STM32F373xC)
#define PCD_EP_TX_ADDRESS(USBx, bEpNum) ((uint32_t *)((USBx->BTABLE+bEpNum*8)*2+ ((uint32_t)USBx + 0x400)))
#define PCD_EP_TX_CNT(USBx, bEpNum) ((uint32_t *)((USBx->BTABLE+bEpNum*8+2)*2+ ((uint32_t)USBx + 0x400)))
#define PCD_EP_RX_ADDRESS(USBx, bEpNum) ((uint32_t *)((USBx->BTABLE+bEpNum*8+4)*2+ ((uint32_t)USBx + 0x400)))
#define PCD_EP_RX_CNT(USBx, bEpNum) ((uint32_t *)((USBx->BTABLE+bEpNum*8+6)*2+ ((uint32_t)USBx + 0x400)))
#define PCD_SET_EP_RX_CNT(USBx, bEpNum,wCount) {\
uint32_t *pdwReg = PCD_EP_RX_CNT(USBx, bEpNum); \
PCD_SET_EP_CNT_RX_REG(pdwReg, wCount);\
}
#endif /* STM32F302xC || STM32F303xC || */
/* STM32F373xC */
#if defined(STM32F302xE) || defined(STM32F303xE) || \
defined(STM32F302x8)
#define PCD_EP_TX_ADDRESS(USBx, bEpNum) ((uint16_t *)((USBx->BTABLE+bEpNum*8)+ ((uint32_t)USBx + 0x400)))
#define PCD_EP_TX_CNT(USBx, bEpNum) ((uint16_t *)((USBx->BTABLE+bEpNum*8+2)+ ((uint32_t)USBx + 0x400)))
#define PCD_EP_RX_ADDRESS(USBx, bEpNum) ((uint16_t *)((USBx->BTABLE+bEpNum*8+4)+ ((uint32_t)USBx + 0x400)))
#define PCD_EP_RX_CNT(USBx, bEpNum) ((uint16_t *)((USBx->BTABLE+bEpNum*8+6)+ ((uint32_t)USBx + 0x400)))
#define PCD_SET_EP_RX_CNT(USBx, bEpNum,wCount) {\
uint16_t *pdwReg = PCD_EP_RX_CNT(USBx, bEpNum); \
PCD_SET_EP_CNT_RX_REG(pdwReg, wCount);\
}
Но откуда они узнали? Где написано?
Что-то я впадаю в депрессию при попытках разобраться с USB в STM32...