Development environment: up to the first blinking LED
Set up STM32CubeIDE, the compiler and a debugger, then flash your first firmware. When the first LED lights up, the whole toolchain has been verified.
What you need
| Part | Example |
|---|---|
| IDE | STM32CubeIDE, VS Code + extensions |
| Compiler | arm-none-eabi-gcc (bundled with the IDE) |
| Debugger | ST-LINK (built into Nucleo boards), J-Link |
| Configuration tool | STM32CubeMX (set pins and clocks, then generate code) |
| Board | A development board such as the Nucleo-F411RE |
Steps for the first project
- Create a new project by board name
- In the CubeMX view, set the LED pin (for example PA5) to GPIO_Output
- Generate code and add the toggle code inside
while(1) - Build → start a debug session → check that the LED blinks
while (1) {
HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_5);
HAL_Delay(500);
}
When the LED does not light up
- Check the board schematic: is the LED really on that pin?
- Does the debugger connect? (The ST-LINK firmware often needs an update.)
- Did you write your code outside a
/* USER CODE BEGIN */block, so it was erased when the code was regenerated?
Once this step works, the compiler, linker, startup code and debugger are all known to be good.