STM32U5 SAI in I2S mode + GPDMA
Hi,
I have a board with an STM32U575 at the core.
I'm attempting to set up SAI receiver in I2S mode, with 32-bit 48kHz sampling. See my configuration of SAI A below:

I also want to receive the data continuously in circular mode via DMA (or GPDMA in the case of this MCU).
Reading other sources, I've concluded that the following setup should be established:

The audio DMA functions can be seen below. The Audio_Init() function is called once in the main function, and the CpltCallback functions are called by DMA interrupts.
static uint16_t audio_rx[AUDIO_BUFFER_SIZE];
static uint16_t audio_tx[AUDIO_BUFFER_SIZE];
void Audio_Init(){
audio_ready_flag = AUDIO_DATA_FREE;
if(HAL_SAI_Receive_DMA(&AUDIO_RX_PORT, (uint8_t *)audio_rx, AUDIO_BUFFER_SIZE) != HAL_OK){
Error_Handler();
}
if(HAL_SAI_Transmit_DMA(&AUDIO_TX_PORT, (uint8_t *)audio_tx, AUDIO_BUFFER_SIZE) != HAL_OK){
Error_Handler();
}
}
void HAL_SAI_RxHalfCpltCallback(SAI_HandleTypeDef *hi2s){
audio_ready_flag = AUDIO_DATA_READY_HALF;
}
void HAL_SAI_RxCpltCallback(SAI_HandleTypeDef *hi2s){
audio_ready_flag = AUDIO_DATA_READY_FULL;
}
(I'm omitting all the HAL stuff, since I've already showed the setup in the above images. I want to note that all of the HAL code seems to be configured correctly --> no errors or warnings)
When my hardware has no audio source connected to it, I would assume that the audio data stored via DMA in the audio_rx buffer should be equal to 0 (and maybe some weak noise).
However, my buffer is filled with what appears to be 16-bit garbage values:

Why is this? I've successfully implemented this code on my old build, which used a STM32G4.
I'm very thankful for any help I can receive on this issue!
Best regards,
Max Borglowe
