All Projects → ferenc-nemeth → Stm32 Bootloader

ferenc-nemeth / Stm32 Bootloader

Licence: mit
UART bootloader for STM32 microcontroller.

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to 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 (+457.73%)
Mutual labels:  firmware, stm32, bootloader
IOsonata
IOsonata multi-platform multi-architecture power & performance optimized software library for fast and easy IoT MCU firmware development. Object Oriented design, no board package to define, just pure plug & play any boards
Stars: ✭ 40 (-58.76%)
Mutual labels:  firmware, stm32
flipperzero-firmware
Flipper Zero firmware source code
Stars: ✭ 2,551 (+2529.9%)
Mutual labels:  firmware, stm32
OtterPill
stm32f072 dev board with arduino nano alike pinout
Stars: ✭ 127 (+30.93%)
Mutual labels:  firmware, stm32
stm32bl
STM32 MCU serial firmware loader (jet another stm32loader fw bootloader tool)
Stars: ✭ 22 (-77.32%)
Mutual labels:  stm32, bootloader
kikpad
KiKPad : the Midiplus SmartPad reinvented !
Stars: ✭ 31 (-68.04%)
Mutual labels:  firmware, stm32
OpenWare
Firmware for OWL devices
Stars: ✭ 23 (-76.29%)
Mutual labels:  firmware, stm32
MK404
A functional Simulator for Prusa (Mini/Einsy) Rambo based printers
Stars: ✭ 52 (-46.39%)
Mutual labels:  firmware, bootloader
Openblt
Official read-only mirror of the SVN OpenBLT bootloader repository. Updated daily.
Stars: ✭ 256 (+163.92%)
Mutual labels:  stm32, bootloader
Various mcu debugger diy
各种LInk大合集
Stars: ✭ 402 (+314.43%)
Mutual labels:  stm32, bootloader
stm32-tkg-hid-bootloader
A HID driverless bootloader and flash tool companion for the STM32F1 line
Stars: ✭ 30 (-69.07%)
Mutual labels:  stm32, bootloader
Awesome Embedded
A curated list of awesome embedded programming.
Stars: ✭ 831 (+756.7%)
Mutual labels:  stm32, bootloader
micronucleus-firmware
Fork for the firmware / digispark part of the micronucleus repository
Stars: ✭ 50 (-48.45%)
Mutual labels:  firmware, bootloader
sympetrum-v2
A communicative piece of wearable electronics.
Stars: ✭ 22 (-77.32%)
Mutual labels:  firmware, stm32
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 (-58.76%)
Mutual labels:  stm32, bootloader
STM32F103 MSD BOOTLOADER
STM32F103 Mass Storage Device Bootloader
Stars: ✭ 23 (-76.29%)
Mutual labels:  stm32, bootloader
FASTUSBasp
This is the fast avr programmer for AVR MCUs based on cheap stm32f103c8t6 board with usb-to-serial support.
Stars: ✭ 78 (-19.59%)
Mutual labels:  firmware, stm32
remote-pinetime-bot
Telegram Bot to flash and test PineTime firmware remotely
Stars: ✭ 23 (-76.29%)
Mutual labels:  firmware, bootloader
systemboot
SystemBoot is a LinuxBoot distribution that works as a system firmware + bootloader, based on u-root
Stars: ✭ 103 (+6.19%)
Mutual labels:  firmware, bootloader
Nanovna
Very Tiny Palmtop Vector Network Analyzer
Stars: ✭ 539 (+455.67%)
Mutual labels:  firmware, stm32

stm32-bootloader

UART bootloader for STM32 microcontroller.

Table of contents

Introduction

A bootloader for STM32F100 (STM32VLDISCOVERY board) [1] with UART and Xmodem protocol [2][3]. The software is created with Atollic trueSTUDIO and the drivers are generated with CubeMX.

Main features:

  • UART & Xmodem protocol
  • CRC16 checksum
  • Supports 128 and 1024 bytes data length

How it works

Overall

The bootloader was developed for STM32VLDISCOVERY board, the only extra thing needed is an USB-UART module on PA10 (RX) and PA9 (TX) pins.


Figure 1. Pinout of the system.

After start-up, the system sends a welcome message through UART and checks if the user button is pressed. If it is pressed, then it stays in booatloader mode, turns on the green (PC9) LED and waits for a new binary file. If the button isn't pressed, then it jumps to the user application.


Figure 2. Brief overview of the workflow of the system.

The Xmodem protocol is clearly explained in the references.

Memory map

The bootloader starts from 0x08000000 and the user application starts from 0x08008000.


Figure 3. The organization of the memory.

Code

Every important code is inside the Src and Inc folders. main.c holds the button check, xmodem.c and .h hold the communication portocol, uart.c and .h are a layer between Xmodem and the generated HAL code, flash.c and .h have the writing/erasing/jumping related functions. Everything else is provided by ST. The code is fully commented, so it should be easy to understand.

How to use it

Embedded

To use the bootloader, just get the softwares mentioned in the Introduction and flash it.

I included an example binary file called "blinky_test.bin" in the root folder. It blinks the blue (PC8) LED on the board. To make your own binary, you have to modify the memory location in the linker script (STM32F100RB_FLASH.ld):

FLASH (rx)      : ORIGIN = 0x8008000,

And the vector table offset in system_stm32f1xx.c

#define VECT_TAB_OFFSET  0x00008000U

Last step is you have to generate a *.bin file:

arm-atollic-eabi-objcopy -O binary "input.elf" "output.bin"

PC

To update the firmware, you need a terminal software, that supports Xmodem. I recommend PuTTY [4] or Tera Term [5].

Configure them in the following way:

  • Baud rate: 115200
  • Data bits: 8
  • Parity: none
  • Stop bits: 1

In PuTTY: select Files Transfer >> Xmodem (or Xmodem 1K) >> Send and then open the binary file.


Figure 4. PuTTY.

In Tera Term: select File >> Transfer >> Xmodem >> Send and then open the binary file.
Figure 5. Tera Term.

In case everything was fine, then the output should be the same:

================================
UART Bootloader
https://github.com/ferenc-nemeth
================================

Please send a new binary file with Xmodem protocol to update the firmware.
CCCCCCC
Firmware updated!
Jumping to user application...

Porting

I included the *.ioc file, so the drivers can be regenerated for any ST microntroller (if it has similar memory structure). If you have a non-ST microntroller, then the xmodem protocol can be reused, but nothing else.

References

[1] ST - Discovery kit with STM32F100RB MCU
[2] Xmodem protocol with CRC
[3] Chuck Forsberg - XMODEM/YMODEM PROTOCOL REFERENCE
[4] PuTTY
[5] Tera Term

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].