- Notifications
You must be signed in to change notification settings - Fork69
UF2 bootloader for STM32F103 (Blue Pill etc)
License
mmoskal/uf2-stm32f103
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This project was initially forked offhttps://github.com/devanlai/dapboot though the DFU functionality has been removedand replaced with a USB Mass Storage withUF2 support
Boards with this bootloader can be programmed athttps://maker.makecode.comusing web interface using a graphical programming language or TypeScript (JavaScript with Types).
You will need a STLink/v2 (or other debugger) to flash it.
- https://github.com/mmoskal/uf2-stm32f103/releases
- download the latest ZIP file (
uf2-stm32f103-vX.Y.Z.zip
) - run:
openocd -f interface/stlink-v2.cfg -f target/stm32f1x.cfg -c "program uf2boot-BLUEPILL.bin verify reset exit 0x8000000"
- see if
BLUEPILL
drive appears; if not reset the board; the LED should be fading in and out about once per second
The default target is a generic STM32F103 dev board with an LED on PC13, commonly referred to as a "bluepill" board.
To build other targets, you can override theTARGET
variable when invokingmake
.
make cleanmake TARGET=STLINK
Target Name | Description | Link |
---|---|---|
BLUEPILL | Cheap dev board | http://wiki.stm32duino.com/index.php?title=Blue_Pill |
MAPLEMINI | LeafLabs Maple Mini board and clone derivatives | http://wiki.stm32duino.com/index.php?title=Maple_Mini |
STLINK | STLink/v2 hardware clones | https://wiki.paparazziuav.org/wiki/STLink#Clones |
PXT32 | MakeCode Arcade console (currently disabled on Arcade site) | https://arcade.makecode.com |
Themake flash
target will use openocd to upload the bootloader to an attached board.By default, the Makefile assumes you're using a STLink v2 based probe, but you can override this by overridingOOCD_INTERFACE
variable. For example:
make OOCD_INTERFACE=interface/cmsis-dap.cfg flash
Local makefile settings can be set by creating alocal.mk
, which is automatically included.
Here is an examplelocal.mk
that changes the default target to the STLink/v2 and uses an unmodified STLink/v2 to flash it.
TARGET ?= STLINKOOCD_INTERFACE ?= interface/stlink-v2.cfg
The bootloader occupies the lower 16KiB of flash, so your application must offset its flash contents by 16KiB. This can be done by modifying your linker script or flags as appropriate.
The bootloader can be built to look for arbitrary patterns, but the default for the STM32F103 target looks for a magic value stored in the RTC backup registers. Writing the magic value and then resetting will run the bootloader instead of the main application.
The WebUSB isn't currently supported.
All contents of the dapboot project are licensed under terms that are compatible with the terms of the GNU Lesser General Public License version 3.
Non-libopencm3 related portions of the dapboot project are licensed under the less restrictive ISC license, except where otherwise specified in the headers of specific files.
The UF2 parts are licensed under MIT.
See the LICENSE file for full details.
About
UF2 bootloader for STM32F103 (Blue Pill etc)