How to Flash STM32F103-Based Flight Controllers with ST-Link

Added:

Obsolescence of F1 Hardware and the Standard of USB DFU Flashing

While learning to use an ST-Link debugger on an STM32F103 flight controller teaches fundamental embedded systems concepts, this approach is largely obsolete in modern drone building. First, the STM32F103 (F1) processor is deprecated; major flight firmware projects like Betaflight and INAV have dropped support for F1 chips in favor of F4, F7, and H7 processors due to flash memory and processing limitations. Second, using an ST-Link requires direct connection to SWD pins, which often demands delicate soldering and risks shorting the board. In contrast, modern flight controllers utilize built-in USB DFU (Device Firmware Upgrade) bootloaders. This allows users to flash firmware directly over a standard USB cable using software configurators, rendering external hardware programmers like the ST-Link unnecessary for standard firmware updates. Instructing students on ST-Link flashing for F1 boards may focus their skills on outdated hardware and overly complex workflows instead of current industry-standard practices.

Basic understanding of microcontroller architecture, specifically the ARM Cortex-M3 processor used in the STM32F103 series.
Familiarity with Serial Wire Debug (SWD) and JTAG communication protocols used for programming and debugging hardware.
Understanding the role of flight controller firmware (such as Betaflight or Cleanflight) and how it interfaces with sensors and actuators.
Basic electrical safety and connection practices, including pinout identification (VCC, GND, SWDIO, SWCLK) on embedded boards.
Setting up a full development environment (like STM32CubeIDE) to write, compile, and debug custom C/C++ firmware.
Using GDB (GNU Debugger) with the ST-Link for real-time hardware-in-the-loop debugging, setting breakpoints, and inspecting memory registers.
Understanding bootloader mechanics, including how to recover or 'unbrick' a device using STM32 system boot modes (BOOT0/BOOT1 pins).
Transitioning to more advanced ARM Cortex-M4 or M7 microcontrollers (such as STM32F4 or STM32F7) commonly used in modern flight controllers.
307 views4likes8:03@kiradite4321Original Release: 2020-04-21

This video demonstrates the complete process of setting up and programming an STM32F103 microcontroller for a fly controller application, including hardware connections with jumpers, establishing debugger connections, configuring communication protocols, and verifying successful device communication through practical demonstration.