cancel
Showing results for 
Search instead for 
Did you mean: 

Usage of HAL_PCDEx_SetTxFiFo() when using DMA

it3
Associate

Hello,

 

I am trying to implement a Hi-Speed USB Device on STM32 baremetal project for STM32MP131Axx by using STM32Cube_FW_MP13_V1.1.0.

 

I am using the internal DMA of USB OTG to get faster the bulk transfer. I have 2 questions since I would like to know the suitable FIFO size when using the internal DMA.

 

Q1

I found the following comment in HAL_PCDEx_SetTxFiFo() function in stm32mp13xx_hal_pcd_ex.c.

When DMA is used 3n * FIFO locations should be reserved for internal DMA registers

 

I am using the endpoint 1 as bulkout that the max packet size is 512 bytes. In this case, is the comment mean that I need to pass 384 words to HAL_PCDEx_SetTxFiFo() as below?

 

HAL_PCDEx_SetTxFiFo(&hpcd,
                    1,       // Use DIEPTXF1 for endpoint 1.
                    0x180);  // 384 words = 1536 bytes

 

 

Q2

I refered the following post. Is it same for STM32MP13 line that I should not allocate more than (4096 – 72 (for DMA descs)) bytes in total -> 0x3EE words when using DMA?

https://community.st.com/t5/stm32-mcus-embedded-software/problem-with-stm32h747-hs-usb-dma/m-p/165459 

 

Best regards,

0 REPLIES 0