I have been using the CH32V003 -A4 (SOP16) part for various projects and today I got bit.
I was using some GPIO pins and my scope to dig out some bug, and eventually I put a fast signal on D4. When I went to program a new image, it failed. In different ways. Some times, wlink said there was no part, sometimes it said it was the wrong part, and a couple others. Did I accidentally brick my CPU?
Something tickled my brain, and I noted that on the -A4 part, D4 and D1 (SWIO) are next to each other. I seem to remember some errata on some other part (probably STM32) where there was the possibility of crosstalk between two pins. I don't remember it well, but the workaround may have been to make them both outputs.
So with some hope, I thought maybe helping SWIO with a resistor might quiet it down. Assuming that is the problem, which I did not know, I just suspected. A 1K resistor to ground did not help. Then to VDD. Bingo! I was able to program it normally.
My personal errata now includes "Be careful about how to use D4 on that part. Input might be fine. Slow or occasional output might be fine. But don't put a fast and continuous signal out D4."