Use CDK + Sipeed RV-Debugger Plus to compile and debug
Open Hello World
After obtaining the SDK, enter the
examples/hellowd/helloworld/cdkdirectory and double-clickhelloworld.cdkprojto open theHelloworldproject
Compile Hello World
helloworld.cdkproj
Select the
OpenOCD_Debugproject in the drop-down menu. Since Sipeed RV-Debugger Plus uses OpenOCD for debugging, this tutorial is based on theOpenOCD_Debugproject;If Sipeed RV-Debugger Plus does not install the driver correctly, please refer to Sipeed RV-Debugger Plus driver installation settings, set up the driver, and then proceed to the following steps
In the CDK toolbar, click the compile icon to compile the project
Click
1Build Projectto compile the currently selected projectClick
2Clean Projectto clear the results of the last compilationClick
3Flash Downloadto download the compiled code to the chip (Flash download function cannot be used with OpenOCD Debug)Click
5Start/Stop Debug whitout Downloadto debug directly without loading the current bin fileYou can also right-click the project name in
Project, and compile the project through the options in the right-click menu
Program Hello World
When using the OpenOCD mode debugging method in the CDK, it is not currently supported to directly use the CDK related
flashtool to download the code, so please use the BL Dev Cube tool to program, please refer to BLDevCube start guideUse CDK to debug after the code is programmed
Run Hello World
From the menu bar of the CDK
View->Serial Pane, open the serial port panel, right-click in the openedSerial Pane, set the serial port, select your corresponding serial port number and baud rate
CDK Serial Pane setting
Press the
RSTkey on the board, you can see the result of the code in the serial port
HelloWorld!
Debug Hello World
Click the
Start/Stop Debuggerbutton at the top of the toolbar to enter the debug interface, as shown in the figure below
Debug HelloWorld!
In the debug interface, the
Registerwindow can view theCPUinternal register data; thePeripheralsperipheral panel, you can view the corresponding peripheral register data, the top menu barPeripherals-> System Viewercan select peripherals; click the relevant debugging button in the upper toolbar to perform operations such as breakpoint setting, single-step debugging, single-step instruction, and full-speed operation. Of course, these operations have corresponding shortcut keys and shortcut setting methods. For details, please refer toCDK Help.We click the single step button to run the code, and we can see that the cursor moves to the next sentence of code, and we can see our output
Hello World!displayed in the serial port panel.