cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L4 - How to configure SAI to read audio from external Codec sending data via I2S

Jal Panchal
Associate III

Hi,

I have an eternal codec that sends data over I2S to a STM32L4 board (SensorTile with Cradle Expansion). Could anyone help me with the functions or sample code to configure the SAI port for I2S and reading the data from the Codec.

1 REPLY 1
Jal Panchal
Associate III

I set up the SAI port and am using the following functions:

uint8_t data[256];

HAL_SAI_Receive(&hsai_BlockA2, data, SAI_DATASIZE_16, 100 );

 USBD_CDC_SetTxBuffer(&hUsbDeviceFS, data, sizeof(data));

 USBD_CDC_TransmitPacket(&hUsbDeviceFS);

and reading the digital data on the computer.

I am unable to decipher the I2S serial data. Can anyone guide me?