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.
- To flash the demo binary, connect the board to PC from the Mini-USB port (CN1), not the Micro-USB port (CN13).
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
- STM32CubeMX
- A GUI tool to configure peripherals and generate code template. I find it a good way to learn how to setup peripherals correctly by reading the generated code.
- It can be run on Windows, Linux, and macOS.
- STM32CubeIDE
- A full IDE integrating STM32CubeMX. I think the code editor is not as good as Atom or VSCode, but the debugger's Live Expression feature is great.
- This is a good start for beginners. I used it for a couple of days before I dived into the compilation process and migrated to Makefile + VSCode.
- It can be run on Windows, Linux, and macOS.
- STM32CubeF4 MCU Firmware Package The official library collection from ST. Used by STM32CubeMX. There're CMSIS, HAL drivers, BSP (Board Support Package) drivers, and Middlewares (like USB drivers).
- libopencm3 Open source ARM Cortex-M microcontroller library.
- TouchGFX A GUI framework for STM32.
- Mbed OS
- It seems to be designed for IOT applications. For me, I think it lacks of low-level control and has compatibility problems with libraries not designed for Mbed such as BSP or HAL.
- Mbed OS 2 is different from Mbed OS 5, they have different API and not compatible.
- Mbed OS 2 Handbook