AnsweredAssumed Answered

HAL: STM32F427: Full Duplex I2S problems communicating with Audio Codec

Question asked by artes.benjamin on Apr 6, 2015
Latest reply on May 5, 2015 by artes.benjamin

I'm using the STM32F427 to communicate with a Wolfson Microelectronics WM8731[2] . I've hooked the codec into the I2S2 of the STM32f4. I've seen lots of code examples for this around the net, but they all use STM's legacy drivers and for time / technical reasons I've been unable to switch from HAL to Legacy.

I'm trying to get pretty standard I2S Full Duplex audio running between the STM32 and the codec. I thought it would be easiest to have the codec be master in these transactions and tried using a 12MHz ceramic crystal. I got the footprint wrong and was unable to salvage, so I superglued and hacked in a 12MHz crystal oscillator. This also didn't seem to work. The STM32 would completely ignore the word/frame clock and just output every data bit immediately. I found this errata that hinted to a bug in STM's I2S2 and attempted to fix it with the following code. No luck.

I moved to a 24.576MHz crystal (that's DIV2 at the codec's input to 12.288MHz) and things are starting to look up. The STM still doesn't seem to work in 96kHz mode, but in 48kHz mode I can atleast get transmits that follow the word / frame sync.