All Projects → devanlai → Dapboot

devanlai / Dapboot

Licence: other
DFU Bootloader for STM32 chips

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Dapboot

stm32-usb-bootloader
This repository contains bootloader for stm32f1xx microcontrollers. It works for stm32f103ret6, but you can simply adopt it to any MCU supporting STM32 HAL library with USB and SD-card
Stars: ✭ 40 (-79.38%)
Mutual labels:  stm32, bootloader
stm32bl
STM32 MCU serial firmware loader (jet another stm32loader fw bootloader tool)
Stars: ✭ 22 (-88.66%)
Mutual labels:  stm32, bootloader
DfuBootloader
STM32 USB device bootloader using DFU class interface
Stars: ✭ 79 (-59.28%)
Mutual labels:  stm32, bootloader
STM32F103 MSD BOOTLOADER
STM32F103 Mass Storage Device Bootloader
Stars: ✭ 23 (-88.14%)
Mutual labels:  stm32, bootloader
Stm32 Bootloader
Customizable Bootloader for STM32 microcontrollers. This example demonstrates how to perform in-application-programming of a firmware located on an external SD card with FAT32 file system.
Stars: ✭ 541 (+178.87%)
Mutual labels:  stm32, bootloader
Stm32 Bootloader
UART bootloader for STM32 microcontroller.
Stars: ✭ 97 (-50%)
Mutual labels:  stm32, bootloader
stm32-tkg-hid-bootloader
A HID driverless bootloader and flash tool companion for the STM32F1 line
Stars: ✭ 30 (-84.54%)
Mutual labels:  stm32, bootloader
Openblt
Official read-only mirror of the SVN OpenBLT bootloader repository. Updated daily.
Stars: ✭ 256 (+31.96%)
Mutual labels:  stm32, bootloader
Various mcu debugger diy
各种LInk大合集
Stars: ✭ 402 (+107.22%)
Mutual labels:  stm32, bootloader
Awesome Embedded
A curated list of awesome embedded programming.
Stars: ✭ 831 (+328.35%)
Mutual labels:  stm32, bootloader
Sboot stm32
Secure USB DFU1.1 bootloader for STM32
Stars: ✭ 181 (-6.7%)
Mutual labels:  stm32, bootloader
Mongoose Os
Mongoose OS - an IoT Firmware Development Framework. Supported microcontrollers: ESP32, ESP8266, CC3220, CC3200, STM32F4, STM32L4, STM32F7. Amazon AWS IoT, Microsoft Azure, Google IoT Core integrated. Code in C or JavaScript.
Stars: ✭ 2,234 (+1051.55%)
Mutual labels:  stm32
Bosh Bootloader
Command line utility for standing up a BOSH director on an IAAS of your choice.
Stars: ✭ 171 (-11.86%)
Mutual labels:  bootloader
Qstlink2
Cross-platform STLink v2 GUI
Stars: ✭ 167 (-13.92%)
Mutual labels:  stm32
Nf Interpreter
⚙️ nanoFramework Interpreter, CLR, HAL, PAL and reference target boards
Stars: ✭ 168 (-13.4%)
Mutual labels:  stm32
Emuflight
EmuFlight is flight controller software (firmware) used to fly multi-rotor craft.
Stars: ✭ 184 (-5.15%)
Mutual labels:  stm32
Grbl Advanced
Grbl-Advanced is a no-compromise, high performance, low cost alternative for CNC milling. This version of Grbl runs on a STM32F411RE / STM32F446RE Nucleo Board. Now with backlash compensation, multi-axis and Tool Table support!
Stars: ✭ 182 (-6.19%)
Mutual labels:  stm32
Openlidar
Open Hardware scanning triangulation laser rangefinder
Stars: ✭ 166 (-14.43%)
Mutual labels:  stm32
Modular Psu
EEZ Bench Box 3 (BB3) Modular T&M chassis
Stars: ✭ 159 (-18.04%)
Mutual labels:  stm32
Pwn Mbr
A simple MBR hijack demonstration
Stars: ✭ 153 (-21.13%)
Mutual labels:  bootloader

dapboot

The dapboot project is an open-source USB Device Firmware Upgrade (DFU) bootloader for STM32 devices.

Currently, the only targets officially supported are the STM32F103x series.

Build instructions

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 the TARGET variable when invoking make.

make clean
make TARGET=STLINK

Targets

Target Name Description Link
BLUEPILL Cheap dev board https://stm32duinoforum.com/forum/wiki_subdomain/index_title_Blue_Pill.html
MAPLEMINI LeafLabs Maple Mini board and clone derivatives https://stm32duinoforum.com/forum/wiki_subdomain/index_title_Maple_Mini.html
STLINK STLink/v2 hardware clones https://wiki.paparazziuav.org/wiki/STLink#Clones

For each of the above targets, there are three variants that can be added to the target name:

Target Variant Description
Standard bootloader, using first 8kB of flash
_HIGH High memory bootloader for 64kB chips (experimental)
_HIGH_128 High memory bootloader for 128kB chips (experimental)

The high memory bootloader is a variation that doesn't require the application to be at an offset, the bootloader resides in the top 6.5kB of ROM and hides its reset and stack vectors inside unused entries of the application vector table. As an example, to compile for a Bluepill board with 128kB flash, use:

make clean
make TARGET=BLUEPILL_HIGH_128

Flash instructions

The make flash target will use openocd to upload the bootloader to an attached board. By default, the Makefile assumes you're using a CMSIS-DAP based probe, but you can override this by overriding OOCD_INTERFACE variable. For example:

make OOCD_INTERFACE=interface/stlink-v2.cfg flash

Overriding defaults

Local makefile settings can be set by creating a local.mk, which is automatically included.

Here is an example local.mk that changes the default target to the STLink/v2 and uses an unmodified STLink/v2 to flash it.

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

You can also use the env variable DEFS to override default configuration for a target, like:

# Disable LED on BluePill
DEFS="-DHAVE_LED=0" make TARGET=BLUEPILL

# Allow access to all Flash on MapleMini and change the app base address
DEFS="-DFLASH_SIZE_OVERRIDE=0x20000 -DAPP_BASE_ADDRESS=0x08004000" make TARGET=MAPLEMINI LDSCRIPT="/some/folder/stm32f103x8-16kb-boot.ld"

Using the bootloader

Building for the bootloader

The standard 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.

The high memory bootloaders do not use the lower part of the flash, so you only need to make sure your application leaves 6.5kB of flash free.

Switching to the bootloader

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 bootloader currently looks for 0x544F in RTC backup register 1 and 0x4F42 in RTC backup register 0 (together they spell "BOOT" in ASCII).

You can also use a button to stay in bootloader while booting. It's configured using HAVE_BUTTON define. If your button has a debounce capacitor, you can use BUTTON_SAMPLE_DELAY_CYCLES define to specify how many cycles to wait before sampling the I/O pin, by default it is approximately 20ms in a 72Mhz MCU.

On the bluepill boards, the default is using the BOOT1 input (available on jumper in the board) to enter the bootloader.

WebUSB

This bootloader implements the draft WebUSB specification, which allows web pages to access the bootloader (after presenting the user with a device picker dialog).

For a demo implementing dfu-util features in the browser, see https://devanlai.github.io/webdfu/dfu-util/

USB VID/PID

The USB VID/PID pair (1209/DB42) is allocated through the pid.codes open-source USB PID program.

Licensing

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.

See the LICENSE file for full details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].