Skip to content

Commit 419ddcd

Browse files
committed
Update readme
1 parent dad5743 commit 419ddcd

File tree

1 file changed

+11
-28
lines changed

1 file changed

+11
-28
lines changed

README.md

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,7 @@
1-
# MSC bootloader for STM32F103
1+
# MSC bootloader for STM32F072 and STM32F103
22

33
This project was initially forked off https://github.com/mmoskal/uf2-stm32f103 though the UF2 functionality has been removed
44
and replaced with the ability to load .bin firmware files.
5-
The size of the bootloader has been reduced to 8KiB.
6-
7-
## Flashing bootloader from binaries
8-
9-
You will need a STLink/v2 (or other debugger) to flash it.
10-
11-
* https://github.com/mmoskal/uf2-stm32f103/releases
12-
* download the latest ZIP file (`uf2-stm32f103-vX.Y.Z.zip`)
13-
* run: `openocd -f interface/stlink-v2.cfg -f target/stm32f1x.cfg -c "program uf2boot-BLUEPILL.bin verify reset exit 0x8000000"`
14-
* see if a USB drive appears; if not reset the board twice; the LED should be fading in and out about once per second
155

166
## Build instructions
177
The default target is a generic STM32F103 dev board with an LED on PC13, commonly referred to as a "bluepill" board.
@@ -20,43 +10,36 @@ To build other targets, you can override the
2010
`TARGET` variable when invoking `make`.
2111

2212
make clean
23-
make TARGET=STLINK
13+
make TARGET=MAPLEMINI
2414

2515
### Targets
2616

27-
| Target Name | Description | Link |
28-
| ----------- | ----------- |----- |
29-
|`BLUEPILL` | Cheap dev board | http://wiki.stm32duino.com/index.php?title=Blue_Pill |
30-
|`MAPLEMINI` | LeafLabs Maple Mini board and clone derivatives | http://wiki.stm32duino.com/index.php?title=Maple_Mini |
31-
17+
| Target Name | Description | Bootloader offset | Link |
18+
| ----------- | ----------- |------------------ | ---- |
19+
|`STM32F103` | Generic STM32F103 target without LED | 8KiB | |
20+
|`STM32F072` | Generic STM32F072 target without LED | 16KiB | |
21+
|`BLUEPILL` | Cheap dev board | 8KiB | http://wiki.stm32duino.com/index.php?title=Blue_Pill |
22+
|`MAPLEMINI` | LeafLabs Maple Mini board and clone derivatives | 8KiB | http://wiki.stm32duino.com/index.php?title=Maple_Mini |
3223

33-
## Flash instructions
34-
35-
The `make flash` target will use openocd to upload the bootloader to an attached board.
36-
By default, the Makefile assumes you're using a STLink v2 based probe, but you can override this by overriding `OOCD_INTERFACE` variable. For example:
37-
38-
make OOCD_INTERFACE=interface/cmsis-dap.cfg flash
3924

4025
## Overriding defaults
4126
Local makefile settings can be set by creating a `local.mk`, which is automatically included.
4227

43-
Here is an example `local.mk` that changes the default target to the STLink/v2 and uses an unmodified STLink/v2 to flash it.
28+
Here is an example `local.mk` that changes the default target to the MAPLEMINI.
4429

4530
TARGET ?= STLINK
46-
OOCD_INTERFACE ?= interface/stlink-v2.cfg
4731

4832
## Using the bootloader
4933
### Building for the bootloader
50-
The bootloader occupies the lower 8KiB of flash, so your application must offset its flash contents by 8KiB. This can be done by modifying your linker script or flags as appropriate.
34+
The bootloader occupies the lower 8KiB or 16KiB of flash, so your application must offset its flash contents by 8KiB or 16KiB. This can be done by modifying your linker script or flags as appropriate.
5135

5236
### Switching to the bootloader
5337
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.
38+
When compiling with the DOUBLE_TAP option, the bootloader can be activated by double-tapping the reset button.
5439

5540
## Licensing
5641
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.
5742

5843
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.
5944

60-
The UF2 parts are licensed under MIT.
61-
6245
See the LICENSE file for full details.

0 commit comments

Comments
 (0)