STM32F723 USB HS FIFO arrangement
Hi,
Sometimes (randomly) I encounter a problem in firmware, even though sometimes it works well for hours without any problem.
The whole idea of the firmware is that it receives data over USB HS with DMA enabled and initiate a transfer over another interface, e.g. I2C, in transmit function of EP called upon dataout stage callback of ST USB Core middleware.
Everything works well, but sometimes I guess a problem is caused in USB. I have encountered with similar issue in another situation, which made EP0 to cause problem and stuck the USB. I fixed that issue by changing EP Max Packet Size and hence in USB FIFO, as I encounter a comment in HAL that in case of using USB DMA, some parts of FIFO are used as DMA registers.
In firmware, I have enabled all 8 IN and OUT EPs with the following MPS:
EP0 (ctrl)-> 64bytes
EP1 (int)-> 64bytes
EP2 (int)-> 64bytes
EP3 (int)-> 64bytes
EP4 (int)-> 128bytes
EP5 (int)-> 256bytes
EP6 (int)-> 256bytes
EP7 (int)-> 512bytesNote that all IN and OUT EPs are enabled and send/receive data.
And allocating FIFO as below (sizes are in word):
HAL_PCDEx_SetRxFiFo(hpcd, 512);
HAL_PCDEx_SetTxFiFo(hpcd, 0, 16);
HAL_PCDEx_SetTxFiFo(hpcd, 1, 16);
HAL_PCDEx_SetTxFiFo(hpcd, 2, 16);
HAL_PCDEx_SetTxFiFo(hpcd, 3, 16);
HAL_PCDEx_SetTxFiFo(hpcd, 4, 32);
HAL_PCDEx_SetTxFiFo(hpcd, 5, 64);
HAL_PCDEx_SetTxFiFo(hpcd, 6, 64);
HAL_PCDEx_SetTxFiFo(hpcd, 7, 128);Question: is the FIFO arrangement correct in case of using USB HS with DMA enabled?
I feel but not sure that there might be a problem in USB HAL or Hardware
