CH582F (RISC-V) BLE5.3 Core Board, by WeAct Studio.

Its' CH582F BLE5.3 Core Board, by WeAct Studio.

Related Link:
~ Product Page
~ Github WeActStudio.WCH-BLE-Core




Remark in my start-up using CH582F BLE5.3 Core Board + WCHlink Debugger for ARM/RISC-V, by WeAct Studio.
(on Windows 10)

Install MounRiver & WCHISPTool (and driver)

Download and install MounRiver Studio to build first Hello World.

Firstly, I build a Hello World using MounRiver Studio and try to download to CH582F using ISP (In-System Programmer).

At most beginning, I download and install WCHISPTool_Setup.exe from Github, it's version 3.3. Suppose it will install WCHlink USB driver also.

To put the CH582F in ISP mode, press and hold the BOOT button and connect to USB port. In my case, CH582F cannot be recognized. Then I download and re-install from WCH page (http://www.wch-ic.com/downloads/WCHISPTool_Setup_exe.html). It's named WCHISPStudio 3.4 now. Then it can be recognized, and everything get smooth.

When I first run WCHISPStudio 3.4 with WCHlink Debugger connected, it detect and update firmware of WCHlink Debugger automatically.





Download firmware on CH582F using ISP tool, WCHISPTool (WCHISPStudio)

This video show steps to create our Hello World using MounRiver Studio, then download to CH582F BLE5.3 Core Board using WCHISPTool (WCHISPStudio).


MounRiver Studio, a Embedded RISC-V IDE, is used to build our HelloWorld.
http://www.mounriver.com/

Create our new project:
> File > New > MounRiver Project

Select target and name our new project.

As a example, copy Main.c, board.c and board.h from WeActStudio.WCH-BLE-Core CH582 example to our project /src folder.

Build:
> Project > Build All

The firmware built is here: /obj/hello_CH582F.hex. It will be downloaded to CH582F.

Run WCHISPTool (now named WCHISPStudio)
http://www.wch-ic.com/downloads/WCHISPTool_Setup_exe.html

Select MCU series, Chip Series and model, select USB as Download Port.

Power up CH582F in ISP mode:
Press and hold BOOT button then connect to USB.

Then Download after device connected.


Download firmware on CH582F using MounRiver Studio/WeAct WCHlink Debugger

WeAct WCH-Link Debugger can be used for online debugging and downloading of WCH RISC-V MCU, and also for online debugging and downloading of ARM MCU with SWD/JTAG interface. It also comes with a serial port for easy debugging output.
~ ref: WCH-LinkUserManual.PDF

This mini version factory default is equivalent to a mini-daplink. In order to download firmware to CH582F (RISC-V), WCH-LinkRV mode have to be selected.

This video show how to switch mode between WCH-LinkRV(for WCH RISC-V)/WCH-DAPLink(for ARM) on WeAct WCHlink debugger, using MounRiver Studio.


Connect WeAct WCHlink to CH582F as:
WCHlink    CH582F
3V3        3V3
DIO        B14
CLK        B15
GND        GND

To download firmware on CH582F using MounRiver Studio/WeAct WCHlink Debugger is very straightforward:
- Connect WeAct WCHlink to CH582F as shown above.
- Connect USB to WCHlink.
- Run MounRiver
- Make sure WCHlink is set WCH-LinkRV mode.
- Click on Flash > Download

But in my understanding, the CH582F (may be other WCH RISC-V chip also) are shipped with two-line debug interface (or called simulator-debug interface) disabled. In such case you will be reported error:
>> Board chip status error
1.Make sure the two-line debug interface has been opened. If not, set board to boot mode then use ISP tool to open it.
2.Please check your physical link connection.
In such case you have to enter ISP mode to enable it, as shown in this video:




To disable Simulator-Debug (Disable Two-Line Debug) Interface on CH582F


It's suggested to close simulator-debug interface to enable code and data protection.

To disable simulator-debug interface in MounRiver:
> Download button > Configuration
Click on Disable Two-Line Debug

It will take effect after power on again.



Updated@2023-04-21

May be something updated, when I installed MounRiver Studio v1.84 in Windows 11 (for CH32V003), it's found that WCHISPStudio V3.40, and USB driver installed also. That means I have no need to download and install WCHISPStudio and USB driver separately.

Check my updated post Download code to CH582F (RISC-V) using MounRiver Studio v1.84/WCHISPStudio V3.40, on Windows 11.





Comments

Popular posts from this blog

MicroPython/ESP32-C3 + 1.8" 128x160 TFT ST7735 SPI, using boochow/MicroPython-ST7735 library.

CameraWebServe: ESP32-S3 (arduino-esp32) + OV5640 camera module