Skip to main content
Adam_K
Associate II
May 23, 2020 8:34 PM UTC
Question

Do STM32CubeIDE generate correct System Clock Configuration code for Nucleo-F767ZI?

I'm using Nucleo-F767ZI, I am configuring the 25 kHz PWM signal on pin PD14, TIM4_CH3.

I set up clock source HSI RC 16MHz, HCLK 216 MHz , APB1 peripheral clocks 54 MHz, TIM4 PSC = 0 ARR = 2159 CKD = No Division.

As a result, I get PWM with a frequency of 50 kHz.

When I change  RCC_OscInitStruct.PLL.PLLM = 8; on  RCC_OscInitStruct.PLL.PLLM = 16; in main.c file the frequency is correct 25 kHz.

Is STM32CubeIDE generating bad code or did I make a mistake somewhere?

Regards, Adam.

This topic has been closed for replies.

2 replies

waclawek.jan
Super User
May 23, 2020 9:15 PM UTC

0693W000001pL8WQAU.png0693W000001pL8bQAE.png

JW

Adam_K
Adam_KAuthor
Associate II
May 23, 2020 9:50 PM UTC

This means that APB Timer clocks should be used to calculate PWM and not APB peripheral clocks.

Many thanks, Adam.