From bda3070cb981a888e2f1456ee3b6458f477a2487 Mon Sep 17 00:00:00 2001 From: Jules Maselbas Date: Sat, 6 Jan 2024 19:08:52 +0100 Subject: [PATCH] Update manpage and README --- README.md | 13 +++++++------ wch-isp.1 | 2 +- wch-isp.c | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index efdf575..e915a93 100644 --- a/README.md +++ b/README.md @@ -8,10 +8,10 @@ This utility started as a rewrite in C of the rust tool [wchisp](https://github. usage: wch-isp [-VDnpr] [-d ] COMMAND [ARG ...] wch-isp [-VDnpr] [-d ] [flash|write|verify|reset] FILE wch-isp [-VDnpr] [-d ] [erase|config|remove-wp] - wch-isp [-VDnpr] list + wch-isp [-VDnpr] [list] options: - -d Select the usb device that matches the uid + -d Select the usb device that matches by uid first, else by index -n No verify after writing to flash, done by default -p Print a progress-bar during command operation -r Reset after command completed @@ -30,14 +30,15 @@ This utility has been tested on: List detected device in bootloader mode: ```sh $ wch-isp list -0: BTVER v2.7 UID 8d-ff-ba-e4-c2-84-09-69 [0x1069] CH569 -1: BTVER v2.5 UID f2-3e-88-26-3b-38-b5-9d [0x1980] CH32V208WBU6 +0: BTVER v2.7 UID 8d-ff-ba-e4-c2-84-09-69 [0x1069] CH569 (flash 448K) +1: BTVER v2.5 UID f2-3e-88-26-3b-38-b5-9d [0x1980] CH32V208WB (flash 128K) +2: BTVER v2.6 UID cd-ab-72-86-45-bc-84-ee [0x1931] CH32V203C8 (flash 64K) ``` Flash the `firmware.bin` file, `-p` enable the progress bar. ``` $ wch-isp -p flash firmware.bin -BTVER v2.5 UID f2-3e-88-26-3b-38-b5-9d [0x1980] CH32V208WBU6 +BTVER v2.5 UID f2-3e-88-26-3b-38-b5-9d [0x1980] CH32V208WB (flash 128K) [####################################################] write 35392/35392 [####################################################] verify 35392/35392 flash done @@ -46,7 +47,7 @@ flash done Erase the device's flash, select the device by it's uid (option `-d`). ``` $ wch-isp -d f2-3e-88-26-3b-38-b5-9d erase -BTVER v2.5 UID f2-3e-88-26-3b-38-b5-9d [0x1980] CH32V208WBU6 +BTVER v2.5 UID f2-3e-88-26-3b-38-b5-9d [0x1980] CH32V208WB (flash 128K) erase done ``` diff --git a/wch-isp.1 b/wch-isp.1 index a1cd300..0de8928 100644 --- a/wch-isp.1 +++ b/wch-isp.1 @@ -32,7 +32,7 @@ By default the flash content is verified after writing. .SH OPTIONS .TP .B \-d -Select the USB device that matches the uid. +Select the USB device that matches the uid. If nothing matches then uid is used as an index to select a device from the list. .TP .B \-n Do not verify flash content after writing, verification is done by default. diff --git a/wch-isp.c b/wch-isp.c index be34ec2..d8a4a07 100644 --- a/wch-isp.c +++ b/wch-isp.c @@ -906,7 +906,7 @@ usage(int help) exit(1); printf("options:\n"); - printf(" -d Select the usb device that matches the uid\n"); + printf(" -d Select the usb device that matches by uid first, else by index\n"); printf(" -n No verify after writing to flash, done by default\n"); printf(" -p Print a progress-bar during command operation\n"); printf(" -r Reset after command completed\n");