OpenBoot is an 8 KiB IAP bootloader for WCH RISC-V microcontrollers. It uses one protocol over USB HID or UART and includes a cross-platform Rust flashing tool.
| Chip | App region | RAM | Transports |
|---|---|---|---|
| CH570 / CH572 | [0x2000, 0x3C000) |
12 KiB | USB, UART |
| CH591 | [0x2000, 0x30000) |
26 KiB | USB, UART |
| CH592 | [0x2000, 0x70000) |
26 KiB | USB, UART |
The bootloader occupies [0x0000, 0x2000). The application region is split
into two equally sized A/B slots, and an application is linked for one slot
base. Each chip and transport combination produces a separate bootloader
image.
OpenBoot prevents protocol requests from modifying the bootloader, requires a block to be erased before it can be written, and makes an image bootable only after COMMIT verifies its CRC. Updates are written into the slot the device is not running, so power loss part-way through leaves the previous application intact and the device comes back up on it unaided. The device reports its flash geometry, slot layout and identity through HELLO, so the host tool needs no per-chip database.
| Path | Contents |
|---|---|
Makefile |
Repository-wide build, test, check, and clean targets |
protocol/ |
Shared protocol constants and golden frames |
firmware/ |
Bootloader, ports, transports, boards, and tests |
tools/ |
openboot host CLI |
docs/ |
Protocol, architecture, A/B update design |
third_party/openwch/ |
Pinned WCH SDK submodules |
Requirements: GNU Make 4.3 or newer, the MounRiver "RISC-V Embedded GCC 12" toolchain, Python 3, and Rust.
git submodule update --init
export MRS_TOOLCHAIN=/path/to/toolchain/bin
make # all firmware images and the release host tool
make test
make check # tests plus firmware size and board-policy checksUse make firmware or make tool to build only one component. The firmware
and tool directories retain their own Make and Cargo entry points for targeted
development.
See the firmware guide for toolchain setup, flashing, CH57x USB recovery, and hardware bring-up. See the application guide for linker and integration requirements, and the CLI guide for host usage.
OpenBoot is licensed under Apache-2.0.