Step1 Tools installation

Tools installation and first testClock.png 45min

Target description
Teach how to install the main tools for programming the STM32:

  • STM32CubeMX, a tool to set and graphically program all STM32 boards and products
  • STM32CubeIDE, the free IDE to develop the STM32 software
  • STM32CubeProg, a tool to load/spy software in the STM32 memory
  • STM32CubeL4, an STM32L4 MCU software package with embedded examples

Having completed this tutorial, you should be able to open the STM32 professional ecosystem.
You should also manage to bring applications from the ecosystem onto the NUCLEO board.
Finally, you will be able to run the blinking LED example in debug mode.

Prerequisites

  • Computer with Windows 7 (or higher)
  • Java installed
  • web access

Hardware

  • NUCLEO-L476RG[1] board (64-pin)
  • USB Type-A to Mini-B cable

1 Install STM32CubeMX

Clock.png 10min
STM32CubeMX is the tool to grapically program the STM32.

  • Download STM32CubeMX[2]

Stepbystep Download STM32CubeMX.png

  • Register on www.st.com web site if necessary.
  • Unzip the downloaded file and launch the SetupSTM32CubeMX-xxx corresponding to your OS.

STM32CubeMX is now installed on your computer.

2 Install STM32CubeIDE

Clock.png 10min
STM32CubeIDE is the Integrated Development Environment to develop STM32 software.

  • Download STM32CubeIDE[3]

Stepbystep Download STM32CubeIDE.png

  • Register on www.st.com web site if necessary.
  • Unzip the downloaded file and launch the STM32CubeIDE-xxx corresponding to your OS.

STM32CubeIDE is now installed on your computer, enjoy!

3 Install STM32CubeProg

Clock.png 5min
STM32CubProgrammer is a tool load/spy software in STM32.

  • Download STM32CubeProg[4]

Download STM32CubePROG.png

  • Unzip the downloaded file and launch the SetupSTM32CubeProgrammer-xxx.exe corresponding to your OS, and follow the instructions.

STM32 USB driver and STM32CubeProg are now installed on your computer.

4 Download STM32CubeL4 Firmware package

Clock.png 10min
STM32Cube MCU Package for STM32L4 Series and STM32L4 Plus Series.

  • Open STM32CubeMX
  • Click Manage embedded software packages in Help
  • Check the last STM32CubeL4 release version
  • Click Install (it may take a long time)

Stepbystep Download STM32CubeL4.png

  • Now STM32L4 libraries and examples are installed at the following location C:\Users\myname\STM32Cube\Repository\STM32Cube_FW_L4_Vx.xx.x.

5 Launch STM32CubeIDE in debug mode and run my first program

Clock.png 10min
Use the debug mode

  • Launch STM32CubeIDE
  • If STM32CubeIDE asks, select the default workspace
  • In File STM32CubeIDE menu, click on Open Projects from File System

Stepbystep Import Project.png

  • In the window, click Directory and select C:\Users\myname\STM32Cube\Repository\STM32Cube_FW_L4_Vx.xx.x\Projects\NUCLEO-L476RG\Examples_LL\GPIO\GPIO_InfiniteLedToggling
Info white.png Information
The path may be different depending on the product
  • Select the project GPIO_InfiniteLedToggling\SW4STM32\STM32L476RG_NUCLEO
  • Accept the popup, asking for conversion.

Project Converter.png

Info white.png Information
Ensure that the CN2 jumper is on, so there would not be any hardware problem.
Ensure also that the ST-Link driver is well installed.

Now your project is under STM32CubeIDE

  • Default STM32CubeIDE settings are adequate for this tutorial
  • Click on Debug icon to launch and debug the project

Stepbystep Debug STM32CubeIDE.png

  • Please ensure to click on “Shared ST-Link” option on Debug configurations and Debugger tab
  • Click Resume icon to continue the program execution

Stepbystep Resume STM32CubeIDE.png

Info white.png Information
To power the NUCLEO-L476RG, use its CN1 connector to connect it with a computer through an USB Type-A to Mini-B cable.

Now you are able to:

  • find STM32 libraries
  • open a project (example)
  • load a project in STM32CubeIDE
  • execute a project in debug mode
  • make a LED blink

Now you have in your computer:

  • libraries for STM32L4
  • examples for STM32L4
  • STM32CubeProg (to communicate with the MCU)
  • STM32CubeMX (to graphically generate your project)
  • STM32CubeIDE (to code)

6 References



Arrow right.png Next step