Install STM32CubeMX and STM32CubeIDE
Two free tools from ST: STM32CubeMX sets up pins and peripherals in a window and writes the setup code, STM32CubeIDE is where you write, build and debug the code. Since STM32CubeIDE 2.0, CubeMX is no longer built in, so we install both.
In this lesson · 3 steps
1Install STM32CubeMX
- Open st.com/stm32cubemx, pick the version for your system and press Get latest (Download)
- ST asks you to log in. Create a free account if you don't have one, confirm it, then press Download again
- ST sends a download link to your email. Open it and the download starts
- Run the installer and keep all the default options
Why?
CubeMX is the graphical setup tool. You click a pin, pick what it does, and CubeMX generates the C code that sets it up.
2Install STM32CubeIDE
- Open st.com/stm32cubeide and pick your system. You already have an account, so just log in
- Run the installer, accept the licence, keep the default folder
- When it asks to install drivers, say yes: they let the computer talk to the ST-LINK on your board
Why?
CubeIDE is the editor, compiler and debugger. CubeMX hands the project over to it.
3Link CubeIDE to CubeMX
- Since CubeIDE 2.0, CubeMX is a separate program. In later lessons you open a project's
.iocfile (the CubeMX settings file) from CubeIDE, so the two must know about each other - Follow this short video once to set it up: CubeMX not in STM32CubeIDE 2.0? Fix it (6 minutes)
- No time for the video? This always works: open STM32CubeMX yourself → File → Load Project → pick the
.iocfile in your project folder. After Generate Code, refresh the project in CubeIDE (F5)
Why?
Then double-clicking an
.ioc file in CubeIDE opens it in CubeMX, and you can change the settings at any time.Check & troubleshoot
What you should see
- Both programs open
- Plug in the board: the ST-LINK LED near the USB connector lights up
- After lesson 1.1: double-clicking the project's
.iocfile in CubeIDE opens CubeMX
If it doesn't work
- No email from ST: check the spam folder, or press Download again on the ST page
- Board not found later: the ST-LINK driver comes with CubeIDE; if you skipped it, run the CubeIDE installer again