Welcome to your introduction to Bluetooth Low Energy (BLE) development using the Renesas DA14535 β a compact, cost-effective, and ultra-low-power BLE SoC. In this guide, youβll learn how to configure and enhance a BLE peripheral using the latest DA145xx SDK v6.0.24.
We will base our work on the ble_app_security
example, provided as part of the SDK. This project offers a solid foundation for working with BLE pairing, security modes, connection handling, and more.
Using the ble_app_security
example, you will:
- Modify the device name shown in BLE advertisements
- Adjust the advertising interval for power vs. performance
- Enable Extended Sleep Mode to minimize current consumption
- Configure LE Secure Connections (LESC) for secure pairing
- Print debug messages via UART for development feedback
- Control GPIO P0_9 as an LED indicator for connection status
We will be working directly with the ble_app_security
project included in the SDK under:
projects/target_apps/ble_examples/ble_app_security/
This example demonstrates key BLE features such as pairing, bonding, and encryption, making it the ideal starting point for adding customizations like UART debug, GPIO indicators, and advanced power management.
When you have opened your project, set the target for DA14535:
All the modification must be made inside the user folders:
Update the advertised device name to make your board easily identifiable during BLE scans. This will make your device show up with a custom name on central devices such as smartphones or tablets.Open user_config.h file and search for the USER_DEVICE_NAME macro.
Change the Device Name to anything you like up to 32 bytes.
πΆ Step 2: Adjust the Advertising IntervalTuning the advertising interval allows you to balance between fast device discovery and low power consumption. Youβll set both the minimum and maximum advertising intervals to your preferred timing (e.g., 100ms or 500ms).On the same file user_config.h search for the Advertising Configuration struct and change the intv_min and intv_max to MS_TO_BLESLOTS(100) for 100ms Advertising Interval.
Activate Extended Sleep Mode to dramatically reduce current draw. In this mode, all peripheral blocks β including UART and GPIOs β are shut down between BLE events. The DA14535 wakes periodically (e.g., at each advertising interval), broadcasts, and then goes back to sleep.
As of 2025, the DA14535 boasts industry-leading current consumption in this mode, making it perfect for battery-powered BLE applications.
On the same file user_config.h set the app_default_sleep_mode variable to ARCH_EXT_SLEEP_ON.
The ble_app_security
example already includes basic pairing logic. Youβll enhance it by enforcing LE Secure Connections, which improves security via authenticated key exchanges. You can also define the I/O capabilities to match your systemβs user interface.
We will follow Renesas Tutorial on 7. Securing your application using Secure Connections β DA1453x&DA1458x Tutorial BLE securityRefer on the code attachments for all the modifications or on the Security Tutorial by Renesas.
π§ͺ Step 5: Add Debug Output via UARTTo assist with development, youβll enable UART output so the device can send debug messages. Messages such as "Device initialized", "Connected", and "Disconnected" will appear in your terminal window, helping with validation and troubleshooting.
Make sure that CFG_PRINTF macro is defined on the da14535_config_basic.h file
Whenever you want to add Debug messages, make sure you have included the arch_console.h file
We can now add debug messages anywhere we want. We can use the following API to print our messages on the Terminal:
/**
****************************************************************************************
* @brief Place the formatted output into the UART queue.
* @param[in] fmt Formatted output
* @return 1
****************************************************************************************
*/
int arch_printf(const char *fmt, ...);
There are already multiple debug messages inside the SDK projects, so you can search for this API to see the correct format to print out values.
π‘ Step 6: Use GPIO (P0_9) as a Connection IndicatorYouβll configure GPIO P0_9 as an output connected to an LED.
The LED will turn ON when connected to a central device.
- The LED will turn ON when connected to a central device. We will handle this on the connection callback inside the SDK6.
The LED will turn OFF when disconnected.
- The LED will turn OFF when disconnected. We will handle this on the disconnect callback inside the SDK6.
This provides immediate visual feedback on the deviceβs BLE status, especially useful in headless or display-less systems.
Follow this tutorial: 7. General Purpose Output β DA145XX Tutorial SDK Getting startedGo into user_periph_setup.h file and define P0_9 as our LED_PINGo into user_periph_setup.c file and Reserve the P0_9 GPIO inside the GPIO_reservations function.
On the same file, configure P0_9 as an LED on the set_pad_functions
Open user_callback_config.h file and locate the custom callbacks that are going to be executed during Connection/Disconnection:
Find them on user_security.c fileAt the start of the file make sure you have included gpio.h file in order to use the GPIO_SetActive and GPIO_SetInactive APIs. And declare the state_led bool variable in the retention RAM so we can maintain the value while in Extended Sleep mode.
On the user_app_connection custom callback function add the following lines of code:
GPIO_SetActive(LED_PORT,LED_PIN);
state_led = true;
On the user_on_disconnect custom callback function add the following line of code:
GPIO_SetInactive(LED_PORT,LED_PIN);
state_led = false;
Go on the user_periph_setup.c file. Extern the state_led variable.Add the following code snippet at the end of periph_init function.The DA14535 will sleep between the advertising intervals. In order to keep the LED active we need to also configure it on periph_init function which will be executed every time we wake-up to handle BLE events.
if(state_led == true)
GPIO_SetActive(LED_PORT,LED_PIN);
else
GPIO_SetInactive(LED_PORT,LED_PIN);
β
SummaryUsing the ble_app_security
project from SDK v6.0.24, youβve now:
- Personalized the BLE device name
- Fine-tuned advertising behavior
- Enabled low-power Extended Sleep mode
- Secured connections with LESC
- Implemented simple UART debug output
- Added a GPIO-based connection indicator
This combination provides a robust BLE starting point optimized for security, power efficiency, and real-world debugging.
π Resources
Comments