2.5. Nuclei Studio NPK Creation and Sharing
Nuclei Studio 2022.04 provides an important feature: using the initial templates provided, developers can easily create their own NPK component packages and contribute them through the platform for other developers to use.
2.5.1. Develop an NPK Component Package
2.5.1.1. Authenticate as a Developer
Before creating an NPK component package, you must first authenticate a developer account to obtain a unique owner ID. This owner ID corresponds to the owner described earlier and makes NPKs easier to manage.
First, log in to Nuclei System Technology’s RVMCU community website. After logging in, go to the Nuclei Studio -> Contribute page, where you can see the authentication button.

Alternatively, visit the authentication page directly and fill in the required information. The suffix of the developer space address corresponding to Developer is your owner ID.

After filling in the required information, submit it. Once the system review is approved, the authentication is complete.

2.5.1.2. Create an NPK Component Package
After completing developer authentication, create a new Nuclei Studio component project by selecting File-> New-> Project-> C/C++-> New Nuclei NPK Project in the menu bar.

For first-time use, log in with a developer account. The login is valid for 7 days; after that, you must log in again. Login requires scanning a QR code with WeChat, as shown in the figure below. After a successful login, the owner drop-down box lists the bound developer accounts; fill in the remaining information. To switch accounts, click login again.

After the developer account is logged in, fill in the project name, project type, and other related information following the project wizard.

When you select a Type for which no corresponding template exists, a prompt appears. Click OK to open the Nuclei Package Management page and download the corresponding Template Package as needed, or click Import in the lower right corner of the figure below to import it yourself.
The following example uses the ssp type template. Suppose your company name is GreenTech, your SoC name is gt25nv, the adapted board is gt25nv_fpga_eval, it uses the N307FD processor (rv32imafdc) configuration with DSP features configured, and it provides three download modes: ilm, flash, and flashxip.
Select ssp for Type: SoC Support Package

When you select a Type with no related template, you are taken to the Nuclei Package Management page. On this page, select version 1.1.0 of tpp-nuclei_sdk, click Download, and close the page after the download is complete.

Click Next, and select the tpp-nuclei_sdk template you just downloaded in Select a Template. The left side shows the template description and a preview of the related files; the right side shows part of the customizable content in the template.

In this example, the company name is GreenTech, the SoC name is gt25nv, the adapted board is gt25nv_fpga_eval, the configuration uses the N307FD processor (rv32imafdc) with DSP features configured, and it provides three download modes: ilm, flash, and flashxip. The result after modification is shown in the figure.

Click Finish to generate the NPK component package. You can then open the directory to view and modify the files and structure as needed, and import the NPK component package after the modification is complete.
Modify the project as needed, then import the NPK component package once the modification is complete.

When importing the SoC package created in the example, a prompt indicates that the dependency sdk-nuclei_sdk is missing. Click OK to open the Nuclei Package Management page, select sdk-nuclei_sdk, and click Download.


After the download is complete and the NPK component package project has been imported successfully, the result is shown in the figure below.

2.5.2. Checking and Troubleshooting NPK Component Packages
2.5.2.1. Checking a Newly Created Package Before Import
Before importing a completed package, you can use the checking tool to verify the validity of the NPK component package and avoid import failures. Its core functions focus on compliance checks of code style, variable naming, function structure, and dependency relationships to ensure code quality.
For details about this tool, see: Package checking tool
2.5.2.2. Handling Package Import Failures
When a package fails to import, you can identify the problem from the relevant logs. This section covers issues such as NPK file format errors and unsatisfied dependencies.
Click View log in the lower right corner of the Package Management page to open a log page that briefly describes the reason for the import failure.


When a message such as “There are file parsing exceptions” appears in the log, check the log file of that day under the <user directory>\nuclei-pack-npk-v2\CFGs\logs\sys\ path for details about the problems in the related NPK files, and make the corresponding corrections.



2.5.2.3. Create a Test Project
To create a project using the imported NPK component package project, select File-> New-> Project-> C/C++-> New Nuclei RISC-V C/C++ Project in the menu bar.

Click Next, and select the SoC and board contained in the package created above.

Click Next, fill in the Project Name, select Simple Helloworld Demo for Project Example, and click Finish to complete the creation of the test project.

2.5.2.4. Build and Debug the Test Project
The project created in the steps above is a test project based on the developer’s NPK component package. The developer can code, debug, run, and perform other operations on it as with a normal project.
Click to select the N307FD project generated in the previous step and build it; the build succeeds. Subsequent steps such as running are omitted here. At this point, an NPK component package has been successfully created and imported for use.

2.5.4. Using NPK Component Packages in Nuclei Studio
NPK component packages enrich the user experience in Nuclei Studio. With NPK component packages, you can define various project creation workflows and easily share mature projects or components with others.
All contributed NPK packages are managed in NPK Package Management of Nuclei Studio, where users can download, import, delete, and perform other operations on NPKs.









