Practical STM32 (1) - The Very Beginning

Posted on Wed, Oct 2, 2019 🌲 Flourishing Article Engineering Electronics Embedded STM32

I got a STM32F469I-DISCO development board to play with recently, here are some notes about how I began.

How to program the board ?

Most STM32 development boards have a built-in ST-LINK debugger, which can be connected to PC through USB to helps us program the main MCU (in my case, the STM32F469NI) and debug the code (setting breakpoints and reporting register and memory values). I said main MCU because the ST-LINK debugger itself actually has an independent MCU (normally STM32F0 series) with a special firmware.

For beginners, ST provides STM32CubeProg, which is a GUI program and supports Windows, Linux, and macOS. It can also program External Flash that some boards have, quite convenient. There is another tool from ST, the STM32 ST-LINK Utility, it has similar functionalities but I don't recommend using since it's older and Windows-only.

Testing out the board

ST provides a demo binary for STM32F469I-DISCO in the Resource > Binary resources section. Direct Link

Download, decompress, follow instructions in STemWin/readme.txt to flash the demo binary. Note that the instructions are a bit outdated. Whenever it mentions STM32 ST-LINK Utility, use STM32CubeProg instead.

Go deeper

The UM1932 User Manual introduces STM32F469I-DISCO's features, on-board external components, and provides electronic schematics. This is useful when I want to get information about which component connects to which GPIO ports and pins.

The RM0386 Reference manual contains register-level details of STM32F469xx / STM32F479xx MCU. By reading this, I can get concepts about how the MCU peripherals like SPI, I2C, SAI, USB, DMA work and how to setup the registers to use them. Although there're libraries that wrap the details, it is still necessary to have some low-level knowledge to use the libraries correctly. Also it's unavoidable to go into low-level when debugging peripherals.

Other Resource