# stm32-zboot **Repository Path**: puppy-rtos/stm32-zboot ## Basic Information - **Project Name**: stm32-zboot - **Description**: 一款用zig语言编写的STM32通用Boot - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 13 - **Forks**: 10 - **Created**: 2024-12-06 - **Last Updated**: 2025-11-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # stm32-zboot Universal stm32 boot written using zig,Compatible with [RT-Thread stm32-Bootloader](https://www.rt-thread.org/document/site/#/rt-thread-version/rt-thread-standard/application-note/system/rtboot/an0028-rtboot?id=%e7%ae%80%e4%bb%8b). ![Arch](docs/figures/arch.png) ## Roadmap ### M0: F4 series basic boot (rom < 8k) - [x] Serial port log output - [x] jump to app - [x] chip-flash manage - [x] flash partition abstraction layer(Compatible with FAL) - [x] The whole package upgrade ### M1: Normal boot (rom < 16k) - [x] Support L4 series - [x] Firmware crc check - [x] Firmware decompression(fastlz) - [x] Support spi nor flash - [x] Basic zboot Tool ### M2: More series boot (rom < 32k) - [x] Support H7 series (no xip) - [ ] Support H7 series (XIP Flash) - [ ] Support differential upgrade - [x] zboot Tool ## How to build ``` zig build ``` > Depends on zig-0.13.0 ## How to use zboot ### Generate stm32-zboot.bin 1. Run `zboot boot` to generate stm32-zboot.bin and config.json in the current directory. 2. Edit `config.json` to adapt to your hardware. 3. Run `zboot boot` again, and the stm32-zboot.bin will be generated by config.json. ### Make app project 1. Prepare a normal project for your hardware. 2. Adjust the starting address of your project's ROM or linker script 3. Adjust the interrupt vector address. 4. Compile and download the project. After reset, zboot will automatically load this application. ### Make upgrade file 1. Configure the project to generate bin file. 2. Run `zboot rbl xxx.bin Vx.x` to package the bin file as an upgrade file xxx.bin.rbl. ### Upgrade app 1. Transfer the xxx.bin.rbl file to swap partition in config.json (Support on-chip flash and SPIflash). 2. Reset the system, then zboot will automatically complete the application upgrade.