Skip to content

Commit

Permalink
docs: refine README
Browse files Browse the repository at this point in the history
  • Loading branch information
andelf committed Nov 5, 2023
1 parent 96e22ef commit b54314c
Showing 1 changed file with 31 additions and 5 deletions.
36 changes: 31 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,20 @@
[docsrs]: https://docs.rs/wlink
[nightly]: https://github.com/ch32-rs/wlink/releases/tag/nightly

**NOTE**: This tool is still in development and not ready for production use.
> **Note**
> This tool is still in development and not ready for production use.
## Feature Support

- [x] Flash firmware, support Intel HEX, ELF and raw binary format
- [x] Erase chip
- [x] Halt, resume, reset support
- [x] Read chip info
- [x] Read chip memory
- [x] Read chip register
- [x] Write chip register
- [x] Read chip memory(flash)
- [x] Read/write chip register - very handy for debugging
- [x] Code-Protect & Code-Unprotect for supported chips
- [x] [SDI print](https://www.cnblogs.com/liaigu/p/17628184.html) support
- [x] [SDI print](https://www.cnblogs.com/liaigu/p/17628184.html) support, requires 2.10+ firmware
- [x] Serial port watching(#36) for a smooth development experience

## Tested On

Expand Down Expand Up @@ -77,8 +79,15 @@ Current firmware version: 2.11 (aka. v31).

`cargo install --git https://github.com/ch32-rs/wlink` or download a binary from the [Nightly Release page](https://github.com/ch32-rs/wlink/releases/tag/nightly).

> **Note**
> On Linux, you should install libudev and libusb development lib first.
> Like `sudo apt install libudev-dev libusb-1.0-0-dev` on Ubuntu.
## Usage

> **Note**
> For help of wire connection for specific chips, please refer to `docs` subdirectory.
```console
> # Flash firmware.bin to Code FLASH at address 0x08000000
> wlink flash --address 0x08000000 ./firmware.bin
Expand All @@ -89,6 +98,21 @@ Current firmware version: 2.11 (aka. v31).
12:10:28 [INFO] Now reset...
12:10:28 [INFO] Resume executing...

> # Flash firmware.bin to System FLASH, enable SDI print, then watch serial port
> wlink flash --enable-sdi-print --watch-serial firmware.bin
02:54:34 [INFO] WCH-Link v2.11 (WCH-LinkE-CH32V305)
02:54:34 [INFO] Attached chip: CH32V003 [CH32V003F4P6] (ChipID: 0x00300500)
02:54:34 [INFO] Flash already unprotected
02:54:34 [INFO] Flash protected: false
02:54:35 [INFO] Flash done
02:54:35 [INFO] Now reset...
02:54:35 [INFO] Now connect to the WCH-Link serial port to read SDI print
Hello world from ch32v003 SDI print!
led toggle
led toggle
...


> # Dump Code FLASH, for verification
> # use `-v` or `-vv` for more logs
> wlink -v dump 0x08000000 100
Expand All @@ -109,10 +133,12 @@ Current firmware version: 2.11 (aka. v31).
08000050: f3 23 40 f1 b7 02 00 00 93 82 02 00 63 f4 72 00 ×#@×ו00×ו0c×r0
08000060: 6f 00 c0 29 o0×)


> # Dump System FLASH, BOOT_28KB
> wlink dump 0x1FFF8000 0x7000
....


> # Dump all general purpose registers
> wlink regs
16:24:20 [INFO] Dump GPRs
Expand Down

0 comments on commit b54314c

Please sign in to comment.