Wireless Embedded
Published

Basic Configuration on DA14535 BLE for Peripheral role

I am going to show you how to make all the basic configurations when you want to use the DA14535 Renesas BLE IC into Peripheral role.

BeginnerFull instructions provided1 hour27
Basic Configuration on DA14535 BLE for Peripheral role

Things used in this project

Hardware components

Renesas [DA14535-00FXDEVKT-P] Development Kit Pro DA1453x
DA1453x Development Kit Pro from Renesas Electronics. It can be used with any DA1453x BLE Device and the DA14585/6 BLE devices as well.
×1
Renesas [DA14535-00FXDB-P] DA14535 Daughterboard
DA14535 Daughterboard that can be used with Dev Kit Pro. User can select any DA1453x daughterboard for this tutorial.
×1

Software apps and online services

Renesas SDK v6.0.24
SDK v6.0.24 is latest SDK6 (July 2025) that supports DA1453x BLE devices from Renesas electronics. It is required to be downloaded from their site.
Arm Keil ΞΌVision IDE (MDK)
Keil IDE is designed for developing embedded projects on Cortex and Arm devices. It requires a valid license.
Renesas e2 Studio IDE
e2 Studio IDE is an Eclipse based IDE from Renesas Electonics. The latest SDK6, that we will work on, is also supported on e2 Studio IDE. No license is required. Tutorial on Getting Started with e2 Studio IDE for DA1453x devices: https://lpccs-docs.renesas.com/e2_studio_sdk6_getting_started/index.html

Story

Read more

Schematics

DA1453x Dev Kit Pro + DA14535 DB

The correct Jumper configuration in order to use the integrated SPI Flash of the Dev Kit Pro to store the Bonding Table with the security information from our LE Secure Connection. For Debug Messages, we must also place the UTX jumper on J1 or connect a cable directly to P0_6 on Header J2

Code

LE Secure Connections Configuration on DA14535

C/C++
How to configure LE Secure Connections on DA14535 with SDK v6.0.24..
Go into user_config.h file and change the following
/*
 ****************************************************************************************
 *
 * Privacy / Addressing configuration
 *
 ****************************************************************************************
 */

/*************************************************************************
 * Privacy Capabilities and address configuration of local device:
 * - APP_CFG_ADDR_PUB               No Privacy, Public BDA
 * - APP_CFG_ADDR_STATIC            No Privacy, Random Static BDA
 * - APP_CFG_HOST_PRIV_RPA          Host Privacy, RPA, Public Identity
 * - APP_CFG_HOST_PRIV_NRPA         Host Privacy, NRPA (non-connectable ONLY)
 * - APP_CFG_CNTL_PRIV_RPA_PUB      Controller Privacy, RPA or PUB, Public Identity
 * - APP_CFG_CNTL_PRIV_RPA_RAND     Controller Privacy, RPA, Public Identity
 *
 * Select only one option for privacy / addressing configuration.
 **************************************************************************
 */
#define USER_CFG_ADDRESS_MODE       APP_CFG_CNTL_PRIV_RPA_RAND

/*************************************************************************
 * Controller Privacy Mode:
 * - APP_CFG_CNTL_PRIV_MODE_NETWORK Controler Privacy Network mode (default)
 * - APP_CFG_CNTL_PRIV_MODE_DEVICE  Controler Privacy Device mode
 *
 * Select only one option for controller privacy mode configuration.
 **************************************************************************
 */
#define USER_CFG_CNTL_PRIV_MODE     APP_CFG_CNTL_PRIV_MODE_NETWORK

/*
 ****************************************************************************************
 *
 * Security configuration
 *
 ****************************************************************************************
 */

/************************************************************
 * Device IO Capability (@see gap_io_cap)
 *
 * - GAP_IO_CAP_DISPLAY_ONLY          Display Only
 * - GAP_IO_CAP_DISPLAY_YES_NO        Display Yes No
 * - GAP_IO_CAP_KB_ONLY               Keyboard Only
 * - GAP_IO_CAP_NO_INPUT_NO_OUTPUT    No Input No Output
 * - GAP_IO_CAP_KB_DISPLAY            Keyboard Display
 *
 * Select only one option.
 ************************************************************
 */
