cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G474 Nucleo. Overclock example for HRTIM problem

MSzaj.1
Associate II

I compiled example from st cube. I found in clock configuration this parameters:

RCC_OscInitStruct.PLL.PLLM = RCC_PLLM_DIV6;

 RCC_OscInitStruct.PLL.PLLN = 85;

This give to sysclk 177Mhz and it exceeds max frequency... when I set parameters to:

RCC_OscInitStruct.PLL.PLLM = RCC_PLLM_DIV5;

 RCC_OscInitStruct.PLL.PLLN = 68;

cubemx and calculation inside example show me 170Mhz, but then Hrtim stop generate 100kHz signal (its around 96kHz and it's unstable...). Period is calculated as:

/* Formula below works for PWM frequency > 83kHz (with prescaler ratio = 1) */

#define TIMA_PERIOD ((uint16_t)(((uint64_t)HRTIM_INPUT_CLOCK * 32) / TIMA_PWM_FREQ))

where

TIMA_PWM_FREQ = 100000

HRTIM_INPUT_CLOCK = 170000000

Another thing to errata?

1 ACCEPTED SOLUTION

Accepted Solutions
MSzaj.1
Associate II

My mistake... I put wrong define for oscillator... BTW, HSE define should be correct for board example, on stm32g474 NUCLEO it have define 8Mhz, when it is 24Mhz.

View solution in original post

2 REPLIES 2
MSzaj.1
Associate II

My mistake... I put wrong define for oscillator... BTW, HSE define should be correct for board example, on stm32g474 NUCLEO it have define 8Mhz, when it is 24Mhz.

Amel NASRI
ST Employee

Hi @MSzaj.1​ ,

Thanks for bringing this error to our attention.

This is reported internally to be fixed in coming STM32CubeG4 packages.

-Amel

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.