2024-12-06 01:56 AM
Dear,
We using the STM32H7B0 (100pins)
When we sending to the USB port with the function CDC_Transmit_HS() he returns always USBD_BUSY after 1408 bytes.
We had found a article that says that the the value 0x174 isn't correct (see code below)
See: https://community.st.com/t5/stm32-mcus-embedded-software/problem-with-stm32h747-hs-usb-dma/td-p/165459
When we change it to 0x100 for the HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_HS, 1, xxx) than it works.
Why is this value incorrect?
Where we can change this value in STM32cubeMX?
Or doing we something else incorrect?
/* USER CODE BEGIN TxRx_HS_Configuration */
HAL_PCDEx_SetRxFiFo(&hpcd_USB_OTG_HS, 0x200);
HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_HS, 0, 0x80);
HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_HS, 1, 0x174);
/* USER CODE END TxRx_HS_Configuration */
Solved! Go to Solution.
2024-12-06 09:32 AM
Hi @OGhis
It exceeds the allowed FIFO size when DMA is enabled. The total FIFO size should not exceed 4024 bytes. When DMA is enabled, 72 bytes are reserved for DMA descriptors.
72 bytes reserved for DMA descriptors are calculated as (8ep+ep0) * 2 (directions) * size of each DMA descriptor in bytes (4 bytes). So, (8 ep×2×4) + (ep0×2×4)
This is not configurable in CubeMX. An internal ticket to update code generation when USB DMA is used in HS mode.
I suggest you look at the following article
How to select suitable endpoints for your STM32 US... - STMicroelectronics Community
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.
2024-12-06 09:32 AM
Hi @OGhis
It exceeds the allowed FIFO size when DMA is enabled. The total FIFO size should not exceed 4024 bytes. When DMA is enabled, 72 bytes are reserved for DMA descriptors.
72 bytes reserved for DMA descriptors are calculated as (8ep+ep0) * 2 (directions) * size of each DMA descriptor in bytes (4 bytes). So, (8 ep×2×4) + (ep0×2×4)
This is not configurable in CubeMX. An internal ticket to update code generation when USB DMA is used in HS mode.
I suggest you look at the following article
How to select suitable endpoints for your STM32 US... - STMicroelectronics Community
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.