STM32H7 I2S no data on Data line
Hello,
I am interfacing audio Codec SGTL5000 with STM32H7 Nucleo board. I2S peripheral is initialized using the HAL init function. I converted a wav file to a C array and trying to transmit that to the Codec. STM32 is configured as Master TX and Codec is configured as slave. The driver code is generated from CubeMX. Data is configured for 16 bit data format.
When I try to transfer the audio data, I do not to see any data on the I2S data line of the controller. After further debugging, I see that in the function HAL_I2S_Transmit(), on the specific line:
*ptxdr_16bits = *((uint16_t *)hi2s->pTxBuffPtr);
the TXDR register is supposed to get updated with the 16-bit data. But on checking the register values in debugger, I see that this register is not updated. After this line is executed, on logic analyzer, I can see that the SCLK and LRCLK clocks are generated at the correct frequencies and these clocks keep running forever. But as there is not data to be transferred in TXDR, there is no activity on the data line.
I have spent a good amount of time debugging but with no success. Please suggest if I am missing something.
Thanks.