1. Abstract

This document should be used as a reference guide to gain a deeper understanding of the SmartSnippets Software Development Kit (SDK). As such it covers a broad range of topics including a brief introduction to Bluetooth Low Energy (BLE), Operating System (OS) related material and a number of sections containing a more detailed technical analysis of hardware elements, for instance clock and power management

2. Figures

Figure 1 Bluetooth ® Branding

Figure 2 Integrated vs external processor BLE hardware configurations

Figure 3 Bluetooth low energy Protocol Stack Layers

Figure 4 Link Layer States

Figure 5 SmartSnippets™ Bluetooth low energy development platform overview

Figure 6 pxp_reporter task priorities

Figure 7 BLE framework architecture

Figure 8 Structure of a service handle

Figure 9 Structure of supported services

Figure 10 Central Pairing Just Works

Figure 11 Central Bonding Just Works

Figure 12 Central Bonding Passkey Entry (Central Display)

Figure 13 Central Bonding Passkey Entry (Peripheral Display)

Figure 14 Central Bonding Numeric Comparison (Secure Connections Only)

Figure 15 Peripheral Pairing Just Works

Figure 16 Peripheral Bonding Just Works

Figure 17 Peripheral Bonding Passkey Entry (Peripheral Display)

Figure 18 Peripheral Bonding Passkey Entry (Central Display)

Figure 19 Peripheral Bonding Numeric Comparison (Secure Connections Only)

Figure 20 L2CAP PDU format in Basic L2CAP mode on COC

Figure 21 Advertiser Device Interrupts Generation

Figure 22 Scanner Device Interrupts Generation

Figure 23 Master Device Interrupts Generation / Link Layer Connection Event without Deep Sleep

Figure 24 Master Device Interrupts Generation / Link Layer Connection Event with Deep Sleep

Figure 25 Slave Device Interrupts Generation / Link Layer Connection Event without Deep Sleep

Figure 26 Slave Device Interrupts Generation / Link Layer Connection Event with Deep Sleep

Figure 27 Two connection events

Figure 28 Attribute operations example

Figure 29 Architecture of Multi-Link Demo

Figure 30 Security framework architecture

Figure 31 HMAC algorithm

Figure 32 ECDH algolithm

Figure 33 DA1468x Power Domains

Figure 34 Synchronous BLE event

Figure 35 Asynchronous BLE event

Figure 36 CPM and Adapter Interaction - an Adapter aborts sleep

Figure 37 CPM and Adapter Interaction during Sleep/Active mode switch

Figure 38 Power Management Unit

Figure 39 Recommended Power configuration

Figure 40 Clock tree diagram

Figure 41 Battery charging profile

Figure 42 Watchdog overview

Figure 43 Flash cached pre-execution stages

Figure 44 Secure Boot - Main

Figure 45 Secure Secure Boot – Device Integrity Check

Figure 46 OTP layout

Figure 47 Secure Boot – FW validation

Figure 48 Secure Boot – Device Administration

Figure 49 Secure Boot – Build Configurations

Figure 50 Secure Boot – IDE imported projects

Figure 51 secure_image_config Python script

Figure 52 Question window to create new product keys file

Figure 53 elliptic curves used for creating asymmetric keys

Figure 54 generated product_keys.xml file

Figure 55 inserting private key index or address

Figure 56 inserting private key value

Figure 57 window to select the use of private key

Figure 58 selecting private key from product_keys.xml files

Figure 59 move existing configuration to product_keys.xml.old file

Figure 60 selecting hash method for SECP256R1, SECP224R1 or SECP192R1

Figure 61 add key revocations selection

Figure 62 key revocations values window

Figure 63 adding minimal version of software version

Figure 64 inserting minimal value of software

Figure 65 secure_suota_initial_flash_jtag script

Figure 66 Secure Boot - generated files

Figure 67 product_keys.xml file

Figure 68 secure_img_cfg.xml file

Figure 69 Html file generated by Doxygen

Figure 70 Adapter overview

