Skip to content

Commit

Permalink
short intro
Browse files Browse the repository at this point in the history
  • Loading branch information
ArcaneNibble committed Apr 23, 2024
1 parent fd50671 commit dd03d6c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# WCH RISC-V UF2 Bootloader

This code implements a [uf2](https://github.com/microsoft/uf2) bootloader for RISC-V microcontrollers from [WCH](https://www.wch-ic.com). This allows user-friendly uploading of code by dragging files onto a virtual USB Mass Storage device (i.e. a pretend thumb drive). This means that, unlike the vendor ISP bootloader, no special software is required.

## Usage notes

- Triggered by a double reset within 0.5 seconds (like Adafruit bootloaders)
- Needs usage of `R16_BKP_DATAR10`
- Write 0x4170 ('Ap') to boot into the application immediately without delay
Expand All @@ -12,6 +16,7 @@
- Note that USBD requires a USB A-A cable if using the official devkit
- Runs off of internal 8 MHz oscillator (despite stability concerns)
- The HSI oscillator's tolerance (-1.0% to +1.6%) is well outside of the range specified for USB full speed ($\pm$ 0.25%), but it seems to work in practice n=1 ¯\\\_(ツ)\_
- The vendor's ISP ROM bootloader also does this
- Should work across most of the CH32V2xx and CH32V3xx family with appropriate changes to hardcoded constants.
- Allows both download to flash and to SRAM with the "not main flash" flag (this is how the RP2040 bootrom works)
- Flash download address must be 08xxxxxx (i.e. not starting at 0)
Expand Down

0 comments on commit dd03d6c

Please sign in to comment.