Enabling MCLK on SAI2 (STM32H745I-DISCO)
I am posting this more as an open question, and perhaps to help someone else...
When configuring SAI2 for Audio in CubeMX I had some issues which stemmed from MCLK not appearing to work correctly for the Audio Codec. This would cause the wm8994 to become unresponsive after setting WM8994_AIF1_CLOCKING1 to expect AIF1 Clock Source = MCLK1 pin.
After some investigation I realised that the call to __HAL_SAI_ENABLE(&hsai...) was not being auto-generated from the config.
Adding it in the User Code section resolved the issue for me.
So my questions are..
- Should I expect this code to be autogenerated?
- Am I perhaps missing somewhere in Pinout & Configuration where I should enable this?
All other settings for SAI2; GPIO, DMA etc all seem to be generatred correctly from the config, just not this last part to enable MCLK.