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

Any plans to add support for picorvd? #508

Open
Plaque-fcc opened this issue Feb 5, 2025 · 5 comments
Open

Any plans to add support for picorvd? #508

Plaque-fcc opened this issue Feb 5, 2025 · 5 comments

Comments

@Plaque-fcc
Copy link

I'm currently using picorvd as my main and only programmer hardware for programming some CH32V003 boards.
It is based on a Raspberry Pi Pico (RP2040) board and implements an SWD link. I can upload firmwares using GDB and this programmer, but it would probably be also nice to be able to config fuses, I guess.

What do you think?

@dwillmore
Copy link
Collaborator

I'm not sure what you mean by fuses. Unlike the AVR chips, all parts of flash can be programmed without special methods. The user code can program the 'option bytes' which govern a few chip level properties. Please see the example program: https://github.com/cnlohr/ch32v003fun/blob/master/examples/flashtest/flashtest.c

@Plaque-fcc
Copy link
Author

Oh, that helped. Yes, I was talking about the option bytes Thanks!

@Plaque-fcc
Copy link
Author

I happen to have an ESP32 S2 Mini board, it turns out. so I etched myself a shield to use it as a esp32s2-funprog tool.
Turns out, this won't help me:

$ ../../ch32fun/../minichlink/minichlink -D
Found ESP32S2-Style Programmer
Interface Setup
Error: DefaultConfigureNRSTAsGPIO does not work via the programmer here.  Please see the demo "optionbytes"

So I compiled the optionbytes example choosing uint16_t OB_RST = OB_RST_NoEN;, flashing it and letting the chip boot up and do the configuration.

So thank you @dwillmore for the advice, and thank you the one who added this hint into minichlink tool of this project (likely @cnlohr).

I wonder whether we could be able to configure it in less steps maybe. Just curious.

@monte-monte
Copy link
Contributor

You can set option bytes by writing the directly with minichlink:
minichlink -w +nUSER|USER 0x1FFFF802
USER is user byte which contains setting for PD7 Reset behavior (look in the reference manual)
nUSER - inverse USER byte.

@cnlohr
Copy link
Owner

cnlohr commented Feb 9, 2025

I would love to support picorvd, but, it's very squarely centered around just being a GDB backend. That said, it wouldn't be too hard to port the bitbang rvswdio library to support SWD and SWIO both, https://github.com/cnlohr/rv003usb/blob/master/testing/rvswdio_programmer/bitbang_rvswdio.h

But, I am just not into the rp2040 myself.

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

4 participants