Skip to main content
Visitor II
February 23, 2020
Solved

STM32G474 Nucleo. Overclock example for HRTIM problem

  • February 23, 2020
  • 2 replies
  • 1333 views

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?

    This topic has been closed for replies.
    Best answer by MSzaj.1

    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.

    2 replies

    MSzaj.1AuthorAnswer
    Visitor II
    February 23, 2020

    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.

    Technical Moderator
    March 24, 2020

    Hi @MSzaj.1​ ,

    Thanks for bringing this error to our attention.

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

    -Amel