Maybe I'll give this one more try.
Let me back up a couple steps here:
What exactly do I need in terms of software here?
I assume I need:
- An assembler + linker for the micro
xPack GNU RISC-V Embedded GCC
- A program to upload my assembled + linked code to the micro
minichlink (openOCD is also possible, but it's generic and needs a lot of config while minichlink is specialised)
- A program to execute my code on the micro (or is that part of the loader above?)
Your code runs on reset. Or, actually, I think on first upload minichlink just jumps to it, which allows you to link your code to run from RAM instead of flash if you want, which is faster, but then it's lost on a reset.
Once we establish exactly what I need, then let me ask where to obtain those parts/pieces.
Already provided to you.
ch32fun provides definitions for the hardware in the various WCH chips, and provides scripts to manage calling the compiler/assembler with the right flags, the right linker flags, call minichlink to upload to the micro etc.
You don't need it, you can figure out everything by yourself, but it will save tens of hours grovelling through a lot of manuals and a lot of hair-pulling.