【CH32】| 01——New project| Download| Run|Debug

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.

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
insert image description here
in the pop-up setting project setting interface and select the default template corresponding to your own chip

insert image description here
insert image description here

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)
insert image description here
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.
insert image description here
3. Create a new project and add the project file to the project

insert image description here
insert image description here
insert image description here

insert image description here
insert image description here

The next step is to complete the new
debug folder and change it to Debug

insert image description here
You can see that there are no other folders that we need to add

4. Add our assigned folder in the project

insert image description here

insert image description here
added
insert image description here

5. Configure the project
to add the header file path

insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
Add link file.ld file

insert image description here
Set the architecture related, insert image description here
you're done, you can compile it ctrl+b
insert image description here

1.1.2.2 Set as template project

1. Select the project
insert image description here
insert image description here

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
insert image description here


insert image description here
Our custom project can be seen when we have exported it .
insert image description here

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.
insert image description here

2.2 Configuration download

As shown in the picture
insert image description here
insert image description here
, remember to save it
insert image description here
insert image description here

Press F8 or
insert image description here
if it fails to download several times

insert image description here

3. Debugging

3.1 Configuration debugging

1. Set to save the elf file after compiling.
insert image description here
insert image description here
2.
Set the debug configuration
insert image description here

insert image description hereinsert image description here

Start debugging
insert image description here
insert image description here
insert image description here
Here is a brief introduction to some operations, and then write a detailed eclipse instruction

4. run

insert image description here


Guess you like

Origin blog.csdn.net/weixin_43822014/article/details/130741322