Question on SAI DMA buffer
Hi Team,
I am using a the SAI Peripheral from the STM32L5 family to read data from a master device. I am employing the DMA peripheral to read the data from SAI. I have a buffer of 32kb and I am using the STM board as a slave device. I am using the HAL_SAI_RxCpltCallback() to detect the buffer full status. However, I see that the DMA data is getting overwritten by the time it reaches the Rx complete callback function, unless I stop the DMA transfer inside the Rx complete callback (which is not preferred for the use case that I am working on). This is seen only for a certain frequencies of FS signal.
Here are my debug steps:
STEP-1: Start SAI DMA transfer
STEP-2: Wait for control to get into the HAL_SAI_RxCpltCallback()
STEP-3: Read the data from the DMA buffer within the HAL_SAI_RxCpltCallback()- Here's where I see the data is being overwritten when I read it.
DMA Settings: Circular Mode, 32 bit word transfer
SAI Settings: 32 bit data * 4 slots , slave mode.
Are there any suggestions to circumvent this issue? Any leads on this would be of help. Thanks in advance.
Regards,
Janani Sunil.
