Closed prosper00 closed 1 year ago
I've had the pull-up resistor in a couple different positions and it hasn't mattered much, but the wire from the Pico to the CH32 is only ~15 cm. It definitely has to be 1kohm, 10k would not pull the bus up nearly fast enough to support normal-speed mode.
Someone else mentioned the blink.h thing, I need to fix that today :/
(the official wch-link dongle also uses 1k)
Yeah, you can disregard what I said regarding the pull up resistor. There's something else going on here that I need to troubleshoot. I can get the blink example to flash, but the mcu often fails to start up. I have to disconnect/reconnect the power several times to get the LED to start blinking. Same for flashing it in the first place - sometimes it fails or times out, but after a few power cycles, it works. So far, I can't find a pattern. Have tried two chips so far with identical results. Tried different decoupling caps, tried a cap on nRST, tried different power supplies, different wires - all with the same results. I'll keep poking away at it here, but it's certainly not anything to do with the pull up resistor.
I've narrowed down my ch32v startup problems to something in the included example blinkie. Perhaps there's an issue in the default interrupt vectors or the clocks somewhere. In any case, when I compile and burn a fresh example from the ch32v003fun repo (this one: https://github.com/cnlohr/ch32v003fun/tree/master/examples/systick_irq_millis ) - the chip starts up fine every time. But when I burn 'blink' from this repo, the mcu generally fails to start up until I bounce the power a few times.
Also, I've noticed that 'wipe_chip' from the console doesn't seem to do anything other than halt the mcu. Issuing a 'resume' (or a hardware reset or power cycle) after an (apparently successful) 'wipe' resumes the program as if nothing had happened.
I just came across your project today - wow, this is excellent work!! I got a pile of ch32v003 chips in the mail yesterday, but I'd ordered the wrong debugger, and your project gets me up and going.
Couple observations: