I am using a STM32F4 MCU, currently prototyping on a Nucleo-F446RE. I have a PCM3060 audio CODEC to do the analog to digital conversion. I am attempting to use the I2S protocol in order to interface the stm32 chip with the CODEC to process real time audio signals. I have been using stm32CubeIDE to set up the peripherals and their settings.
Using I2C, I have configured the CODEC's ADC to act as a master, and the data coming out of it is 24Bit I2S format at 48KHz.
On the STM32 side of things, I have the I2S peripheral set up as half-duplex slave receive, data format as 24Bit on a 32Bit data frame, and 48Khz audio frequency.
I have been testing with inputting a low-frequency 440Hz sine wave to the codec and try to get some data coming out of the Digital Output pin. I have confirmed that the data coming out is correct by directly sending this ADC data out to the data in of the DAC, and seeing the analog output of the CODEC on an oscilloscope.
So far I have been using the HAL_I2S_receive functions to try and catch the CODEC's ADC output into a buffer in code but I am not able to see this buffer filling up at all. I first wanted to ask, what should be the size and data type of this receive buffer considering I am expecting 24Bit data? Should I be using DMA since I am attempting to capture constant real-time data? Are there any debugging tips anybody could give me to start finding some root issues with my approach? I am a newbie in the realm of audio processing so any answers are greatly appreciated!