How to install the toolchain for develop on STM32

If you like it, share it

If it is the first time that you approach the STM32 (Cortex Mx) is necessary install on your PC some development tools.
Follow this tutorial and at the end of it, you will have a PC ready to use for develop on STM32.

  • Instal SW driver for ST-LINK-v2
    Download and install the driver: STSW-LINK009
    Choose the right version, 32 or 64 bit, for your PC.

    ST-LINK-v2 is a standard low cost emulator that is present on all STM32 Evaluation, NUCLEO and Discovery boards.There is also the ST-LINK-v2 standalone emulator that is visible below.
    ST-LINK-v2 standalone emulator support two STM MCU families that are:
    STM32 family and STM8 family.
    The cost is about 30 €.

  • Install the ST-LINK-UTILITY
    Download and install the: STSW-LINK004

    STM32 ST-LINK Utility is a full-featured software interface for programming STM32 microcontrollers.
    It provides an easy-to-use and efficient environment for reading, writing and verifying a memory device.
    The tool offers a wide range of features to program STM32 internal memories (Flash, RAM, OTP and others), external memories, to verify the programming content (checksum, verify during and after programming, compare with file) and to automate STM32 programming.
  • STM Virtual COM Port Driver
    The FW for Virtual COM Port Driver is here.
  • Install the serial line monitor TeraTerm.
    TeraTerm is here.
  • Install the CUBE-MX
    CubeMX is a graphical tool that allows configuring STM32 microcontrollers very easily and generating the corresponding initialization C code through a step-by-step process.
    Download and install the: STM32CubeMX

    CUBE-MX needs JAVA.
    CUBE-MX Repository is shown below.
    In the Repository there are the CUBE Libraries.

  • Install your prefered C Compiler
    At this point you must decide how C Compiler to use for develop a new project on STM32.
    Up to now there is a loot of C Compiler also free but the STM examples for STM32
    normally are ready to use with this C Compiler:
    AC6 – SW4STM32 – (is free and is STM controlled)
    KEIL is free for STM32L0xx and for the STM32F0xx.
    The standard KEIL is free up to 32K of exe.
    ATOLLIC (is free for STM32)  
    Here there is a list of the principal C Compilers.

    • My suggestion is: install KEIL and ATOLLIC
      • KEIL is free for STM32L0xx and F0xx and the standard compiler is free up to 32K of exe.
        KEIL is an ARM company and the examples present in the CUBE Library are ready to use  by click on the project name.
      • ATOLLIC now is an ST company

OK, if you are here, means that you are finished to prepare your PC for develop on STM32.

But what are the logic steps to follow for create a new STM32 project ?
It’s easy:
Use CubeMX for configure your STM32 and at the end you can generate a complete project ready to use for your prefered IDE.

To become famigliar with ATOLLIC + CUBE + Cube Library (HAL & LL) see this tutorial.

To become familiar with AC6 + CUBE + Cube Library (HAL & LL) see this tutorial that is for STM32L4 but the concepts are valid for all STM32.

Please, read also this tutorial:
Adjust the configuration of SW4STM32 (AC6) environment

To become familiar with KEIL + CUBE + Cube Library (HAL & LL) see this tutorial that is for STM32L4 but the concepts are valid for all STM32.

The project for AC6 and KEIL, ready to use are here (refer to Hands-On-n1)