2021-09-23 01:55 AM
I've always been a little unsure about how FIFO manages data transfer, so I ran a little experiment with a logic analyzer to understand it better, the result confused me even more.
I set up OCTOSPI to transmit 128 bytes to an external QSPI memory, with MDMA to handle the data transfer from DTCM to OCTOSPI data register.
Ok so with this setup I expect to see 8 buffer transfers (16 bytes each) by MDMA to move 128 bytes of data top OCTOSPI FIFO. Here's what the logic analyzer captured.
Each transition of the bottom trace (yellow) indicates an MDMA buffer transfer complete event. There are only 7! But all 128 bytes of data were successfully transmitted without error (I verified by reading them back). OCTOSPI fifo is 32 bytes deep, so maybe it pulled in 32 bytes in the first buffer transfer? But each buffer transfer should generate an interrupt, so there should still be 8 interrupt in total, no?
In the second experiment I increased the buffer transfer size to 64, OCTOSPI FIFO threshold is still 16.This time the buffer transfers occurred twice, as expected.
What I don't understand is how come MDMA was able to push 64 bytes into the 32 bytes deep FIFO? I guess there exist some sort of mechanism in the hardware that prevents FIFO being overrun by DMA transfer. With this in mind, I wonder, how should one determine the DMA buffer transfer size that yields the most efficient transfer to a comm peripherals with FIFO like OCTOSPI or SPI? And how does FIFO threshold come into the equation?
2024-07-31 01:28 AM
Hello!
I have alot of problems connecting MDMA to OCTOSPI1. I am using stm32h723zg and external flash EN2464-104HIP. I tried all logical and unlogical configurations and still doesnt work. Could you help me out and provide me with some sample code and cube configuration?
Thanks in advance