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.
- 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
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
- Build the bootloader simulator
make- Run the simulator
./bootloader_simThe simulator will:
- Erase the simulated flash
- Load
app.bininto flash memory - Verify CRC checksum
- “Jump” to the application
Use the provided Python tool tools/mkapp.py to generate a new firmware binary (app.bin) for testing.
python tools/mkapp.py- 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
MIT License © 2025 Amen Ellah Kerimi https://amenellah.kerimi.com