# 2. Creating a New Project¶

This section describes how to import a project containing source code and start working with a custom one. The following video displays all the necessary steps to install the necessary Dialog’s tools and start dealing with Dialog’s products.

There are two ways to start working with a custom project, either import an existing sample design and make all the necessary changes after copying it or build a new one from the scratch. Since the latter is time consuming and out of the scope of this tutorial, only the first process is demonstrated.

Preparing and setting the tools needed to start dealing with Dialog's DA1468x products.

## 2.1. Importing a Project¶

To import a project:

1. On the SmartSnippets Welcome page, click Browse (1.1) in the SOFTWARE RESOURCES section.

Fig. 1 Open Project Browser

1. In the pop-up window, click OK (2.1) as your current workspace folder should be automatically selected. If this is not the case, you must explicitly select it.

Fig. 2 Select SDK Folder

1. The final step is to select the preferred project(s) to import. By default all projects are selected. The simplest way to continue is to:
1. Click Deselect All (3.1).
2. Select the desired projects by clicking on the respective tick boxes (3.2).
3. Click Finish (3.3).
Now you are ready to start working with the project.

Fig. 3 Project Selection

## 2.2. Configuring the Workspace¶

The SEGGER J-Link drivers must be correctly installed in SmartSnippets™ Studio. To check this:

1. Click Window > Preferences.

Fig. 4 Configure SEGGER J-Link Tool Chain

1. In the displayed window, go to Run/Debug > SEGGER J-Link and, in the Folder section, click Browse…. Browse for the J-Link drivers (normally found under C:\Program Files (x86)).

Fig. 5 Second Step to Configure the Workspace

The same procedure should be carried out for SEGGER Ozone and SystemView. If one of these tools is not already installed then you need to download it from SEGGER’s official web site.

## 2.3. Copying a Demo Project¶

As mentioned in previous section, there are two phases to start working with a custom project. The first stage is to import a demo project from Dialog’s SDK and the second is to copy it and make all the required changes. The recommended way to copy sample code is:

1. Right-click on the imported sample code folder and select Copy.

Fig. 6 First Step to Copy a Project

1. Right-click on a blank area (in the Project Explorer) and select Paste. In the Copy Project window, enter a Project name (2.1) and uncheck Use default location (2.2). Browse… for a location to store the new project (2.3).

Fig. 7 Second Step to Copy a Project

1. In the Browse For Folder window, select the location where the new project will be stored (3.1). It is recommended to select one of the folders under which the various sample codes are stored in the SDK (for example, <sdk_folder>/projects/dk_apps/<imported_project_location>). Create a new folder by clicking on Make New Folder (3.2) and entering a folder name (3.3). Click OK (3.4).

Fig. 8 Third Step to Copy a Project

1. Click OK in the Copy Project window (2.4). The newly copied project will be displayed in Project Explorer below the imported project.

Note

The new project must remain at the same hierarchical depth as the source project as some of the environment variables rely on the relative path. If the user fails to keep the depth consistent, the project will fail to compile.

## 2.4. Adding a New Folder/File to the Project¶

1. To add a new folder to your project, select File > New > Folder.

Fig. 9 Select New Folder Menu

1. In the New Folder window, select the path under which the new folder will be added (2.1), enter the Folder name (2.2), and click Finish (2.3). The new folder will be displayed.

Fig. 10 Select Parent Folder, Input New Name

1. Use the same procedure to define new source and header files (at step 1.3 select either Source File or Header File respectively, instead of selecting Folder). In this case, the preferred names (step 2.2) should end with a .c or .h suffix respectively (for example, source.c or header.h).

1. Every newly created folder must be placed inside the project’s path, in a folder that is in the compiler’s include path. To do this, select Project > Properties > C/C++ Build > Settings > Tool Settings > Cross ARM C Compiler > Includes and click on the Add… icon (4.6).

Fig. 11 Add the New Folder to the Include Search Path

1. In the Add directory path window, click Workspace… (5.1) and specify the path of the newly created folder/file. It will be displayed in the Directory section. Click OK (5.2) and then click OK in the previously opened window (4.7).

Fig. 12 Input New Folder Name