cnlohr / ch32v003fun

Open source minimal stack for the ch32 line of WCH processors, including the ch32v003, a 10¢ 48 MHz RISC-V Microcontroller - as well as many other chips within the ch32v/x line.
MIT License
953 stars 146 forks source link

Do not recognize my WCH-E link but works fine on naneos platform #395

Closed hientv1999 closed 1 month ago

hientv1999 commented 1 month ago

Hi, I used to develop firmware for CH32v003 on naneos platform and it works fine. Now I move to ch32v003fun to optimize flash usage. However, using the same WCH-E Link programmer, I don't know why ch32v003fun doesn't recognize my device. I have turned off any tab that can potentially use and block the COM port of my programmer. I'm using debugprintfdemo example though image

TommyMurphyTM1234 commented 1 month ago

Maybe you need to install the WinUSB drivers, e.g. using Zadig?

hientv1999 commented 1 month ago

But I can use on naneos just fine. Why on ch32v003fun I have to install driver? I’m using same computer, same programmer board, same board to be programmed. Everything is same exact the platform environment

eeucalyptus commented 1 month ago

Hi, I'm not sure how programming works with pio, haven't worked with that too much, but it is possible that it uses the stock USB driver. As @TommyMurphyTM1234 said, use zadig to change the driver and you should be good to go. You can always revert, if you want to go back to the original driver.

TommyMurphyTM1234 commented 1 month ago

Hi, I'm not sure how programming works with pio, haven't worked with that too much, but it is possible that it uses the stock USB driver.

I think so, assuming that's what's referred to here:

I presume that this is something that originated with WCH themselves?

hientv1999 commented 1 month ago

Hi, I found the solution. I don't need to reinstall USB driver whatsoever. I just followed this tutorial and created the project again from scratch and it should be good. 1 thing to change from this tutorial is that I don't need to place ch32v003fun.c and ch32v003fun.h in src folder anymore. Just main.c and funconfig.h files are enough https://github.com/cnlohr/ch32v003fun/issues/339

This keeps my workflow relatively similar to the original noneos framework. Only pressing arrow button to upload firmware and no need to use CLI to make file