2023-11-06 12:25 PM
They are defined like this in stm32h563xx.h:
/*Buffer Descriptor Mask*/
#define USB_PMA_TXBD_ADDMSK (0xFFFF0000UL)
#define USB_PMA_TXBD_COUNTMSK (0x0000FFFFUL)
#define USB_PMA_RXBD_ADDMSK (0xFFFF0000UL)
#define USB_PMA_RXBD_COUNTMSK (0x03FFFFFFUL)
ADDMSKs are correct, but I was expecting both COUNTMSK to be 0xFC00FFFFUL since both COUNT_TX and COUNT_RX are 10 bits [25:16]. When double buffering is used there is BLSIZE and NUM_BLOCK but I dont see anything about these in the header. Is there a reason the TXBD and RXBD_COUNTMSK are defined like this ?
2023-11-08 02:00 AM
Hello @mete ,
i'm checking this out i will come back to you as soon as possible .
BR
Hichem
2023-11-09 08:11 AM
Hello @mete
after investigation on this matter i have the following informations :
#define USB_DRD_SET_CHEP_TX_CNT(USBx,bEpChNum, wCount) \
do { \
/* Reset old TX_Count value */ \
(USB_DRD_PMA_BUFF + (bEpChNum))->TXBD &= USB_PMA_TXBD_COUNTMSK; \
\
/* Set the wCount in the dedicated EP_TXBuffer */ \
(USB_DRD_PMA_BUFF + (bEpChNum))->TXBD |= (uint32_t)((uint32_t)(wCount) << 16U); \
} while(0)
Internal ticket number: 165995 (This is an internal tracking number and is not accessible or usable by customers).
this has no effect on the HAL implementation of USB as this mask is not used so using the HAL you shouldn't have any issues .
BR