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, clickBrowse(1.1) in theSOFTWARE RESOURCESsection.
'Import 1'

Fig. 1Open Project Browser

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

Fig. 2Select 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. ClickDeselect All(3.1).
    2. Select the desired projects by clicking on the respectivetick boxes(3.2).
    3. ClickFinish(3.3).
Now you are ready to start working with the project.
'Import 3'

Fig. 3Project Selection

2.2. Configuring the Workspace

TheSEGGER J-Linkdrivers must be correctly installed in SmartSnippets™ Studio. To check this:

  1. ClickWindow > Preferences.
'Import 4'

Fig. 4Configure SEGGER J-Link Tool Chain

  1. In the displayed window, go toRun/Debug > SEGGER J-Linkand, in theFoldersection, clickBrowse…. Browse for the J-Link drivers (normally found underC:\Program Files (x86)).
'Import 7'

Fig. 5Second Step to Configure the Workspace

The same procedure should be carried out forSEGGER OzoneandSystemView. If one of these tools is not already installed then you need to download it fromSEGGER’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. 右键单击导入的示例代码文件夹并选择Copy.
'Import 6'

Fig. 6First Step to Copy a Project

  1. Right-click on a blank area (in theProject Explorer) and selectPaste. In theCopy Projectwindow, enter a项目名称(2.1) and uncheckUse default location(2.2).Browse…for a location to store the new project (2.3).
'Import 7'

Fig. 7Second Step to Copy a Project

  1. In theBrowse For Folderwindow, 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,/projects/dk_apps/). Create a new folder by clicking onMake New Folder(3.2) and entering a folder name (3.3). ClickOK(3.4).
'Import 8'

Fig. 8Third Step to Copy a Project

  1. ClickOKin theCopy Projectwindow (2.4). The newly copied project will be displayed inProject Explorerbelow 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, selectFile > New > Folder.
'Import 10'

Fig. 9Select New Folder Menu

  1. In theNew Folderwindow, select the path under which the new folder will be added (2.1), enter theFolder name(2.2), and clickFinish(2.3). The new folder will be displayed.
'Import 11'

Fig. 10Select Parent Folder, Input New Name

  1. Use the same procedure to define newsourceandheaderfiles (at step 1.3 select eitherSource FileorHeader File分别,而不是选择Folder). In this case, the preferred names (step 2.2) should end with a.cor.hsuffix respectively (for example,source.corheader.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, selectProject>Properties>C/C++Build>Settings>ToolSettings>CrossARMCCompiler>Includesand click on theAdd…icon (4.6).
'Import 12'

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

  1. In theAdd directory pathwindow, clickWorkspace…(5.1) and specify the path of the newly created folder/file. It will be displayed in theDirectorysection. ClickOK(5.2) and then clickOKin the previously opened window (4.7).
'Import 13'

Fig. 12Input New Folder Name