8. Build a DA14585/586 Application
This section explains how the user can build, program, and run a simple software application on the Basic Development Kit board.
It provides step-by-step instructions for loading the example as a project in the Keil environment, setting it up and building it, and finally executing it via the debug environment on any of the DA14585/586 devices.
Make sure that you have all required tools installed as described in Section Section 6 and Section Section 7.
The DA14585/586 Software Development Kit (SDK) includes examples running on the Pro and the Basic Development Kits. The examples are provided with preconfigured KEIL projects.
The SDK zip archive is downloaded from the customer support web page.
More details are provided in the DA14585 & DA14586 Software Developer’s Guide (UM-B-080).
8.1. The Blinky Peripheral Example Application
Blinky is a simple application which demonstrates basic initialization of DA14585/586 and LED blinking.
After downloading the SDK, the blinky source code example can be found in the directory called peripheral_examples
.
Open the folder containing the SDK files. This is the folder where you extracted the SDK zip file.
In
<sdk_root_directory>\projects\target_apps\peripheral_examples\blinky\Keil_5
, double-clickblinky.uvproj
to open the project in Keil.

Figure 21 Blinky Project directory
The development environment should look like this when the project is opened with Keil:

Figure 22 Blinky Project Keil Workspace
Click on the Target Options button, then click on the Device tab. The dialog should look like this.

Figure 23 Blinky Project Options
Click on Linker. Scatter files (
.sct
) are used for selecting memory areas.

Figure 24 Blinky Project Scatter File
Click on Debug and ensure J-LINK/J-TRACE Cortex is selected and that the Initialization File is set correctly to .sysram.ini.

Figure 25 Blinky Project: Debug Option
Click on Settings and check that the SW Device has been detected correctly.

Figure 26 Blinky Project: Jlink setup
Click OK to save the settings in both windows. All settings have now been saved and you can continue to build the example.
Build the project by pressing F7 key, or clicking the Build button, see Figure 27.

Figure 27 Blinky Project: Project Building
Make sure you have a UART connection between your PC and the motherboard, as shown in Figure 12. Check the COM number on your PC.
Open Tera Term, choose the COM port from step 9, and click OK.
Select Setup > Serial Port to configure the port as shown in Table 1.
In Keil, select Debug > Start/Stop Debug Session.

Figure 28 Blinky Project: Start Debug Session
If a non-licensed version of Keil is used, the following dialog is displayed. Click OK.

Figure 29 Keil Lite Pop Up Window
Press F5 or click the Run button to start code execution.

Figure 30 Blinky Project: Code Execution
When the blinky message is displayed on your UART terminal screen and the green LED is blinking you have successfully programmed and started the blinky program on DA14585/586 Demo board.

Figure 31 Blinky Project: Blinky message on COM28 terminal
8.2. The Barebone BLE Example Application
The Barebone BLE example application demonstrates basic BLE procedures such as advertising, connection, updating connection parameters, and implementation of the Device Information Service Server (DISS). See the Bluetooth SIG for more details.
Open the folder containing the SDK files. This is the folder where you extracted the SDK zip file.
In
<sdk_root_directory>\projects\target_apps\ble_examples\ble_app_barebone\Keil_5
, double-clickble_app_barebone.uvproj
to open the project in Keil.

Figure 32 Barebone BLE Project directory
Figure 33 shows the Keil project layout.

Figure 33 Barebone BLE: KEIL Project Layout
To execute the code and run the example, repeat steps 3 to 14 in The Blinky Peripheral Example Application.
The barebone application does not use the UART and so the only jumpers required are those for the debugger interface as noted in Table 3.
Use the Android application BLE Scanner to scan for, and connect to, the DIALOG-BRBN app, see Figure 34.

Figure 34 Barebone BLE: Interacting with BLE Application
Your BLE application is now running and advertising using the default advertiser string: “DIALOG-BRBN”.
Note
In this example, we used an Android application but you can also use the LightBlue iOS application to connect an iPad/iPod/iPhone device to the application.
8.3. Troubleshooting
GPIO |
Function |
Jumper |
---|---|---|
P0_4 |
UART2 TX |
Connect J4.11 - J4.12 |
P0_5 |
UART2 RX |
Connect J4.13 - J4.14 |
P1_0 |
LED |
Connect J9.1 – J9.2 |
If you can’t start a debug session, check the SWD debugger jumper configuration, see Table 3.
JTAG |
Function |
Jumper |
---|---|---|
TMS |
SWD IO |
Connect J4.25 - J4.26 |
TCK |
SWD CLK |
Connect J4.27 - J4.28 |
If you have trouble with the J-link firmware or any issue with SDK operation, refer to the DA1458x/68x Development Kit J-Link Interface Application Note AN-B-052.
Note
If none of these actions resolved the issue, please contact Dialog Software Forum.
8.4. What Next ?
This tutorial does not cover all the topics relevant to software development environments, it describes the first steps necessary to get started with the Pro Development Kit. The following links provide more information on DA14585/586:
DA14585 Product Brief: To know more about the SmartBond™ DA14585 SoC.
DA14586 Product Brief: To know more about the SmartBond™ DA14586 SoC.
UM-B-079: DA14585/586 SDK 6 Software Platform Reference: To know more about software architecture.
UM-B-080: DA14585/586 SDK 6 Software Developer’s Guide: To build more BLE and peripheral examples.
Codeless Tutorial: To quick start your IoT application and learn more about AT commands.
Sleep mode configurations and power measurement: To learn more DA14585/586 Power management.
Application Hardware Design Guideline : To learn how to prepare schematics and PCB layouts for your application.