cancel
Showing results for 
Search instead for 
Did you mean: 

Bug in CubeMX - incorrect audio frequency

emil
Associate II
Posted on November 24, 2017 at 03:20

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.

1 REPLY 1
emil
Associate II
Posted on December 15, 2017 at 16:17

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.