9. Build a DA14531 Application

This section explains how the user can build, program, and run a simple software application on the ProDev Kit development board.

It provides step-by-step instructions to load the example as a project in the Keil environment, set up and build the project, and finally execute the project via the debug environment on the DA14531 device.

Make sure that you have all required tools installed as described in Section Section 7 and Section Section 8.

The DA14531 Software Development Kit (SDK) includes examples that run on the Pro Development Kits. The examples are provided with preconfigured KEIL projects.


9.1. The Blinky Peripheral Example Application

Blinky is a simple application that demonstrates the basic initialization of DA14531 DA14585/586 and LED blinking. It will proof that the hardware is correctly connected to the PC and that power is applied. After the SDK is downloaded, the blinky source code example is in the directory called peripheral_examples.

  1. Open the folder that has the SDK files. Figure 21 shows the folder with the extracted SDK zip file.

  2. In <sdk_root_directory>\projects\target_apps\peripheral_examples\blinky\Keil_5, double-click blinky.uvprojx to open the project in Keil.


Figure 21 Blinky Project Directory

The development environment should look like Figure 22 when the project is opened with Keil:


Figure 22 Blinky Project Keil Workspace

  1. Click on the Target Options button, and then click on the Device tab. The dialog window should look like Figure 23.


Figure 23 Blinky Project Options

  1. Click on the Linker tab. Scatter files (.sct) are used to select memory areas.


Figure 24 Blinky Project Scatter File

  1. Click on the Debug tab. Make sure that J-LINK/J-TRACE Cortex is selected and that the Initialization File is correctly set to DA14531.ini.


Figure 25 Blinky Project: Debug Option

  1. Click on the Settings button (in the top right of the “Debug” tab) and check that the SW Device is detected correctly.

The Serial Number (SN) should match the sticker on the bottom of the Motherboard.

  1. Click OK to save the settings in both windows. All settings are now saved and you can continue to build the example.

  2. Press the F7 key to build the project, or click the Build button. See Figure 27.


Figure 27 Blinky Project: Project Building

  1. Make sure that you have a UART connection between your PC and the motherboard, as shown in Figure 10. Find out what the COM port number is on your PC.

  2. Open Tera Term, select the COM port that is the same as that found in step 9, and click OK.

  3. In Tera Term, select Setup > Serial Port to configure the port as shown in Table 3.

  4. In Keil, select Debug > Start/Stop Debug Session.


Figure 28 Blinky Project: Start Debug Session

  1. If a non-licensed version of Keil is used, then the dialog window in Figure 29 shows. Click OK.


Figure 29 Keil Lite Pop Up Window

  1. 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 (see Table 4 for Jumper configuration and Figure 32 for the connection on the motherboard) and the orange LED is blinking, you have successfully programmed and started the blinky program on the DA14531 Demo Board. Use the same default jumper configuration as shown in Figure 5.

Table 4 Blinky Example UART and LED Jumper Configuration





UART2 TX (2 Wires)

Connect J1.17 - J2.27


UART2 TX (Single Wire)

Connect J1.19 – J1.20 Connect J10.1 – J1.15 Connect J10.2 – J1.17



Connect J8.3 – J8.4


On the FCGQFN24 package, P0_5 is assigned to a single wire UART signal RxTx. To enable this on DA14531 PRO-Development kit, three additional jumpers need to be added. See Figure 31.


Figure 31 UART2 Single Wire Jumper Configuration


Figure 32 UART2 Two Wires Jumper Configuration


Figure 33 Blinky Project: Blinky Message on COM28 Terminal


The whole application is placed/executed in RAM.


SPI Flash (U8: See Figure 7) can also be used to download an image file (.hex or .bin). For SPI flash programming steps with SmartSnippets Toolbox, see UM-B-083: Section 19: SPI Flash Programmer. For an SPI flash programming Keil example you can follow the SPI Flash Memory Example. Figure 3 shows the jumper settings for J1 when an SPI configuration (default) is used for the DA14531.


The SmartSnippets™ Toolbox can be used to download code and erase flash via JTAG using the default Jumpers configurations as shown in Table 5 and Figure 34. Use of the 2 wires UART to download code in SPI flash is also possible. Please see the pin connection settings in Figure 35.

Table 5 Default Configuration Settings for SPI



MOSI J1:3-4 (Default)


FCS J1:7-8 (Default)


MISO J1:9-10 (Default)


SCK J1:5-6 (Default)



Figure 34 SPI Flash Programing Through JTAG: Default Pins Configurations


Figure 35 SPI Flash Programing Through UART: Pins Configurations


  • To burn the SPI flash using SST over UART you will need to interface the DA14531 with pins other than the default, since the SPI default pins are multiplexed with the default UART pins. For this reason, modify the pin configuration to that shown in Figure 35.

  • Burning the flash via UART is also possible via single wire UART on P05.

9.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). For further reading see the Bluetooth SIG.

  1. Open the folder with the SDK files. This is the folder where you extracted the SDK zip file.

  2. In <sdk_root_directory>\projects\target_apps\ble_examples\ble_app_barebone\Keil_5, double-click ble_app_barebone.uvprojx to open the project in Keil.


Figure 36 Barebone BLE Project Directory


The <sdk_root_directory>\projects\target_apps\ble_examples\ble_app_all_in_one is only supported in DA14585/86.

Figure 37 shows the Keil project layout.


Figure 37 Barebone BLE: Keil Project Layout

  1. 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 ( steps 9, 10, and 11 from Blinky can be skipped) and so the only jumpers required are those for the debugger interface as mentioned in Table 6.

  1. Use the SmartBond app to scan for, and connect to, the DIALOG-BRBN app, see Figure 38.


Figure 38 Using the SmartBond app to connect to the BLE Application

Your BLE application is now running and advertising with the default advertiser string: “DIALOG-BRBN”.


When you change the advertising name of your device and you leave the BD address the same, it will not show the update on your iPhone/iPad and not to connect to it anymore, it is easy to make your device forget about it. Follow some easy steps mentioned in the Apple Support Communities and your iPhone will not remember the Bluetooth device. If you change your mind, then you can pair the device as though it were new.


When multiple devices use the same BD address in the same room test (close enough so both can be detected by the user’s Bluetooth® explorer tool), it is highly recommended to change the BD address manually or use the static random address (advanced) to avoid any conflict. See Tutorial 1: Advertising contents

9.3. Troubleshooting

  • If you can not see any blinky messages in your UART terminal and the LED is not blinking, check the UART and LED jumper configuration. See Table 4. The DA14531 has two different UART options: either UART2 with 2 wires, or UART2 with 1 wire.

  • If you cannot start a debug session, check the SWD debugger jumper configuration. See Table 6.

Table 6 Blinky Example SWD Debugger Jumper Configuration






Connect J1.23 - J1.24



Connect J1.21 - J1.22

  • Due to the limited number of pins on the DA14531, the P0_11 is shared with the SW_Trigger functionality. To get a capture on the SmartSnippets™ toolbox you must either remove J8[1-2] on the motherboard (you will not have SW_trigger functionality in this case), or assign the button to a different GPIO and wire it to J19[2] or J19[4].

  • If you have trouble with the J-link firmware or any issue with SDK operation, see DA1458x/68x Development Kit J-Link Interface Application Note AN-B-052.


If none of these actions resolved the issue, please contact the Dialog Forums.

  • When the device is programmed with an application in sleep mode, in order to attach the debugger, use a lower speed in JLink, eg 2000Khz.

9.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 DA14531: