Skip to main content
TDJ
Senior III
April 3, 2021
Question

Possible CubeMX clock setup bugs (STM32H7)

  • April 3, 2021
  • 3 replies
  • 1524 views

1) When changing HPRE prescaler only CubeMX unexpectedly changes timer clock limits.

I think those limits should depend on VOS voltage which, in turn, depends on SYSCLK, rather than on post-HPRE clock. As a result, lowering timers' clock lowers the max limits - see the screenshots. This does not seem to make sense.

2) Interestingly, AHB1, AHB2, APB1, APB2 and AHB4 clocks do not get the warning.

3) Setting DFSDM1&2 clocks higher than the max allowed 140MHz does not cause any warnings. It is a bit unclear what max DFSDM clock is. In Table 23 on p. 84 DS13195 specifies 140MHz while in Table 107 on p. 162 it states max fDFSDMCLK is fSYSCLK.

4) Watch out! Generated SystemClock_Config() contains this line:

HAL_PWREx_ConfigSupply(PWR_DIRECT_SMPS_SUPPLY);

CubeMX 6.2.1 now by default wants to use SMPS power supply. It seems this is a deviation from the previous version.

5) It is not a CubeMX issue but RM0455 33.4.4 (pp. 1161, 1164, 1165) incorrectly states that Manchester clock time should stay within the limits defined by SYSCLK. It should be DFSDMCLK - which may or may not equal SYSCLK.

Tested with STM32H7A3VITx and CubeMX 6.2.1

Max STM32H7A3 clock frequencies are defined in DS13195, Table 23, p. 840693W000008ydsdQAA.png0693W000008ydsiQAA.png 

This topic has been closed for replies.

3 replies

Khouloud ZEMMELI
ST Employee
April 5, 2021

Hello @TJast​ 

Thanks for your feedback,

Could you please share your ioc file to check it?

Khouloud

TDJ
TDJAuthor
Senior III
April 5, 2021

Hi @Khouloud ZEMMELI​ , not a problem, I attach a repro.

There is more, DFSDM sample rate and sample time formulas found in RM0455 Rev 5:

  • 33.8.15 DFSDM filter x conversion timer register, p.1202
  • 33.4.13 Data unit block, p. 1176-1177

are not exactly equivalent while they probably should be.

TDJ
TDJAuthor
Senior III
April 5, 2021

@Khouloud ZEMMELI​ , one more thought: I think it would be beneficial if CubeMX allowed to set DFSDM input clock divider separately per each channel and independently from CLKOUT. Currently, CLKOUT needs to be enabled in order to set input clock divider, which probably does not make sense.

It seems that the current design of this CubeMX part does not well resemble the underlying concept.