cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H745 SAI DMA Error

hkim.5
Associate

hello,

i'm using stm32h745 mcu.

i want to using SAI interface to use MEMS MIC, ADAU7002 .

this sensor transmit 20bit PCM , 22050 hz data.

i used CUBEMX and SAI & DMA setting is here.

0693W00000SvTPzQAN.png0693W00000SvTQYQA3.jpg0693W00000SvTPpQAN.jpg 

0693W00000SvTWlQAN.png 

i can't select SAI interface data size 20bit, so i fixed HAL Driver to set datasize 20bit, but i don't receive 20bit data.

i can receive only 16bit data.

if i try to read 3bytes from buffer to read 20 bit data, but cracked data.

i try to read 2bytes from buffer, i can read data and save 16bit pcm .wav file.

i can't understand why i can read correct data and create .wav file .

where is lefted 4bit per pcm data??

i think that occured problem by dma.

can i fixed dma setting change half word to 4byte words??

if you think dma has no problem, please tell me what you think to solve this problem??

thankyou.

2 REPLIES 2
FBL
ST Employee

Hello @hkim.5​  & welcome to ST Community 😀

As you have already noted, the only supported Protocol data sizes in both CubeMX and the HAL driver are mentioned below.

0693W00000UnIhBQAV.pngWhat is the behavior if you set Data Size to the value "16 Bits Extended" in STM32CubeMX?

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Piranha
Chief II

If any of you would look at I2S format timing graph, you would see that the format is designed to be compatible between different data sizes. Therefore one can receive 20-bit data also with a 24-bit or 32-bit configuration.