#define USER_CFG_FEAT_IO_CAP    GAP_IO_CAP_DISPLAY_YES_NO

/************************************************************
 * OOB information (@see gap_oob)
 *
 * - GAP_OOB_AUTH_DATA_NOT_PRESENT    OOB Data not present
 * - GAP_OOB_AUTH_DATA_PRESENT        OOB data present
 *
 * Select only one option.
 * Note: OOB is only supported with Legacy Pairing
 ************************************************************
 */
#define USER_CFG_FEAT_OOB       GAP_OOB_AUTH_DATA_NOT_PRESENT

/************************************************************
 * Authentication Requirements (@see gap_auth_mask)
 *
 * - GAP_AUTH_NONE      None
 * - GAP_AUTH_BOND      Bond
 * - GAP_AUTH_MITM      MITM
 * - GAP_AUTH_SEC       Secure Connection
 * - GAP_AUTH_KEY       Keypress Notification (Not Supported)
 *
 * Any combination of the above.
 ************************************************************
 */
#define USER_CFG_FEAT_AUTH_REQ  (GAP_AUTH_BOND | GAP_AUTH_MITM | GAP_AUTH_SEC)

/************************************************************
 * Encryption Max key size (7 to 16) - USER_CFG_FEAT_KEY_SIZE
 ************************************************************
 */
#define USER_CFG_FEAT_KEY_SIZE  KEY_LEN

/************************************************************
 * Device security requirements (@see gap_sec_req)
 *
 * - GAP_NO_SEC                 No security (no authentication and encryption)
 * - GAP_SEC1_NOAUTH_PAIR_ENC   Unauthenticated pairing with encryption
 * - GAP_SEC1_AUTH_PAIR_ENC     Authenticated pairing with encryption
 * - GAP_SEC1_SEC_PAIR_ENC      Authenticated LE Secure Connections pairing with encryption
 * - GAP_SEC2_NOAUTH_DATA_SGN   Unauthenticated pairing with data signing
 * - GAP_SEC2_AUTH_DATA_SGN     Authentication pairing with data signing
 *
 * Select only one option.
 ************************************************************
 */
#define USER_CFG_FEAT_SEC_REQ   GAP_SEC1_SEC_PAIR_ENC

/**************************************************************************************
 * Initiator key distribution (@see gap_kdist)
 *
 * - GAP_KDIST_NONE             No Keys to distribute
 * - GAP_KDIST_ENCKEY           LTK (Encryption key) in distribution
 * - GAP_KDIST_IDKEY            IRK (ID key)in distribution
 * - GAP_KDIST_SIGNKEY          CSRK (Signature key) in distribution
 *
 * Any combination of the above
 **************************************************************************************
 */
#define USER_CFG_FEAT_INIT_KDIST (GAP_KDIST_ENCKEY | GAP_KDIST_IDKEY | GAP_KDIST_SIGNKEY)

/**************************************************************************************
 * Responder key distribution (@see gap_kdist)
 *
 * - GAP_KDIST_NONE             No Keys to distribute
 * - GAP_KDIST_ENCKEY           LTK (Encryption key) in distribution
 * - GAP_KDIST_IDKEY            IRK (ID key)in distribution
 * - GAP_KDIST_SIGNKEY          CSRK (Signature key) in distribution
 *
 * Any combination of the above
 **************************************************************************************
 */
#define USER_CFG_FEAT_RESP_KDIST (GAP_KDIST_ENCKEY | GAP_KDIST_IDKEY | GAP_KDIST_SIGNKEY)

/*
 ****************************************************************************************
 *
 * Default handlers configuration (applies only for @app_default_handlers.c)
 *
 ****************************************************************************************
 */
static const struct default_handlers_configuration  user_default_hnd_conf = {
    // Configure the advertise operation used by the default handlers
    // Possible values:
    //  - DEF_ADV_FOREVER
    //  - DEF_ADV_WITH_TIMEOUT
    .adv_scenario = DEF_ADV_FOREVER,

    // Configure the advertise period in case of DEF_ADV_WITH_TIMEOUT.
    // It is measured in timer units (3 min). Use MS_TO_TIMERUNITS macro to convert
    // from milliseconds (ms) to timer units.
    .advertise_period = MS_TO_TIMERUNITS(180000),

    // Configure the security start operation of the default handlers
    // if the security is enabled (CFG_APP_SECURITY)
    // Possible values:
    //  - DEF_SEC_REQ_NEVER
    //  - DEF_SEC_REQ_ON_CONNECT
    .security_request_scenario = DEF_SEC_REQ_ON_CONNECT
};

