4.4. How to develop with Nuclei Studio

This chapter will introduce how to run Hello World demo on HBirdv2 E203 SoC with Nuclei Studio.

4.4.1. Nuclei Studio introduction

Nuclei Studio is an integrated development environment(IDE) developed by Nuclei System Technology to support its self-developed processors(including commercial Nuclei series processors and open source HBird E203 processor). It’s implemented based on the open source Eclipse framework, and fully integrated with Nuclei SDK(for commercial Nuclei series processors) and HBird SDK(for open source HBird E203 processor). Users could easily create new projects and modify project settings based on their requirements with Nuclei Studio.

4.4.2. Install Nuclei Studio

Nuclei Studio could be downloaded from Nuclei Download Center.

ide_fig1

Fig. 4.31 Nuclei Studio download

Note

Nuclei Studio is available in Windows and Linux, here just take Nuclei Studio for Windows as example.

Etract the downloaded package, there are three parts, shown in the figure below.

  • NucleiStudio: Nuclei Studio IDE.

  • SerialDebugging_Tool: Serial Debugging tool for Windows.

  • HBird_Driver.exe: HBird Debugger driver for Windows.

ide_fig2

Fig. 4.32 Nuclei Studio package

4.4.3. Creat Hello World Project

1. Lanuch Nuclei Studio

  • Doubel-click eclipse.exe under NucleiStudio directory, shown in the figure below.

    ide_fig3

    Fig. 4.33 Lanuch Nuclei Studio

  • Then setting workspace in the next window, shown in the figure below.

    ide_fig4

    Fig. 4.34 Set Workspace

    Note

    Workspace is the directory used to store the projects you will create, so you can choose any directory in your working PC as you like.

  • After workspace set, click the Launch button, Nuclei Studio will be launched, shown in the figure below.

    ide_fig5

    Fig. 4.35 Welcome page

2. Creat project

  • In the menu bar, select “File -> New -> C/C++ Project”, shown in the figure below.

    ide_fig6

    Fig. 4.36 New Project

  • In the pop-up window, select “C Managed Build”, then click “Next”, shown in the figure below.

    ide_fig7

    Fig. 4.37 New Project Type

  • In next window, input “HelloWorld” as Project name, and select “HBird SDK Project For hbirdv2 e203 SoC”, then click “Next”, shown in the figure below.

    ide_fig8

    Fig. 4.38 New Project Name

  • In next window, “Board”, “Core” and “DOWNLOAD”, these project options could be set, here just keep them as default, and click “Next”, shown in the figure below.

    ide_fig9

    Fig. 4.39 New Project Options

  • In next window, select “baremetal helloworld” as Project Example, and about other options just keep them as default, then click “Next”, shown in the figure below.

    ide_fig10

    Fig. 4.40 New Project Example

  • In the next steps, just keep them as default, then click “Next”, finally click “Finish”, shown in the figure below.

    ide_fig11

    Fig. 4.41 Finish New Project Creat

  • The created project is shown in the figure below.

    ide_fig12

    Fig. 4.42 Created HelloWorld Project

    Note

    From the Project Explorer on the left side of the figure, we can find that, the created project already includes HBird SDK, so users could develop other applications easily based on the created baremetal demo.

4.4.4. Compile Hello World Project

1. Compile options setting

  • In the menu bar, select “RV-Tools -> SDK Configuration Tools”, shown in the figure below.

    ide_fig13

    Fig. 4.43 SDK Configuration Tools

  • In the pop-up window, you can choose the download mode as you need, then click “Save” button, shown in the figure below.

    ide_fig14

    Fig. 4.44 Compile Options

2. Compile HelloWorld demo

  • Click the “Build” button, the icon of this button is a hammer, shown in the figure below.

    ide_fig15

    Fig. 4.45 Build Project

  • After the project compiled successfully, it will shown as the figure below.

    ide_fig16

    Fig. 4.46 Build finished

    Note

    • The generated executable file named “HelloWorld.elf” is located in Debug directory.

    • The code size and data size is also printed in the Console window.

4.4.5. Run Hello World Project

1. Hardward connection

2. Debugger driver install

3. Download and run

  • Open the created Hello World project, select “RV-Tools -> SDK Configuration Tools”, choose “FLASH” as download mode, then click “Save” button, shown in the figure below.

    ide_fig17

    Fig. 4.47 Download Mode Setting

  • Click the “Build” button, compiling the project.

    ide_fig18

    Fig. 4.48 Build Project

  • In the menu bar, select “Run -> Run Configuration”, shown in the figure below.

    ide_fig19

    Fig. 4.49 Open Run Configuration

  • Double-click “GDB OpenOCD Debugging”, then a set configuration file used for debug/download named “HelloWorld Debug” will be generated automatically, finally click “Run” button, shown in the figure below.

    ide_fig20

    Fig. 4.50 Run Configuration file

    Note

    If the Run/Debug Configuration file already exists, don’t need to generate again.

  • After the program uploaded successfully, it will shown as the figure below.

    ide_fig21

    Fig. 4.51 Download Complete

4. Run result

  • In the menu bar, select “Window -> Show View -> Terminal”, then click the “Open a Terminal” button in Terminal window, the icon of this button is a monitor, shown in the figure below.

    ide_fig22

    Fig. 4.52 Open Terminal

  • In the pop-up window, choose “Serial Terminal”, and set other parameters as following figure shown.

    ide_fig23

    Fig. 4.53 Config Terminal

    Note

    The serial port number depends on your device.

  • After Serial Terminal opened, you can press the MCU_RESET button on Nuclei ddr200t development board to reset MCU and the Hello World program will be executed again, the result is shown in the figure below.

    ide_fig24

    Fig. 4.54 Hello World Demo Result

4.4.6. Debug Hello World Project

1. Hardward connection

2. Debugger driver install

3. Debug

  • Open the created Hello World project, click the “Build” button, compiling the project.

    Note

    Debugging program need to set download mode as “ILM”, since the newly created Hello World project already sets “ILM” as default download mode, so we don’t need to do any changes before compiling. If the download mode has been changed by yourself, please make sure it should be set to “ILM” when you want to debug program.

  • In the menu bar, select “Run -> Debug Configuration”, shown in the figure below.

    ide_fig25

    Fig. 4.55 Open Debug Configuration

  • Double-click “GDB OpenOCD Debugging”, then a set configuration file used for debug/download named “HelloWorld Debug” will be generated automatically, finally click “Debug” button, shown in the figure below.

    ide_fig26

    Fig. 4.56 Debug Configuration file

    Note

    If the Run/Debug Configuration file already exists, don’t need to generate again.

  • After entering debugging mode successfully, it will shown as the figure below.

    ide_fig27

    Fig. 4.57 Debugging Mode