4. Initial Project

Starting Point

In this tutorial, we’ll kick off our exploration using the SDK6 with a sample project known as empty_peripheral_template. This project will serve as our launchpad, providing a solid foundation to delve into the intricacies of SDK6 and its capabilities.

Let’s get started by following these steps:
  • Navigate to the directory where you’ve downloaded and extracted SDK6.

  • Locate and open the project file named empty_peripheral_template.uvprojx. You can find this project within the directory path: ...\projects\target_apps\template\empty_peripheral_template\Keil_5

  • Upon opening the project file, Keil µVision will launch, providing access to the empty_peripheral_template project for further exploration.”

SDK6 & User files

The project window is organized with folders that facilitate easy differentiation between user files and SDK files, as indicated by the naming convention: user_xxx for user files and sdk_xxx for SDK files.

4.1. User configuration modules

There are 4 user folders (expanded in the screen shot below). We will be doing all of our work within files from just 3 of these 4 user folders:
  1. The custom profile folder, user_custom_profile contains two modules for creating BLE custum profiles.

  2. The hardware setup folder, user_platform

  3. The user application folder, user_app

  4. The configuration folder, user_config. If you open this folder you can see 7 header files, here we explain briefly each one:

    • da1458x_config_advanced.h includes specific configuration files (…_config_advanced.h based on the target device.You can find these files are located in da14535_config , da14531_config or da14585-6_config folders considering the build target.

      The C header file which are in these folders configures various parameters for the DA1453x/DA1458x devices, including sleep durations , BLE settings, and memory configurations. It allows developers to customize the behavior of their applications by adjusting these parameters.

    • da1458x_config_basic.h is exactly similar to the advanced config file in shape. This C header file (.._config_basic.h) configures basic settings for the DA1453x/DA1458x device, including processor mode (integrated or external), BLE security, WatchDog timer, maximum concurrent connections, development/debug mode, and UART console print. It provides flexibility in selecting options such as external memory type, DMA support for various interfaces, and fixed power mode. The file is crucial for tailoring fundamental parameters in DA1453x/DA1458x application development.

    • user_callback_config.h defines callback functions and configurations for a Bluetooth Low Energy (BLE) application on the Renesas DA1453x/DA1458x platform. It includes function declarations for events such as advertising completion and SUOTAR (Software Update Over The Air) status changes. Additionally, it provides callback structures for Battery Service (BASS), Find Me Target (FINDT), Proximity Reporter (PROXR), and SUOTAR, as well as general application callbacks.

    • user_config.h for user-specific settings: privacy/addressing, sleep mode, advertising, device name, GAPM, connection parameters, default handlers, and security configurations.

    • user_modules_config.h defines module inclusion/exclusion for a Renesas DA1453x/DA1458x BLE application. Modules include GAP, Timer, Message, Security, DIS Service, Proximity Reporter, Battery Service, Find Me Locator/Target, SUOTAR, and two custom services.

    • user_periph_setup.h configure peripherals (UART,SPI,ADC,I2C,GPIO pin configurations)

    • user_profiles_config.h is a configuration file for BLE profiles used in a Renesas application. It defines configurations for the Device Information Service (DISS) profile, including features, manufacturer information, model number, system ID, and more.

_images/keil_project_window.png

Figure 9 The project structure of empty_peripheral_template

4.2. Preparing the Project

Before we can build the project, we need to select the applicable SmartBond™ device. Use the drop-down menu to select the SmartBond™ device you are using (DA14585, DA14586 or DA1453x) as shown below:
_images/keil_soc_selection.png

Figure 10 SmartBond™ device selection. This will change according to your desired target

Before we start modifying the project, we will build it and load it onto the development kit to see what the project does:
  • Build the empty_peripheral_template project (Project->Build Target or F7)

  • Start the debugger (Debug->Start/Stop Debug Session or Ctrl+F5)

  • To start the project either run it (Debug->Run or F5) or immediately stop the debugger (Debug->Start/Stop Debug Session or Ctrl+F5)

  • The empty_peripheral_template project should now be running on the target (DA1453x or DA1458x)

  • Using the Bluetooth® Explorer tool (i.e. the SmartBond app or the Chrome tool) you should be able to see the advertisement as DIALOG-TMPL when you scan for the devices.

_images/smartbond-app-dialog-tmpl.jpg

Figure 11 Screen shot (from iOS version) of the SmartBond app. The device name shows DIALOG-TMPL

If you managed to do the steps above without any issues, it means your hardware and tools are good to go. Now, let’s jump in and Play with the project!