Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to revert config after calling config reset #40

Open
martell opened this issue Nov 13, 2023 · 0 comments
Open

Unable to revert config after calling config reset #40

martell opened this issue Nov 13, 2023 · 0 comments

Comments

@martell
Copy link
Contributor

martell commented Nov 13, 2023

I ran wchisp config reset on a We Act Studio 582
Which resulted in flashing/verification breaking

wchisp config reset
[INFO] Current config registers: ffffffffffffffff4d0fff4f
[INFO] Reset config registers:   ffffffffffffffffd50fff4f
wchisp flash target/riscv32imac-unknown-none-elf/release/examples/blinky
...
[INFO] Firmware size: 6144
[INFO] Erasing...
[WARN] erase_code: set min number of erased sectors to 8
[INFO] Erased 8 code flash sectors
[INFO] Erase done
[INFO] Writing to code flash...
[INFO] Code flash 6144 bytes written
[INFO] Verifying...
Error: Verify failed, mismatch

You can not set the config currently

wchisp config set ffffffffffffffff4d0fff4f
[INFO] setting cfg value ffffffffffffffff4d0fff4f
thread 'main' panicked at src/main.rs:277:21:
not implemented

Work around is to update the default in the CH58X yaml
(for anyone else who runs into this)

diff --git a/devices/0x16-CH58x.yaml b/devices/0x16-CH58x.yaml
index 5f0cc64..e3c78b6 100644
--- a/devices/0x16-CH58x.yaml
+++ b/devices/0x16-CH58x.yaml
@@ -36,7 +36,7 @@ config_registers:
     # Enable 2-wire debug
     # reset: 0xd73f0f4d
     # See-also: #26
-    reset: 0x4d0fff4f # official default
+    reset: 0xd50fff4f # official default
     type: u32
     fields:
       - bit_range: [2, 0]

After this we should see USER_CFG: 0x4FFF0FD5 when running flash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant