The CR field is not some magic number - it just sets a divisor for MDC clock on MDIO interface. As per IEEE 802.3 the MDC frequency must not exceed 2,5 MHz. But there is a catch - HCLK can be derived from HSI, which can go up to +4,5% above the nominal frequency, or some other inaccurate clock source. Therefore it needs some margin. It seems that the formula they used to calculate the maximum HCLK frequencies, is:
- Fmax = 2,5 MHz * div - 5 MHz
Obviously applying a constant offset is a very dumb and flawed way to calculate a frequency margin. For example, at 150 MHz an offset of 5 MHz gives a margin of just a 3,3%, which is not enough for an universal approach. I recommend choosing such a divider that MDC frequency does not exceed, for example, 2,3 MHz, which gives 8,7% margin.
Again, instead of explaining how things work, the documentation writer tried to think for the developer... and failed. Though, as the frequency numbers are the same also in TI and Espressif Systems manuals, the source of this "great" formula most likely is Synopsis. The reference manuals for H7 series has a more detailed description, but still suggests the same poorly chosen frequency limits.
@Community member.
@KDJEM.1, how about adding a decent explanation of the MDC frequency in reference manuals?