[hemmerling] STMicroelectronics ARM-based MPUs

Company & Products & Community

Company & Products



      • 2016-01-25, 8:00 CET - 2016-01-29, 17:00 CET → I registered.
      • 2016-04-04, 8:00 CET - 2016-04-08, 17:00 CET → I registered.
      • 2016-06-13, 8:00 CET - 2016-06-17, 17:00 CET.
    • STM32F7 online course, with hands-on exercises.
      • 2016-02-08, 8:00 CET - 2016-02-12, 17:00 CET → I registered.
      • 2016-03-14, 8:00 CET - 2016-03-18, 17:00 CET.
      • 2016-05-23, 8:00 CET - 2016-05-27, 17:00 CET → I registered.


STLink ( ST-Link ) Link Utilities

USB drivers for Link Utilities

  • STMicroelectronics "STSW-LINK009" - “ST-LINK, ST-LINK/V2, ST-LINK/V2-1 USB driver signed for Windows7, Windows8, Windows10”. Current version of ST-Link USB drivers in 2016-10.

Software Design Support Concepts

System Workbench for STM32 ( SW4STM32 )


STM32Cube ( formerly: MicroXplorer )

The Tool

Eclipse Plugin

Necessary Add-Ons

  • To operate STM32Cube, you need both.
    1. Compiler / IDE support, so that the code generated by STM32Cube may be compiled ( “Project Settings / Toolchain/IDE” ).
      • Targets:
        1. EWARM - IAR 7.40 is shipped with STM32Cube support. No extras must be installed.
        2. MDK-ARM V5 - Keil MDK 5.40 needs a MDK5 Software Packs for each board, e.g. “KeilSTM32F4xx_DFP.?.?.?.pack”, “KeilSTM32L0xx_DFP.?.?.?.pack”.
        3. TrueSTUDIO.
        4. SW4SM32 - The generated code is for the free “System Workbench for STM32”.
          • For STM32Cube project, be shure to set the language standard to C99.
            • Project name - mouse rightclick, “Properties / C/C++ Build / Settings / MCU GCC Compiler / Dialect”.
            • Select “ISO C99 (-std=c99)” as “Language standard”.
        5. Em::Blocks, inoffically.
          • The generated code for TrueSTUDIO SW4SM32 and is for GNU C/C++ compiler. I was told by experts that the generated code may be compiled with the OpenSource IDE “Em::Blocks” → See ARM Embedded Systems ( ARM7, ARM8, ARM9, ARM11, Cortex ). How to proceed:
            1. Set the right target ( “Project / Settings / Project / Toolchain/IDE” ) - “TrueSTUDIO” or “SW4STM32”.
            2. Let STM32CubeMX generate the code ( “Project / Generate Code” ).
            3. Create an empty “Em::Blocks” project.
            4. Delete files and directories:
              1. Delete the directories of the “Em::Blocks” project.
                • cmsis.
                • incl.
                • SPL.
                • src.
              2. Delete the two GNU linker scripts ( “*.ld” ) of the root directory of the “Em::Blocks” project.
            5. Copy files and directories:
              1. Copy the directories of the code generated by STM32Cube to the “Em::Blocks” project directory:
                • Drivers.
                • Inc.
                • Src.
              2. Copy the GNU linker script, e.g. “TrueSTUDIO\gpio\STM32F429ZI_FLASH.ld” of the STM32CubeMX project to the root of the of the empty “Em::Blocks” project.
            6. Delete files and directories:
              1. Delete the directories of the the “Em::Blocks” project:
                • “Drivers / CMSIS / Device / STM32F4xx / Source / Templates / arm”.
                  • If you include these files by error in your project, you will get the error message “Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\arm\startup_stm32f427xx.s:1: Error: junk at end of line, first unrecognized character is `*'” :-(, as the GCC Assembler just support C/C++ style comments ( ”/ /” and ”/* .. */” ), but not the traditional Assembly comment style ”;”.
                • “Drivers / CMSIS / Device / STM32F4xx / Source / Templates / iar”.
            7. Load the “Em::Blocks” project.
              1. Right-mouseclick “Remove Files”, “Multiple Selection” → (ok).
              2. Right-mouseclick “Add files recursively”, “Multiple Selection” → (ok), “Select the targets this file should belong to” → (ok).
              3. At “Drivers / CMSIS / Device / STM32F4xx / Source / Templates / gnu”, exclude all files with the exception of the proper startup file ( e.g. “startup_st32f427xx.s” from the project, by marking the files, mouse-rightclick “Remove files from project”.
              4. Exclude the file “Drivers / STM32F4xx_HAL_Driver / Src / stm32f4xx_hal_msp_template.c” from the project - “This file contains the HAL System and Peripheral (PPP) MSP initialization and de-initialization functions. It should be copied to the application folder and renamed into 'stm32f4xx_hal_msp.c'”.
              5. At “Project / Build options / Compiler settings / #defines” add the symbol name for your MCU, e.g “STM32F429xx”, as suggested in the file “Drivers / CMSIS / Device / ST / STM32F4xx / Include / stm32f4xx.h”. If you fail, the compilation breaks by the error message '#error “Please select first the target STM32F4xx device used in your application (in stm32f4xx.h file)”'.
      • Tips & tricks:
        • There are two kind of “*.ioc” files:
          • The original “*.ioc” one is that which contains the ST32Cube project. In the root of each created code export directory, another “*.ioc” file is stored.
            • With the original “*.ioc” file, you may set a path to export code.
            • With the exported “*.ioc” files, this option is grayed.
          • Loading the exported “*.ioc” file and republishing code by “Project / Generate Code” is not suggested ( neither for another target compiler, nor for the same target compiler ). If you republish a second ”.iot” file for with SW4SM32, the code still compiles successfully, but the project configuration information is corrupt:
            • In the debug configuration settings, you can´t set the name of the project anymore - the “current” project is not offered as choice.
            • By this, the transfer to the target by the GDB debugger fails by an error message of the GDB debugger.
        • Minimum project configuration by STM32Cube:
          • “Sys / Debug” option with “Serial Wire Debug (SWD)” - If you forget, you won´t be able to debug the software.
          • “Project / Settings / Code Generator / HAL Settings” - ”[ ] Set all free pins analog (to optimize the power consumption)”.
        • There are 2 reporting options:
          1. “Project / Generate Report” generates a PDF.
          2. “Pinout / Generate CSV pinout text file”.
        • To use the “High Speed External” ( HSE ) clock, you just define a pin at “Reset & Clock Control” ( RCC ).
        • “GPIO Maximum Output Speed” ( STM term ) = “Slew Rate” ( usual engineering term ).
    2. Hardware support for a board, by STM32Cube.


  • The USP feature of STM32CubeMX is the interactive “Clocktree Overview” chart.
  • The Assembly code generated by STM32Cube requires the generated GNU linker script.
  • Be shure to understand the difference between ”.S” ( may contain preprocessor commands, e.g. C-style comments ) and ”.s” files with GCC.



  • The free tool STMicroelectronics "STM-Studio" for Windows - “Run-time variables monitoring and visualization tool” → Access to MPU registers, e.g for touch applications.

Tools for NFC

Libraries & Frameworks

The legacy Standard Periphal Library

Hardware Abstraction Layer ( HAL ) & Low Level Library

Hardware Abstraction Layer ( HAL )

  • HAL libraries makes use of:
    • Trap handlers.
    • Calbacks.
  • With the HAL library, the library takes care of necessary timing to access hardware and wait for response signals.

Low Level Library

  • With the LL library, the software developer is responsible for timing.
  • It is the successor of the SP library, for boards & MCUs with low resources ( RAM, Flash ROM,..).


emWin, STemWin



  • The DISCOVERY boards includes an ST-LINK/V2 embedded debug tool interface that is supported by the following software toolchains: IAR, KEIL, ATOLL ( so you don´t need to buy a ST-Link/V2 ).
  • DISCOVERY boards are a small application with as much sensors and actors as you can, while the NUCLEO board are in Arduino format, a base frame without (much) sensors and actors.

1. My STM32 Value Line Discovery Board -> STM32F100RB, based on Cortex M3

2a. My STM32L-Discovery Board -> STM32L1, based on Cortex M3

2b. My STM32 L1 Discovery Special Edition Board -> STM32L152RTC6, based on Cortex M3

3. My STM32 F3 Discovery Board -> STM32 F3, based on Cortex M4

4. My STM32 F4 Discovery Board -> STM32F4, based on Cortex M4

5. My STM32 F4 Discovery Board -> STM32F429, based on Cortex M4

6. STM32 M24LR Discovery Board -> STM32F103CB, based on Cortex M3

7. Nucleo Boards

The M24SR Ecosystem

7.1 My STM32L053R8 Nucleo -> STML053R8T6, based on Cortex M0+

  • “STML053R8T6” MCU with 64 KBytes of Flash, 8 Kbytes of SRAM.
  • Similar board: mbed "ST Nucleo L152RE".
  • Software for this board can be compiled by the free online development system mbed.
  • The board is in Ardunio format. Additionaly to the standard Ardunio interface, it has extra ST interfaces.

7.2 My STM32L476 Nucleo-64 -> STML476RG, based on Cortex M4

7.3 My STM32F207 Nucleo-144 -> STMF207ZGT6, based on Cortex M3

7.4 My P-NUCLEO-LRWAN1 Nucleo with LoRa RF Extension -> STM32L073RZT6, based on Cortex M0+



9. My STM32L053 Discovery -> STML053R8T6, based on Cortex M0+

10. My STM32F746G Discovery -> STM32F746NG, based on Cortex M7

11. My 32L476 Discovery -> STM32L467VGT6, based on Cortex M4

  • STM32Cube “STM32L4”, “STM32L4x6”, “LQFP100”, “STM32L476VGTx”.
  • By the windows executable application “qspieraser.bin”, you can delete the USB flash disk more quicky, than by accessing the Windows explorer.
  • Remember that the evaluation board is not intended to be an audio player, i.e. the Flash memory is not intended for frequent data changes, like by copying new audio files to the file system.

12. Motor Control Kits

13. Boards with STM32F4 MCUs for .NET Micro Framework and .NET Gadgeteer

Appropriate OpenDirectory Directory Pages

en/stm32.html.txt · Last modified: 2017/06/26 06:35 (external edit) · []
Recent changes RSS feed Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki