Author Topic: Risk-V CH32v003 Must redo configuration before every upload.  (Read 1127 times)

0 Members and 1 Guest are viewing this topic.

Offline MilesThatchTopic starter

  • Newbie
  • Posts: 3
  • Country: ca
Risk-V CH32v003 Must redo configuration before every upload.
« on: December 20, 2023, 05:45:59 pm »
Good day folks.

I'm programming the CH32v003 chip using MounRiverStudio. Instead of going with a dev or evaluation board, it's just the standalone chip, soldered onto an SMD to DIP pcb for easy breadboard testing. I got the WCH link programmer, connected it to the chip by pins GND, VCC and SWIO (pin8) and it flashes the chip successfully. I've got a decoupling capacitor between GND and VCC as well.

The issue is that after each flash, I need to go to the configuration panel and keep re-setting some uploading options every time before I can flash the code again. Otherwise it fails.

I have a video demonstrating the problem:https://www.reddit.com/r/RISCV/comments/18mh8d6/stuck_having_to_set_configuration_before_every/

First time I upload, I see this:
1958352-0

After that, every time I try to upload, it fails and reports:
1958358-1

This is the config window in MounRiver Studio I have to keep resetting:
1958370-2
1958364-3

I'm not sure why this is happening. I have tried swapping out the chip for another, thinking maybe it's defective but the replacement behaves the same. Perhaps there's some kind of a toggle in the configuration of the upload routine that causes it to reset every time? Perhaps something I've missed in the initial project setup?
« Last Edit: December 20, 2023, 05:53:41 pm by MilesThatch »
 

Offline MilesThatchTopic starter

  • Newbie
  • Posts: 3
  • Country: ca
Re: Risk-V CH32v003 Must redo configuration before every upload.
« Reply #1 on: December 21, 2023, 11:58:35 pm »
I got it!

I had configured my serial TX port to pin 8, which is the SWIO pin for programming the ch32 chip. I've reconfigured it to use 5 so now I can program it repeatedly.
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 4441
  • Country: nz
Re: Risk-V CH32v003 Must redo configuration before every upload.
« Reply #2 on: December 22, 2023, 12:22:06 am »
Yeah, it pretty much had to be something that you'd done, because it works usually.
 

Offline MilesThatchTopic starter

  • Newbie
  • Posts: 3
  • Country: ca
Re: Risk-V CH32v003 Must redo configuration before every upload.
« Reply #3 on: December 22, 2023, 12:24:19 am »
I do wonder, what if I only have pin 8 left, where it's a hardware design that requires the use of the programming pin for the purpose of device functionality.  Is there a way to retain repeatable flashing without moving pins?
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 4441
  • Country: nz
Re: Risk-V CH32v003 Must redo configuration before every upload.
« Reply #4 on: December 22, 2023, 01:21:31 am »
That's one reason people do development on the larger pin count packages, even if the final product will use e.g. the 8 pin package.

I guess every chip family has a similar problem. For example I've used ATTiny85 a bit. Another 8 pin package. Programming uses three of the IO pins for standard SPI, and for this to function the RESET pin needs to be held low for the duration of programming.  If you need to use all 6 non-power supply pins for IO then you no longer have a RESET pin and can't program the chip again. The AVR provides a way around this "High Voltage Programming", which applies +12V to the RESET pin.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf