stm32-hid-bootloader logo

stm32-hid-bootloader

Free

Driverless USB HID bootloader and flashing tool for STM32F10X devices

FreeFree tier
Type
Open Source

About stm32-hid-bootloader

The stm32-hid-bootloader is a driverless USB HID bootloader for STM32F10X microcontrollers. It eliminates the need for USB drivers even on Windows by using HID protocol. The bootloader avoids using ST's libraries, opting instead for CMSIS and minimal system files, resulting in a very small footprint under 4KB. It provides a command-line tool 'hid-flash' to flash .bin firmware files. Activation occurs when the BOOT1 (B2) pin is driven high; otherwise, it jumps to the user application. The repository includes a sample blinker application and instructions for adjusting the linker script for user flash at 0x8001000. Licensed under GPL-3.0.

Key Features

Driverless USB HID protocol (no USB drivers required on any OS)
Very small bootloader size (<4KB)
Uses only CMSIS; avoids bloated ST libraries
Command-line flashing tool (hid-flash) for .bin files
Activates when BOOT1 (B2) pin is driven HIGH
Jumps to user program if BOOT1 is LOW
Sample blinker application for Blue Pill board included
Supports custom linker script for user flash offset (0x8001000)

Pros & Cons

Pros
  • No USB drivers required on any OS
  • Very small bootloader size (<4KB)
  • Minimal dependencies (only CMSIS)
  • Open source with GPL-3.0 license
  • Includes a CLI flashing tool and sample application
Cons
  • Only supports STM32F10X microcontroller family
  • Requires hardware pin manipulation (BOOT1) to activate
  • Users must modify linker script for user application flash offset
  • No graphical user interface for flashing

Best For

Flashing firmware on STM32F10X microcontrollersCreating a custom bootloader for embedded projectsUpgrading firmware on Blue Pill development boards

FAQ

How does the bootloader activate?
The bootloader enters USB HID mode if the B2 (BOOT1) pin is driven HIGH when the bootloader starts. Otherwise, it jumps to the user program.
What file format does it flash?
It flashes .bin firmware files using the provided hid-flash CLI tool.
Which boards are supported?
It supports STM32F10X devices, with explicit mention of the Blue Pill board.
How large is the bootloader?
The bootloader is less than 4KB in size.
Is it compatible with Windows?
Yes, it is driverless even on Windows, as it uses USB HID protocol.