Figure 71 Adapter communication

Figure 72 NVMS Overview

Figure 73 Virtual/Physical Addressing with and without VES

Figure 74 NVMS Adapter NVMS over QSPI and Virtual EEPROM emulation in Cached mode

Figure 75 Suspend/Resume ERASE Operation

Figure 76 Amount of data retained by the heap_4.o module

Figure 77 Memory blocks

Figure 78 DA14680/681 – QSPI Cached BLE non-optimized project

Figure 79 DA14680/681 – QSPI Cached BLE optimized project

Figure 80 DA14680/681 – QSPI non-BLE non-optimized project

Figure 81 DA14680/681 – QSPI non-BLE optimized project

Figure 82 DA14682/683, DA15100/1 – QSPI Cached BLE non-optimized project

Figure 83 DA14682/683, DA15100/1 – QSPI Cached BLE optimized project

Figure 84 DA14682/683, DA15100/1 – QSPI Cached non-BLE non-optimized project

Figure 85 DA14682/683, DA15100/1 – QSPI non-BLE optimized project

Figure 86 DA14680/681 – RAM BLE non-optimized project

Figure 87 DA14680/681 – RAM non-BLE non-optimized project

Figure 88 DA14682/683, DA15100/1 – RAM BLE non-optimized project

Figure 89 DA14682/683, DA15100/1 – RAM non-BLE non-optimized project

Figure 91 Setup 1 for the OTP Mirrored execution mode (DA14680/1-01)

Figure 92 Setup 2 for the OTP Mirrored execution mode (DA14680/1-01)

Figure 93 Create a new folder

Figure 94 Select the Linker Folder

Figure 95 Include folder paths

Figure 96 System Viewer application

Figure 97 Configuring the SEGGER System Viewer

Figure 98 Start Recording

3. Tables

Table 1 Kernel source files for FreeRTOS

Table 2 Header files for FreeRTOS

Table 3 Macro Definitions for the FreeRTOSConfig.h

Table 4 pxp_reporter tasks

Table 5 Source files for OSAL

Table 6 OSAL wrappers of the FreeRTOS API

Table 7 OSAL resource management API

Table 8 OSAL message queues functions

Table 9 API Functions of the common BLE host software component

Table 10 GAP and L2CAP API functions

Table 11 GATT server API

Table 12 GATT client API

Table 13 Header files for the BLE services

Table 14 BLE projects included in the SmartSnippets™ DA1468x SDK

Table 15 BLE Security API functions

Table 16 BLE Security API events

Table 17 BLE Security API macros

Table 18 Example of L2CAP COC

Table 19 L2CAP COC API- ble_l2cap.h

Table 20 L2CAP COC Events – received through ble_get_event() - ble_l2cap.h

Table 21 LE Data Length Functions – ble_gap.h

Table 22 LE Data Length Definitions

Table 23 LE Data Length Events – fetched using ble_get_event() - ble_gap.h

Table 24 NVPARAM fields

Table 25 BLE service API header files

Table 26 Dialog BLE API header files

Table 27 API for the adapters

Table 28 API for the communication with the CPM

Table 29 Configuration settings

Table 30 Functions in Clock Manager API

Table 31 Configuration settings for integrated charger of Li-ion batteries

Table 32 Charging with default parameters

Table 33 Pre-charging current settings

Table 34 Charger - Configuration settings for the USB interface

Table 35 Charger - Configuration settings for the charging algorithm

Table 36 Charger – configuration settings for a specific battery

Table 37 Charger related callback functions

Table 38 Configuration functions for sys_watchdog

Table 39 Macros for the configuration of the Flash subsystem

Table 40 The qspi_flash_config_t structure

Table 41 Operation modes

Table 42 Example program sections in RAM operation mode

Table 43 Example program sections for flash cached operation mode

Table 44 Example program sections for flash cached mode with BLE support

Table 45 Flash image header for DA14680/1-01

Table 46 LLD overview

Table 47 LLD header file

