Series article directory
【CH32】| 00——Development environment construction
【CH32】| 01——New project| Download| Run|Debug
It's cute when it fails, and it's super handsome when it succeeds. |
Article directory
1. New construction
1.1 Based on the official IDE [MounRiver Studio]
Generally, there are several ways to create a new project
. Remember; the project name/path should not have Chinese
1.1.1 Create a new project using the official built-in project template
This is relatively quick and easy to get started
1. Open MounRiver
2. Select File—> New —> MounRiver Project in the menu bar 3. Modify the project name and project storage address
in the pop-up setting project setting interface and select the default template corresponding to your own chip
1.1.2 Create a new project using a custom project template
First, we customize our own project directory structure
1.1.2.1 Create a new custom project
There are two ways 1. Modify from the official template project 2. Create from scratch
Here, create a new one from scratch
1. First plan our own directory file structure
This is my commonly used directory structure (preferably)
2. Add relevant files according to your own directory structure
can be directly Copy it from the demo.
The following is the link file of the project file that I added and put it under the project.
3. Create a new project and add the project file to the project
The next step is to complete the new
debug folder and change it to Debug
You can see that there are no other folders that we need to add
4. Add our assigned folder in the project
added
5. Configure the project
to add the header file path
Add link file.ld file
Set the architecture related,
you're done, you can compile it ctrl+b
1.1.2.2 Set as template project
1. Select the project
Select the export path under the official template project directory under the IDE installation path
\MounRiver\MounRiver_Studio\template\wizard\WCH\RISC-V\CH32V003\NoneOS
Our custom project can be seen when we have exported it .
2. Download
2.1 WCLINK pin link
Here we use the WCH LINK mode to download.
The V003 SWDIO I use in my hand can be connected to the development board D1.
2.2 Configuration download
As shown in the picture
, remember to save it
Press F8 or
if it fails to download several times
3. Debugging
3.1 Configuration debugging
1. Set to save the elf file after compiling.
2.
Set the debug configuration
Start debugging
Here is a brief introduction to some operations, and then write a detailed eclipse instruction