LE Secure Connections Configuration on DA14535 v2

C/C++
Go into the da14535_config_basic.h file and make sure you have the following macros defined
/****************************************************************************************************************/
/* Enables the BLE security functionality in TASK_APP. If not defined BLE security related code is compiled out.*/
/****************************************************************************************************************/
#define CFG_APP_SECURITY


/****************************************************************************************************************/
/* Select external memory device for data storage                                                               */
/* SPI FLASH  (#define CFG_SPI_FLASH_ENABLE)                                                                    */
/* I2C EEPROM (#define CFG_I2C_EEPROM_ENABLE)                                                                   */
/****************************************************************************************************************/
#define CFG_SPI_FLASH_ENABLE

/****************************************************************************************************************/
/* UART Console Print. If CFG_PRINTF is defined, serial interface logging mechanism will be enabled.            */
/* If CFG_PRINTF_UART2 is defined, then serial interface logging mechanism is implented using UART2, else UART1 */
/* will be used.                                                                                                */
/****************************************************************************************************************/
#define CFG_PRINTF
#ifdef CFG_PRINTF
    #define CFG_PRINTF_UART2
#endif

LE Secure Connections Configuration on DA14535 v3

C/C++
Go to the da14535_config_advanced.h file and make sure the following macros are defined
/****************************************************************************************************************/
/* Enables True Random Number Generator. A true random number, generated at system initialization, is used to   */
/* seed any random number generator (C standard library, ChaCha20, etc.).                                       */
/****************************************************************************************************************/
#define CFG_TRNG

/****************************************************************************************************************/
/* Secure connections support.                                                                                  */
/* If the secure connections mode is to be used the macro must be defined. The secure connections mode uses     */
/* private/public keys which have been created based on the Elliptic-curve Diffie-Hellman (ECDH) protocol.      */
/* Note for DA14585/586/531:                                                                                    */
/* If the macro is defined, the ECDH keys will be created only once after the system start-up. If the legacy    */
/* pairing is to be used, it is recommended to undefine the macro in order to gain faster start-up time and     */
/* reduce the RAM footprint.                                                                                    */
/* Note for DA14531-01, DA14535:                                                                                */
/* The ECDH keys are always created after a pairing request. If the legacy pairing is to be used, it is         */
/* recommended to undefine the macro in order to reduce the RAM footprint.                                      */
/****************************************************************************************************************/
#define CFG_ENABLE_SMP_SECURE

/****************************************************************************************************************/
/* Uses ChaCha20 random number generator instead of the C standard library random number generator.             */
/****************************************************************************************************************/
#define CFG_USE_CHACHA20_RAND

LE Secure Connections Configuration on DA14535 v4

C/C++
On the user_profiles_config.h file make sure to set the APP_CUSTS1_SEC_REQ definition to SRV_PERM_SECURE. With this change, all the central devices that have not established LE Secure Connections with our DA14535 Peripheral device will not be able to access the Services and Characteristics.
/************************************************************
 * CUSTS1 security requirements (@see app_prf_srv_perm)
 *
 * - SRV_PERM_DISABLE       Disable access
 * - SRV_PERM_ENABLE        Enable access
 * - SRV_PERM_UNAUTH        Access Requires Unauthenticated link
 * - SRV_PERM_AUTH          Access Requires Authenticated link
 * - SRV_PERM_SECURE        Access Requires Authenticated Secure Connection Pairing
 *
 * Select only one option.
 ************************************************************
 */
#define APP_CUSTS1_SEC_REQ  SRV_PERM_SECURE

Credits

Wireless Embedded
2 projects β€’ 1 follower
Firmware Engineer. Enthusiast for Wireless Connectivity on Embedded Projects. BLE/ Wi-Fi

Comments