GitHunt
AM

Amen-ellah-kerimi/STM32-Bootloader

A simple, educational STM32L4 bootloader written in C, demonstrating firmware loading, CRC verification, and flash memory management. Includes a simulated flash interface, CRC32 checksum, and step-by-step logging. Ideal for learning bootloader fundamentals and preparing for embedded development projects.


STM32L4 Bootloader Simulation

C
STM32
Makefile
License: MIT

A simple educational STM32L4 bootloader written in C, demonstrating firmware loading, CRC verification, and flash memory management. Includes a simulated flash interface and detailed logging for each step.


Features

  • Simulated flash memory with read, write, and erase operations
  • CRC32 checksum verification of loaded firmware
  • Loads firmware from a binary file (app.bin)
  • Step-by-step logging of bootloader operations
  • Modular C code suitable for learning embedded bootloader concepts

Project Structure

stm32-bootloader/
├── inc/                # Header files
│   ├── bootloader.h
│   ├── crc32.h
│   └── flash.h
├── src/                # Source files
│   ├── main.c
│   ├── bootloader.c
│   ├── crc32.c
│   └── flash.c
├── tools/              # Helper scripts
│   └── mkapp.py        # Generates app.bin firmware
├── app.bin             # Example firmware
├── Makefile
└── README.md

Usage

  1. Build the bootloader simulator
make
  1. Run the simulator
./bootloader_sim

The simulator will:

  • Erase the simulated flash
  • Load app.bin into flash memory
  • Verify CRC checksum
  • “Jump” to the application

Adding Your Firmware

Use the provided Python tool tools/mkapp.py to generate a new firmware binary (app.bin) for testing.

python tools/mkapp.py

Project Status / Next Steps

  • Current: Fully functional simulated bootloader
  • Next: Integrate with actual STM32 hardware for real flash programming
  • Future: Add UART / USB DFU update support, multiple applications, advanced CRC algorithms

License

MIT License © 2025 Amen Ellah Kerimi
https://amenellah.kerimi.com

Languages

C89.7%Makefile5.2%Python5.1%

Contributors

Created October 15, 2025
Updated October 15, 2025
Amen-ellah-kerimi/STM32-Bootloader | GitHunt