Hello. I use nrf5340 audio development kit with Zephyr OS. I configured I2S peripheral as master and sample frequency 44100 Hz. Using oscilloscope i measured that SCLK and MCK are 1.4 MHz. That's fine but my codec requires 11.2896 MHz MCLK. So in zephyr driver i2s_nrfx.c i commented out all ratios except x256.
ratios[] = {
// { 32, NRF_I2S_RATIO_32X },
// { 48, NRF_I2S_RATIO_48X },
// { 64, NRF_I2S_RATIO_64X },
// { 96, NRF_I2S_RATIO_96X },
// { 128, NRF_I2S_RATIO_128X },
// { 192, NRF_I2S_RATIO_192X },
{ 256, NRF_I2S_RATIO_256X },
// { 384, NRF_I2S_RATIO_384X },
// { 512, NRF_I2S_RATIO_512X }
};
At this point I got the following message via UART:
I2S MCK frequency: 11289600, actual PCM rate 44100.
But when I meassured clock pin, clock was not present. And since SCLK and WCLK are derived from MCK, they are not present too. I tried to change CLK source at the overlay file, but that didn't help to. When I reduced to ratio to 128 and 64, I successfully got 2.8 MHz and 5.6 MHz clocks. In overlay file at clock node hfclkaudio-frequency = <11289600>;