Table 48 Adapters overview

Table 49 Description of Partition entry

Table 50 Available Macros for the optimization of BLE framework footprint

Table 51 Amount of data retained by the FreeRTOS for this specific example

Table 52 DataRAM cells sequence

Table 53 SmartSnippets™ root directory structuree

Table 54 binary files inside SmartSnippets™ DA1468x SDK

Table 55 Config folder

Table 56 Doc folder

Table 57 dk_apps directory structure

Table 58 Host App directory

Table 59 SDK directory structure

Table 60 bsp directory structure

Table 61 interfaces directory structure

Table 62 middleware directory structure

Table 63 Utilities directory structure

Table 64 Commands and arguments

Table 65 General options

Table 66 GDB server specific options

Table 67 Serial port specific options

Table 68 bin2image options

Table 69 Build configurations

Table 70 QSPI programming scripts on Windows Host

Table 71 QSPI programming scripts on Linux Host

Table 72 System Clocks

Table 73 Battery types

Table 74 Power Definitions

Table 75 Trim and Calibration Section expected values per chip version

Table 76 List of configuration parameters

4. Codes

Code 1 Code defining the config_ASSERT() macro

Code 2 Code and Data Retention specific constants

Code 3 currently configured value for the configMAX_PRIORITIES

Code 4 Idle task’s priority

Code 5 Task priorities

Code 6 Initialization code for Immediate Alert Service

Code 7 Handle BLE events using BLE service framework

Code 8 Example of code for the Write Request

Code 9 Example of code that handle the Write Request and match it with the appropriate instance

Code 10 Enable BLE persistent storage

Code 11 Set BLE device

Code 12 Example of event handle

Code 13 Configure device as a BLE central

Code 14 Connection to another device

Code 15 Default BD address override

Code 19 Callback function example to catch events sent by the USB-charger

Code 16 Structure definition for XXX service

Code 17 Initialization function for XXX service

Code 18 Charging with custom parameters

Code 20 Notify sys_watchdog of the task

Code 21 Using sys_watchdog while suspending task for an event

Code 22 Memory mapping

Code 23 Enabling UART Adapter

Code 24 Parameters of UART bus arguments

Code 25 Parameters of the UART bus

Code 26 Open UART

Code 27 Acquire access to UART

Code 28 Write function (Synchronously)

Code 29 Read function (Synchronously)

Code 30 Write function (Asynchronously)

Code 31 Read function (Asynchronously)

Code 32 Release UART

Code 33 Close UART device

Code 34 Example of UART device

Code 35 Usage of NVMS

Code 36 NVMS Partition IDs

Code 37 Partition entry

Code 38 BLE framework preprocessor Macros

Code 39 Enabling FreeRTOS Heap Tracking

Code 40 RAM optimization settings

Code 41 Execution from Flash (cached)

Code 42 Execution from Flash (mirrored)

Code 43 Execution from RAM

Code 44 Enable System View configuration

Code 45 Call System View

Code 46 Enable/disable the monitoring

5. Terms and definitions

ADC Analog-to-Digital Converter

AES Advanced Encryption Standard

AHB AMBA High speed Bus

AMBA Advanced Microcontroller Bus Architecture

API Application Programming Interface

APU Audio Processing Unit

ATT Attribute Protocol

BR Basic Rate

BD Bluetooth Device

BIN Binary

BLE Bluetooth Low Energy

BOD Brown-Out Detection

CBC Cipher Block Chaining

CC Constant Current

CCC Client Characteristic Configuration

COC Connection Oriented Channels

CPU Central Processing Unit

CPM Clock Power Manager

CRC Cyclic Redundancy Check

CTR Counter

CV Constant Voltage

DCDC Direct Current – to – Direct Current

DMA Direct Memory Access

DMIPS Dhrystone MIPS (Million Instructions Per Second)

ECB Electronic Codebook

ECC Elliptic Curve Cryptography

ELF Extensible Linking Format

