Skip to main content
Associate II
September 3, 2026
Question

CubeMX2: USB PMA buffer descriptor table sizing error

Cubemx2 only allots enough buffer descriptor table space for 4 endpoints. When a 5th endpoint is added, the table will overlap with the data buffer. 

In the following generated code, address should be starting at 0x28 and not 0x20.

  HAL_PCD_PMAConfig(&hUSB_DRD_FS_PCD, 0x0, HAL_PCD_SNG_BUF, 0x20);
HAL_PCD_PMAConfig(&hUSB_DRD_FS_PCD, 0x80, HAL_PCD_SNG_BUF, 0x60);
HAL_PCD_PMAConfig(&hUSB_DRD_FS_PCD, 0x81, HAL_PCD_SNG_BUF, 0xA0);
HAL_PCD_PMAConfig(&hUSB_DRD_FS_PCD, 0x82, HAL_PCD_SNG_BUF, 0xE0);
HAL_PCD_PMAConfig(&hUSB_DRD_FS_PCD, 0x3, HAL_PCD_SNG_BUF, 0x120);
HAL_PCD_PMAConfig(&hUSB_DRD_FS_PCD, 0x83, HAL_PCD_SNG_BUF, 0x160);
HAL_PCD_PMAConfig(&hUSB_DRD_FS_PCD, 0x4, HAL_PCD_SNG_BUF, 0x1A0);

 

2 replies

T_Hamdi
ST Employee
September 18, 2026

Hello ​@G5658 

Thank you for bringing this issue to our attention.

I reported this internally.

Internal ticket number: CDM0065880

with regrads,

Hamdi 

"To give better visibility on the answered topics, please click on ""Accept as Solution"" on the reply which solved your issue or answered your question.Hamdi Teyeb"
ST Technical Moderator
October 16, 2026

Hi ​@G5658 

Thank you for bringing this issue to our attention. We’ve updated the PMA buffer base offset to 0x40, reserving space for the buffer descriptor table and preventing overlap with packet data buffers. The generated code will now place the first data buffer at 0x40. This fix is planned for the next release.

To give better visibility on the answered topics, please click on "Best answer" on the reply which solved your issue or answered your question.Best regards,FBL