🛠 STM32Cube HAL à 480 MHz sur le STM32H743ZI : VOS0, latence flash et HSE bypass
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
- HSE is an external bypass clock, not a crystal: the STM32duino variant configures
RCC_HSE_BYPASSwith 8 MHz supplied to the MCU — cutting the ST-LINK jumpers can kill the clock source on some configurations. - Voltage scale: 480 MHz requires the PWR regulator at VOLTAGE_SCALE_0; CubeMX projects that keep a lower scale silently cap the clock.
- Flash latency:
FLASH_LATENCY_4at 480 MHz (the STM32duinoSystemClock_Configuses PLLM=1, PLLN=120, PLLR=2 from the 8 MHz HSE, with AHB at HCLK/2 = 240 MHz). - 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
- Forgetting
--recursiveon the clone: half the HAL sources are missing and the project will not build. - Generating a CubeMX clock tree at 480 MHz without letting CubeMX set VOS0 and the flash latency — the MCU may hang at boot.
- Chasing a "dead board" after cutting jumpers: the 8 MHz HSE clock path involves the on-board ST-LINK circuitry.
Autres tutoriels pour cette carte
- Premiers pas sur le Nucleo-144 STM32H743ZI : core STM32duino, ST-LINK et premier Blink
- GPIO, ADC 16 bits et DAC sur le Nucleo STM32H743ZI : bouton, LED et potentiomètre
- MicroPython sur le Nucleo STM32H743ZI : le REPL 480 MHz via le port série ST-LINK
- Zephyr RTOS sur le Nucleo STM32H743ZI : west build, flash et le piège des 96 MHz
- FreeRTOS sur le Nucleo STM32H743ZI : le projet officiel CubeH7, tâches et file d'attente
- Serveur web sur l'Ethernet du STM32H743ZI : démo LwIP officielle, RMII et errata