2017-11-23 06:20 PM
In CubeMX version 4.23.0 when using a I2S interface with a STM32F405 processor:
- under parameter settings tab the 'Real Audio Frequency' is not updated correctly when you change the 'R' divider from the I2S PLL; the 'N' multiplier however does update the frequency.
2017-12-15 07:17 AM
What actually happens is that the I2S PLL multiplier and divider are not changed automatically to minimize your sample rate error.
If this is a bug or not might be debatable. In the end I wrote a little C program to get the best N,R combination for a given sample rate.
What is a bug though is the error calculation: With 1MHz input frequency into the I2S PLL the best combination for N,R is
Frequency 44099.508 error -0.0011% N 429 R 4 I2SDiv 38
If you put in the I2S configuration 'Custom Freq' and 44100Hz the frequency is calculated correctly as 44.099KHz but
'Error between Selected and Real' is displayed as 0.22% which is clearly an error.