2024-07-23 10:34 PM
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?
Best regards,