CH32V003: How to flash program using serial port

There are situations where you might need UART/Serial port to flash the program in the MCU(CH32V003).

CH32V003: How to flash program using serial port 1

In this article, we will understand the procedure in step-by-step manner.

Step 1 (WCH_Link Utility)

  • Only WCH_LinkUtility 1.6 or later versions can be used to read/write the 1920 bytes area which starts from 0x1FFFF000.
  • This tool can be downloaded from the WCH website or Github openwch.
  • You can also use MounRiver Studio v1.84 or later version, which can export WCH_LinkUtility 1.6 directly. See the image below

You can check the MounRiver Studio version in the about section(see image below)

CH32V003: How to flash program using serial port 2

For WCH-Link Utility tool, check Tools section in the MounRiver Studio as shown in the image below:

CH32V003: How to flash program using serial port 3

Step 2 (Download IAP Program via WCH-LinkE Programmer)

Download the IAP program to the address 0x1FFFF000 using WCH-Link Utility.

IAP Program can be found in the code base๏ผš
1๏ผ‰ CH32V003EVT_ZIP: https://www.wch.cn/downloads/CH32V003EVT_ZIP.html
2๏ผ‰ USART_IAP Routine๏ผš CH32V003EVT\EVT\EXAM\USART_IAP\CH32V003_IAP

CH32V003: How to flash program using serial port 4

Please note the above IAP program download will happen using WCH-LINKE Programmer (one-wire interface)

STEP 3 (Download User Program Via Serial Port)

After the IAP program is downloaded through 1-wire is completed

The example application bin file could be downloaded to chip via serial(UART) port using WCHMcuIAP_WinAPP, you can find the application in the code base at the location>CH32V003EVT\EVT\EXAM\USART_IAP

Note:

  • PC0 should be floating during the downloading process
  • Serial(UART) port pin is PD5๏ผˆTX), PD6(RX)).
  • WCHMcuIAP_WinAPP default serial port baud rate is 460800, a different baud rate can be set directly by writing the right registers in the IAP program.
CH32V003: How to flash program using serial port 5

After the download is completed successfully, The PC0 pin should be tied low and power cycle the chip or reset the chip, then you will see the application program is executing or running.

I hope you found this article useful.

If you are building a product using CH32V003, I will be happy to have a quick chat with you for a couple of minutes, let me know ๐Ÿ™‚


I am currently working as an embedded systems design consultant helping companies build custom embedded products and develop test automation solutions for their PCB.

If you have any feedback about the blog, you can share it in the comments below or contact me directly.


3 comments

  1. Is there a way of programming this chip using a cable connected to USB-C connector placed on the dev board? If not, what is the use of USB-connector in the dev board?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.