Skip to main content
VPHAM.1
Explorer
June 16, 2023
Question

SAI DMA circular mode

  • June 16, 2023
  • 2 replies
  • 1122 views

I'm working on the SAI part to read the ICS4342MIC through I2S protocol, and looking for a way to stream a large amount of data from the microphone to the hyper ram (in memory mapped mode). The current available feature of the HAL_SAI_Receive_DMA function only allows me to use the circular mode on a single large buffer, unable to update the hyper ram pointer in the descriptor, and require the CPU to do the memcpy for each interrupts. Would there be any other ways to setup the DMA for the SAI to have the CPU only update the hyperRam pointers in the descriptors ?

This topic has been closed for replies.

2 replies

Danish1
Lead III
June 18, 2023

I think the problem is with HAL rather than the stm32 itself.

HAL is a great way to learn how to do the simple things. But it does not cover many of the capabilities of the stm32U5. And in some ways that makes the next steps in the learning-cure more steep.

The Reference Manual describes a mode where GPDMA can have a linked-list of descriptors. So it should be  possible for the DMA to automatically move to the next block of memory. I haven't studied it sufficiently deeply to know how to do it - that's not a family I use. I guess it's a step or two beyond stm32f7 where there were two descriptors with automatic toggle between them; the cpu just had  to update one while the other was busy.

AScha.3
Super User
June 18, 2023

maybe you could change the buffer (128KB size) after each access - where you want to store all data after...3 or 5 accesses ????

so: usual way: circular buffer, 2 parts, half and full callbacks, and move or consume data there.

this works continuous - or you have better idea ?

"If you feel a post has answered your question, please click ""Accept as Solution""."