EEPROM Electrically Erasable Programmable Read-Only Memory

EDR Enhanced Data Rate

FreeRTOS Free Real-Time Operating System

FW Firmware

GAP Generic Access Profile

GATT Generic Attribute Profile

GCC GNU Compiler Collection

GDB GNU Debugger

GFSK Gaussian Frequency-Shift Keying

GPADC General Purpose Analog-to-Digital Converter

GPIO General-purpose input/output

HMAC Hash-based Message Authentication Code

HID Human Interface Device

HCI Host Controller Interface

HTML HyperText Markup Language

HW Hardware

I2C Inter-Integrated Circuit

IAS Immediate Alert Service

IC Integrated Circuit

IDE Integrated Development Environment

IEEE Institute of Electrical and Electronics Engineers

I/O Input/Output

IVT Interrupt Vector Table

LE Low Energy

LL Link Layer

L2CAP Logical Link Control and Adaptation Protocol

LLD Low-Level Drivers

MAC Media Access Control

MCIF Monitor and Control Interface

MITM Man In The Middle

MPS Maximum Payload Size

MTU Maximum Transmission Unit

NVM Non-volatile memory

OS Operating System

OSAL OS Abstraction Layer

OTP One-Time Programmable

PDM Pulse Density Modulation

PHY Physical Layer

PLL Phase-Locked Loop

PSM Protocol Service Multiplexer

PCB Printed Circuit Board

QSPI Queued Serial Peripheral Interface

RAM Random-Access memory

RC16 16 MHz Oscillate

RCX 10.5 kHz Oscillator

RF Radio Frequency

ROM Read-Only Memory

RTS/CTS Request to Send / Clear to Send

SDIO Secure Digital Input Output

SDK Software Development Kit

SDU Service Data Unit

SM Security Manager

SMP Security Manger Protocol

SIG Special Interest Group

SIP Serial Peripheral Interface

SW Software

SoC System on Chip

SRC Sample Rate Converter

SUOTA Software Upgrade Over The Air

TCS Trim and Calibration Section

TRNG True Random Number Generator

UART Universal Asynchronous Receiver/Transmitter

USB Universal Serial Bus

VBAT Battery supply voltage

VBUS External supply voltage (from USB)

VES Virtual EEPROM

XiP Executing in Place

XTAL16 16 MHz Crystal oscillator

6. References

[Ref_01]DA14681_FS_v2.1, Datasheet, Dialog Semiconductor
[Ref_02]UM-B-057-SmartSnippets Studio user guide, User manual, Dialog Semiconductor
[Ref_03]UM-B-056 DA1468x Software Developer’s Guide, User manual, Dialog Semiconductor
[Ref_04]UM-B-047 DA1468x Getting Started, User manual, Dialog Semiconductor
[Ref_05]RFC 2104, HMAC: Keyed-Hashing for Message Authentication
[Ref_06]FIPS PUB 198-1, The Keyed-Hash Message Authentication Code (HMAC)
[Ref_07]NIST, Special Publication 800-56A, Recommendation for Pair-Wise Key Establishment Schemes Using Discrete Logarithm Cryptography Revision 2
[Ref_08]Bernstein, Daniel J. “Curve25519: New Diffie-Hellman Speed Records”, in Proceedings of Public Key Cryptography - PKC 2006: 9th International Conference on Theory and Practice in Public-Key Cryptography, New York, NY, USA, April 24-26, 2006.
[Ref_09]BLUETOOTH SPECIFICATION Version 4.2
[Ref_10]AN-B-045 Application Note: DA14681 Supported QSPI Flash Devices
[Ref_11]AN-B-035 Application Note DA1468x Battery Charging Version 1.1
[Ref_12]AN-B-075 Application Note DA1468x State of Charge Functionality Version 1.2

7. Prerequisites

  • SmartSnippets™ Studio package
  • Dialog’s Semiconductor SmartSnippets™ DA1468x SDK
  • Operating System (Windows or Linux)
  • ProDK DA1468x and accessories