🛠 STM32Cube HAL à 480 MHz sur le STM32H743ZI : VOS0, latence flash et HSE bypass

STM32H7 Nucleo-144 (flagship: NUCLEO-H743ZI) · intermediaire · Schéma : IMG-stm32h7-nucleo-intermediaire-2-stm32h743zi-cube-hal-480mhz.svg — chaîne d'horloge du STM32H743ZI : HSE 8 MHz (bypass) → PLL1 → SYSCLK 480 MHz, régulateur en échelle VOS0 et latence flash FLASH_LATENCY_4 annotés, Nucleo-144 à côté avec LD1 (PB0), flat vector style, étiquettes en français, fond blanc.

What you will build

A bare-metal blink with the official STM32CubeH7 HAL (package tag v1.13.0) — and, more importantly, a correct understanding of what it takes to run this MCU at its rated 480 MHz: regulator at voltage scale 0, correct flash latency, and an HSE that is a bypass clock, not a crystal.

Step 1 — Get the firmware package

$ git clone --recursive https://github.com/STMicroelectronics/STM32CubeH7.git

The README warns: clone with --recursive (submodules). Middleware like TouchGFX/STemWin/STM32_Audio needs the click-through full package from st.com, but HAL/LL drivers, BSP and the per-peripheral examples are all in the git tree, under Projects/NUCLEO-H743ZI/Examples/{GPIO,ADC,DAC,SPI,I2C,UART,TIM,HRTIM,RNG,...}.

Step 2 — The blink (style of the official Examples/GPIO project)

/* main.c - blink LD1 (PB0) with STM32CubeH7 HAL.
 * Clocking: generate SystemClock_Config from CubeMX for SYSCLK 480 MHz.
 * 480 MHz requires PWR regulator VOLTAGE_SCALE0 and FLASH_LATENCY_4 -
 * the STM32duino variant does exactly this. */
#include "stm32h7xx_hal.h"

static GPIO_InitTypeDef led = {0};

void SystemClock_Config(void);   /* generated by CubeMX (480 MHz, VOS0) */

int main(void)
{
  HAL_Init;                    /* systick @1 ms, NVIC defaults */
  SystemClock_Config;          /* PLL1 from 8 MHz HSE -> 480 MHz SYSCLK */

  __HAL_RCC_GPIOB_CLK_ENABLE;
  led.Pin   = GPIO_PIN_0;        /* LD1 on PB0 */
  led.Mode  = GPIO_MODE_OUTPUT_PP;
  led.Pull  = GPIO_NOPULL;
  led.Speed = GPIO_SPEED_FREQ_LOW;
  HAL_GPIO_Init(GPIOB, &led);

  while (1) {
    HAL_GPIO_TogglePin(GPIOB, GPIO_PIN_0);
    HAL_Delay(250);              /* 2 Hz blink */
  }
}

Step 3 — The clock checklist for 480 MHz

  1. HSE is an external bypass clock, not a crystal: the STM32duino variant configures RCC_HSE_BYPASS with 8 MHz supplied to the MCU — cutting the ST-LINK jumpers can kill the clock source on some configurations.
  2. Voltage scale: 480 MHz requires the PWR regulator at VOLTAGE_SCALE_0; CubeMX projects that keep a lower scale silently cap the clock.
  3. Flash latency: FLASH_LATENCY_4 at 480 MHz (the STM32duino SystemClock_Config uses PLLM=1, PLLN=120, PLLR=2 from the 8 MHz HSE, with AHB at HCLK/2 = 240 MHz).
  4. 400 vs 480 MHz confusion: the H7 series was announced at 400 MHz in October 2016 and is now rated up to 480 MHz — older datasheets, errata notes and stale toolchains may still clock-limit at 400 MHz.

Expected result

LD1 blinks at 2 Hz; a debugger read of the RCC registers confirms SYSCLK 480 MHz, and HAL_GetTick keeps a clean 1 ms.

Common pitfalls

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials