RISC-V/ARM MCU IDE MounRiver Studio dual-core development project practice (CH32V103&CH32F103)
[Copy link]
In recent years , the RISC-V ecosystem has been thriving , and many industry giants have made plans . A number of commercial IPs and supporting integrated development environments for RISC-V cores have also emerged in China . More and more commercial solutions and industry applications have also chosen RISC-V core MCUs . Taking my personal development experience as an example , a recent company project used the CH32V103 chip from Nanjing Qinhengwei . After submitting the development board application on the WCH official website, I went to its supporting tool official website ( www.mounriver.com ) to download the latest version of the corresponding integrated development environment MounRiver Studio (MRS) .
The MRS download package is about 470M . The installation process is very fast. After the installation wizard software is executed, you can directly open MRS without installing a tool chain or other software operating environment. It is quite convenient. The page when running for the first time is as follows :
The overall page is quite clean . Although we know from the software introduction that MRS is also developed based on the Eclipse platform , the simplicity of the interface is still refreshing. Next is the happy project development time!
First, open the New Project dialog box and use the template project that comes with MRS to verify the CH32V103 development board at hand .
On the project template page, there are RISC-V series MCU project templates from WCH and GD manufacturers , with a complete range of models . What's more surprising is that there are CH series chips with ARM core in the chip list ( I later found out that I didn't read the relevant introduction on the MRS welcome page carefully ) . I just happened to have a CH32F103 board on hand, so I can try to use MRS to develop ARM core projects later. At present, we continue the development of CH32V103 , select the C6T6 model to create a standard template project, and compile successfully .
Next, I want to try the online simulation function . I connect the WCH-Link I applied for with the CH32V103 development board according to the instructions in the documentation. The red light of the debugger is always on , indicating that it is currently in RISC-V mode , and the device manager has also recognized the hardware:
Hardware connection diagram:
Click the Debug icon on the toolbar to successfully enter the debugging mode . The lower left corner of the page is the disassembly code window , and the bottom output box also has register information :
I tried double-clicking to add breakpoints , single-step execution , pause , and re-execution ... Well, everything is normal ~
Click the stop button to exit the debugging mode , and then test the code burning function. Find the code download button on the toolbar, click the triangle button on the right , open the download configuration interface , and find that this page integrates the functions of device Flash read protection query / setting , programming address , erase , programming , verification , reset operation, etc.
Click the download button after applying directly :
Download successfully , connect to the serial port and see if the code runs normally :
Nice! The whole operation basically fills in parameters automatically. There is no need to set additional options for compilation and debugging. It is very developer-friendly and allows us to focus on the code rather than the integrated development environment itself.
The next step is to try out the CH32F103 development under MRS . We still use the built-in template project, select the CH32F103 C8T6 model, and create a project:
Click compile ~ Hey , it passes directly :
This is a bit magical. Could it be that MRS automatically switched the tool chain according to the chip core and automatically set the compilation parameters? Let's quickly open the project properties page to find out:
It has really been automatically switched to the ARM GCC tool chain. It seems that MRS has really worked hard to simplify development operations. Next, let's test the code download function of MRS for ARM core chips: WCH-Link needs to be switched to ARM mode. Refer to the accompanying documentation, connect TX to ground and power on again. The red and blue lights of the debugger are always on, indicating a successful switch.
Hardware connection diagram:
This time click the Download button again:
Sure enough, the downloaded software also automatically switched to the corresponding ARM core. After a little exploration, I found that the software can read the basic information of the chip, specify the location and length of the Flash content, query and set the Flash read protection status, etc.
After the burning is completed, connect the serial port, reset the chip, and observe the printed information:
The program runs normally! The last step is to do an online simulation test. Just click the simulation button:
Still no need to configure, the simulation is successful directly!
The above is all the content of the practical sharing of the MRS dual-core development project. From MCU to integrated development environment, it has given me a lot of surprises. I hope that domestic MCUs and development tools will get better and better!
|