Table of Contents

Introduction


STM32CubeIDE is an advanced C/C++ development platform with peripheral configuration, code generation, code compilation, and debug features for STM32 microcontrollers and microprocessors.

It is used to program microcontrollers such as the Nucleo board used in several ECSE classes.

Installation


  1. Install STM32 Cube IDE.
    1. You will need to make a free account to access the software.
    2. During set-up, the default options are generally good unless you are doing something super specific.
  2. Upon installation, find the STM32CubeIDE directory. It should be at C:\\Users\\yourusername\\STM32CubeIDE if the default installation options are followed
    1. Depending on the installed version, a folder titled workspace_x.xx.x should be found. This is where all your projects will be saved.

<aside> 💡

Tip: Create different workspaces for different projects to stay organized!

You can switch between workspaces by going to File → Switch Workspace → Other and navigating to your desired workspace. To stay extra organized, consider keeping all your workspaces in the directory /STM32CubeIDE.

</aside>

Starting a New Project


Beginning New Firmware for your Board.

  1. Click on ‘Start a New STM32 project’ box in the information center.

    starting new project.png

  2. Select the STM32 chip or board that you are using. You can search for your part using the commercial part number (CPN) (located on the back of the board or on the part’s original box if you still have it).

    1. If you are using a board, you will need to navigate from the MCU/MPU Selector to the Board Selector.

      board selection.png

  3. Name your project.

    1. Default options are okay.
    2. Click yes to the dialogue box ‘Initialize all peripherals in their default mode’.
  4. Your project generates with these files.

    files generated upon creation.png

<aside> 🚨

CAUTION: If you only see a .ioc file, you are most likely missing important firmware and will not be able to generate code. To install the firmware:

  1. Navigate to Help → Configuration Tool → Manage Embedded Software Packages

    getting code to generate 1.png

  2. Find your board or chip.

    1. Look at the start of your CPN, STM32XX will match one of the firmware packages to install. Click on STM32XX → latest version (top option) → Install

    getting code to generate 2.png

</aside>

  1. The .ioc file allows you to change the function of each pin on your chip using the Pinout & Configuration → Pinout View (screen you are auto loaded into). The chip will look different depending on the one you are using but generally:
    1. green pins - GPIO pins that are currently configured
    2. white pins - reserved pins that cannot be reassigned (ground, power, etc.)
    3. grey pins - unconfigured pins that can be configured to a peripheral or as GPIO
    4. yellow pins - pins that are currently configured for a certain peripheral