STM32 Programming· Live

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
  1. Install STM32CubeMX
  2. Install STM32CubeIDE
  3. Link CubeIDE to CubeMX

1Install STM32CubeMX

  1. Open st.com/stm32cubemx, pick the version for your system and press Get latest (Download)
  2. ST asks you to log in. Create a free account if you don't have one, confirm it, then press Download again
  3. ST sends a download link to your email. Open it and the download starts
  4. 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

  1. Open st.com/stm32cubeide and pick your system. You already have an account, so just log in
  2. Run the installer, accept the licence, keep the default folder
  3. 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

  1. Since CubeIDE 2.0, CubeMX is a separate program. In later lessons you open a project's .ioc file (the CubeMX settings file) from CubeIDE, so the two must know about each other
  2. Follow this short video once to set it up: CubeMX not in STM32CubeIDE 2.0? Fix it (6 minutes)
  3. No time for the video? This always works: open STM32CubeMX yourself → File → Load Project → pick the .ioc file 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 .ioc file 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