REN UM-WI-052 DA16600 FreeRTOS Example Application Manual 1v5 MAS 20230822
REN UM-WI-052 DA16600 FreeRTOS Example Application Manual 1v5 MAS 20230822
Abstract
This document describes the freeRTOS based DA16600 SDK example applications using the
DA16600 module, which includes DA16200 and DA14531.
UM-WI-052
DA16600 FreeRTOS Example Application Manual
Contents
Abstract ................................................................................................................................................ 1
Contents ............................................................................................................................................... 2
Figures .................................................................................................................................................. 4
Tables ................................................................................................................................................... 5
1 Terms and Definitions ................................................................................................................... 6
2 References ..................................................................................................................................... 7
3 Introduction.................................................................................................................................... 8
3.1 DA16600 Module Evaluation Board ...................................................................................... 8
3.2 Bluetooth® LE Assisted Wi-Fi Provisioning Example ............................................................ 8
3.3 Bluetooth® LE Firmware OTA Download via Wi-Fi Example ................................................ 8
3.4 Gas Leak Detection Sensor Example (Bluetooth® LE Peripheral) ....................................... 9
3.5 TCP Client in DPM Example (Bluetooth® LE Peripheral)................................................... 10
3.6 Peripherals in DA14531 Driver Example (Bluetooth® LE Peripheral) ................................ 10
3.7 IoT Sensor Gateway Example (Bluetooth® LE Central) ..................................................... 11
4 Environment Setup ..................................................................................................................... 12
4.1 SFLASH Memory Map ........................................................................................................ 12
4.2 Build the DA16200 Software ............................................................................................... 13
4.2.1 Gas Leak Detection Sensor Example Feature .................................................... 13
4.2.1.1 How to Add Security Feature ........................................................... 13
4.2.2 TCP Client in DPM Example Feature .................................................................. 13
4.2.3 Peripherals in DA14531 Driver Example Feature ............................................... 13
4.2.4 IoT Sensor Gateway Example Feature ............................................................... 14
4.2.5 Build the SDK in the Eclipse IDE ......................................................................... 14
4.3 Build DA14531 Software ..................................................................................................... 14
4.3.1 DA14531 Peripheral Role Project ........................................................................ 15
4.3.2 DA14531 Central Role Project ............................................................................ 15
4.3.3 Install Keil ............................................................................................................ 15
4.3.4 Build Project ......................................................................................................... 15
4.3.4.1 Peripheral Role Image ..................................................................... 15
4.3.4.2 Central Role Image .......................................................................... 16
4.4 Firmware Image Update...................................................................................................... 16
4.4.1 Firmware Update with *.ttl File ............................................................................. 16
4.4.2 Firmware Update Without .ttl File ........................................................................ 18
4.5 Run DA16600 with JTAG .................................................................................................... 20
4.5.1 Run DA16200 with JTAG..................................................................................... 20
4.5.2 Run DA14531 with JTAG..................................................................................... 20
4.6 Test Environment Setup...................................................................................................... 24
4.6.1 Wi-Fi Access Point ............................................................................................... 24
4.6.2 Bluetooth® LE Peers ............................................................................................ 24
4.6.2.1 Bluetooth® LE Mobile App ................................................................ 24
4.6.2.2 Bluetooth® LE Sensors..................................................................... 24
4.6.3 PC to Control Bluetooth® LE Peers and DA16600 Boards .................................. 24
4.6.4 DA16600 Detailed Examples ............................................................................... 25
4.6.4.1 Gas Leak Detection Sensor Example .............................................. 25
Figures
Figure 1: Bluetooth® LE Assisted Wi-Fi Provisioning ............................................................................ 8
Figure 2: Standalone Gas Leak Detection Sensor ................................................................................ 9
Figure 3: DA16600 TCP Client in DPM ............................................................................................... 10
Figure 4: DA14531 Peripheral Device Control .................................................................................... 10
Figure 5: IoT Sensor Gateway............................................................................................................. 11
Figure 6: Project View ......................................................................................................................... 14
Figure 7: Keil – Build ........................................................................................................................... 15
Figure 8: DA16600 Images and .ttl Files to Program .......................................................................... 17
Figure 9: Steps to Program by .ttl File ................................................................................................. 18
Figure 10: Tera Term ........................................................................................................................... 19
Figure 11: Keil – Option ....................................................................................................................... 20
Figure 12: Keil – Debug ....................................................................................................................... 21
Figure 13: Keil – JTAG Device ............................................................................................................ 22
Figure 14: Tera Term – DA16200 Waiting for DA14531 to Connect .................................................. 22
Figure 15: Keil – Start Debugger ......................................................................................................... 23
Figure 16: Keil – Evaluation Mode Dialog Box .................................................................................... 23
Figure 17: Keil – Run ........................................................................................................................... 23
Figure 18: DA16600 Source Structure in Eclipse Project ................................................................... 26
Figure 19: Renesas Wi-Fi Provisioning App ........................................................................................ 30
Figure 20: GTL Message Sequence Chart – Initialization................................................................... 31
Figure 21: GTL Message Sequence Chart – Connect and Write........................................................ 32
Figure 22: GTL Message Sequence Chart – Read ............................................................................. 32
Figure 23: Provisioning Application – Custom Command ................................................................... 35
Figure 24: TCP Client in DPM Sleep ................................................................................................... 39
Figure 25: TCP Client – Wakeup from DPM Sleep ............................................................................. 40
Figure 26: DA16600 EVB SW Config. 1 .............................................................................................. 41
Figure 27: DA16600 EVB SW Config. 2 .............................................................................................. 42
Figure 28: Peri Blinky .......................................................................................................................... 43
Figure 29: Peri Systick ......................................................................................................................... 44
Figure 30: Peri Timer0_gen ................................................................................................................. 45
Figure 31: Peri Timer0_buz 1/2 ........................................................................................................... 45
Figure 32: Peri Timer0_buz 2/2 ........................................................................................................... 46
Figure 33: Peri Timer2_pwm ............................................................................................................... 46
Figure 34: Peri Batt_lvl ........................................................................................................................ 47
Figure 35: Peri I2c_eeprom ................................................................................................................. 47
Figure 36: Peri I2c_eeprom Read/Write .............................................................................................. 48
Figure 37: Peri Spi_flash – Wrong Image Warning ............................................................................. 48
Figure 38: Correct Image Version for Peri Spi_flash Sample ............................................................. 49
Figure 39: Peri Spi_flash ..................................................................................................................... 49
Figure 40: Peri Spi_flash Read/Write .................................................................................................. 49
Figure 41: Peri GPIO Configuration .................................................................................................... 50
Figure 42: GTL Message Sequence Chart – Initialization................................................................... 55
Figure 43: GTL Message Sequence Chart – Provisioning Mode ........................................................ 56
Figure 44: GTL Message Sequence Chart – Scan and Connect ........................................................ 58
Figure 45: GTL Message Sequence Chart – Enable Sensor Posting ................................................. 58
Figure 46: GTL Message Sequence Chart – Disable Sensor Posting ................................................ 58
Figure 47: Reset Pin Connection on the EVB ..................................................................................... 61
User Manual Revision 1.6 Aug. 18, 2023
Tables
Table 1: Application Functions ............................................................................................................ 26
Table 2: Major Console Commands .................................................................................................... 27
2 References
[1] UM-WI-046, D16200 DA16600, FreeRTOS SDK Programmer Guide, User Manual, Renesas
Electronics
[2] UM-B-143, Dialog External Processor Interface, Renesas Electronics
[3] DA14531 Getting Started Guide, Renesas Electronics
[4] DA14531 SW Platform Reference, Renesas Electronics
[5] UM-WI-056, DA16200 DA16600, FreeRTOS Getting Started Guide, Renesas Electronics
[6] UM-WI-042, DA16200 DA16600, Provisioning Mobile App, User Manual, Renesas Electronics
[7] UM-B-117, DA14531 Getting Started with the Pro Development Kit, Renesas Electronics
3 Introduction
The Renesas DA16600 module is comprised of the DA16200 (Wi-Fi) and the DA14531 (Bluetooth®
LE) SoC. The two chips exchange the data with each other through the GTL interface. This
document describes the test steps and code walkthrough of four example applications with DA16600.
NOTE
Three connections are available with DA16600.
4 Environment Setup
The DA16600 module consists of two SoC chips – DA16200 and DA14531. The firmware images of
the two chips are stored in the SPI flash memory of the DA16600 module. The flash memory is only
accessible by DA16200 and not accessible by DA14531 directly. This means that the firmware image
for DA14531 must be written into flash and then at runtime, the DA16200 reads it and transfers it
to DA14531.
The list of firmware images required to run each SoC chip is as follows:
DA16200: Wi-Fi chip
● Two image files:
○ FBOOT image: secondary bootloader
○ FRTOS image: main operation software into which user applications are built
● Code storage memory
○ SFLASH of DA16200
DA14531: Bluetooth® LE chip
● Single image file:
○ Main image: main operation software into which user applications are built
● Code storage memory
○ SFLASH of DA16200 or DA14531 OTP memory (32 kB allocated for OTP image)
– OTP memory can be used to burn a default image but since OTP can only be written once,
the firmware cannot be updated. If an OTA firmware update is required, then the SFLASH
of the DA16200 should be used to store the DA14531 firmware
...
/*
* 0x003A_D000 BLE Area 0x10000 ~ 0x15000 ( 64 KB MIN ~ 84 KB MAX)
* BLE Firmware Size Max 0x10000 ~ 0x14000 ( 64 KB MIN ~ 80 KB MAX)
* BLE Security DB 0x00000 ~ 0x01000 ( 00 KB MIN ~ 04 KB MAX)
…
*/
…
#define SFLASH_14531_BLE_AREA_START
(SFLASH_NVRAM_BACKUP + SFLASH_NVRAM_BACKUP - SFLASH_NVRAM_ADDR) // 0x003AD000
Two image banks are defined in the SFLASH memory map for storing firmware, one for the DA16200
image and one for the DA14531 image. For more details, see Section 2.3.2 of Ref. [1].
The following sections describe how to build the firmware for the DA16200 and the DA14531 based
on the memory map above.
#define __WIFI_SVC_SECURITY__
NOTE
There are two pairing modes in Bluetooth pairing mechanism and they depend on the test mobile phone's
Bluetooth® authentication capability configuration:
● Legacy Pairing: the mobile application may show an input box and ask a user to enter a passkey that
can be found on the display of the DA16600 HW, and then a user needs to enter the exact passkey on the
test smartphone to successfully connect to the DA16600
● Secure Connection Pairing (SC Pairing): the mobile application may show a PIN code on the test mobile
and ask a user to compare the PIN code with the one printed on the display of the DA16600 HW. If the
PIN code match, click the OK button to connect the DA16600 to test the mobile application
The DA16600 example currently can save bond information for up to ten Bluetooth® LE peers.
Once the bond information is stored in the test mobile phone, the test mobile phone's Bluetooth® LE peer
application can be connected to the DA16600 without the need to repeat the pairing process. If either party
lost the pairing credentials, the pairing process starts again when trying to reconnect.
#undef __BLE_PERI_WIFI_SVC_TCP_DPM__
#define __BLE_PERI_WIFI_SVC_PERIPHERAL__
#undef __BLE_CENT_SENSOR_GW__
To build the SDK based on FreeRTOS, right-click the da16600 folder in the project explorer panel,
and then select Build project in the list. After the build is complete, the following two DA16200
images can be found in the
[DA16600_SDK_ROOT]\apps\da16600\get_started\projects\da16600\img\ folder:
● DA16600_FRTOS-*.img
● DA16600_FBOOT-*.img
NOTE
The Keil IDE download URL is https://www.keil.com/download/product/.
And based on the bin file, following *.img files are generated as well for SFLASH image update in
[DA14531_SDK_ROOT]\projects\target_apps\ble_examples\prox_reporter_sensor_ext_coex\Keil_5\
out_img\
● da14531_multi_part_proxr.img: for SFLASH image update.
● pxr_sr_coex_ext_***_ota.img: for image update by OTA.
● DA16600_FRTOS-*.img
● da14531_multi_part_proxr.img in DA14531_1
● da14531_multi_part_proxm.img in DA14531_2
The download (to serial flash) of the selected image file takes time.
4. Similar to step 3, type loady 23000 1000, press Enter, and then select DA16600_FRTOS-*.img.
This ymodem transfer takes the longest time to complete.
5. Similar to step 3, type loady 3ad000 1000 bin, press Enter, and then select
da14531_multi_part_proxr.img or da14531_multi_part_proxm.img.
NOTE
When a user wants to download only one image file (RTOS or da14531), Renesas strongly recommend to
download the FBOOT image first (loady boot) and then either loady 23000 for RTOS or loady 3ad000 1000 bin
for da14531.
6. After all images are transferred to SFLASH, type boot, and then press Enter.
Some debug messages are printed in Tera Term.
7. Press Enter several times until the prompt [/DA16600] # shows.
IMPORTANT
Switch off and switch on the USB port (if a user USB hub has a power switch per port, then toggle it) or
remove the USB cable completely and then put it back in. This is needed to change the DA14531 to
Bootloader mode and wait to get an image from the DA16600.
8. Wait until the Tera Term is connected to COMxx (for example, COM34). (Or simply reconnect
with serial. This step is not needed if Tera Term is not used during the test.)
NOTE
Once Tera Term is connected, type reboot in the Tera Term console to check early boot messages.
NOTE
The default DA16200 software loads and transfers a DA14531 image to DA14531 at boot. Disable this
Bluetooth® LE image transfer feature before starting the procedure.
1. Build the DA16600 SDK with __DA14531_BOOT_FROM_UART__ disabled (see
[DA16600_SDK_ROOT]\apps\da16600\get_started\include\apps\ble_combo_features.h), and program
SFLASH with the three DA16200 images (FBOOT and FRTOS). The DA14531 image does not
need to be programmed.
2. Make sure DA16600 EVB's DIP switch configuration (SW7 and SW3 in Figure 2 in Ref. [5]) looks
like Figure 26.
3. Connect a USB cable to the CN6 USB Port (DA14531 JTAG Port) of the DA16600 EVB. See
Figure 2 in Ref. [5].
4. Connect a USB cable to the CN1 USB Port (of Figure 2 in Ref. [5]) of the DA16600 EVB for a
Tera Term connection.
5. Switch ON (in a USB hub) the two USB cable connections.
6. Run the Keil IDE and open a DA14531 project.
8. Select the Debug tab and click Settings. See Figure 12.
9. Make sure that the fields SN and SWD have valid values. See Figure 13.
NOTE
If there is no valid value for SN or SWD, then this means that the JTAG/JLINK firmware does not exist or is
not enabled in the JTAG chip of the DA16600, or the JTAG is not working for some reason.
In this case, contact Renesas Electronics to update the JTAG firmware on the DA16600 EVB.
10. If the DA14531 JTAG is successfully recognized, click OK.
11. Switch OFF the power to the two USB cables.
12. Switch ON the power to the two USB cables.
13. In Tera Term (to which the lower number COM port is connected), make sure that the DA16200
boots successfully. If successful, the following messages are shown as in Figure 14.
15. After the build is done, click the Start Debugger button. See Figure 15.
If a user sees the message as shown in Tera Term, then the DA14531 is successfully started.
Now the DA16600 starts Bluetooth® LE advertising and can allow a Bluetooth® LE peer to connect
to DA16600.
NOTE
A user can also download (from App Store) and use a general-purpose Bluetooth® LE mobile application that
supports a GATT Client (that can read/write a GATT characteristic of a GATT Server). If a user understands
the Wi-Fi SVC GATT Server database structure and JSON application protocols (see Section 6.1.5), a user
can use a general Bluetooth® LE Mobile App as well to send a command.
Item Description
system_start Entry point for customer main
the local APIs of the DA14531. See Section 2 of Ref. [4]. Software Platform Overview, or the API
documentation included in the DA14531 SDK.
To develop a function that talks to a networked TCP/UDP peer (for example, can talk to RBP3's UDP
Server Application), the application should be developed based on Ref. [1].
}
○ "network_info” command: provide the network information necessary during the provisioning.
(Mobile host application DA16600)
{
"dialog_cmd":"network_info",
"ping_addr":"8.8.8.8",
"svr_addr":"172.16.0.100",
"svr_port":10195,
"svr_url":"www.google.com"
}
○ "select_ap" command: select the AP in the AP list received by the scan command. (Mobile
host application DA16600), The DA16600 device will try to connect to the selected AP with
the information after the command, upon receipt of this command, the DA16600 stores the
credentials in permanent storage (NVRAM) and reboots
{
"dialog_cmd":"select_ap",
"SSID":"linksys",
"security_type":3,
"password":"123456789",
"isHidden":0
}
○ "fw_update" command: download new firmware from a specified OTA server, (Mobile host
application DA16600)
{
"dialog_cmd":"fw_update"
}
○ "factory_reset" command: remove the Wi-Fi network profile saved in the DA16600 EVB, the
EVB will reboot after the reset. (Mobile host application DA16600)
{
"dialog_cmd":"factory_reset"
}
○ "reboot" command: reboot the DA16600 device. DA16600 tries to connect to the selected AP
after rebooted if the provisioning is completed before (Mobile host application DA16600)
{
"dialog_cmd":"reboot"
}
○ "wifi_status" command: check the Wi-Fi connection status (connected or disconnected). The
Bluetooth® LE peer can be notified of or read, the status via the "Wi-Fi Action Result"
characteristic (DA16600 Mobile host application)
{
"dialog_cmd":"wifi_status"
}
○ "disconnect" command: disconnect a Wi-Fi connection from the connected AP. If the user
sends the command "reboot", then it can reconnect to the connected AP before. (Mobile host
application DA16600)
{
"dialog_cmd":"disconnect"
}
○ If a user wants to add a new custom command, use the following:
enum WIFI_CMD > define a new custom command
> user_custom_profile_wfsvc_write_cmd_ind_xxx( ): add the handler of the command
> wifi_conf_parse_json : add the parser of the command
● Characteristic: "Wi-Fi Action Result" (two bytes), READ, NOTIFY
User Manual Revision 1.6 Aug. 18, 2023
[/DA16600] # nvram
[/DA16600/NVRAM] # getenv
...
URI_BLE (STR,53) .........
http://192.168.0.230/pxr_sr_coex_ext_531_6_0_14_1114_1_ota.img
6. In the Bluetooth® LE Mobile App (ex, mobile phone), send the FW update command.
a. Bluetooth® LE Mobile Application > Start DA16600-based > Start > Connect to "DA16600-
BLE" > Custom command (see Figure 23), type the command
{"dialog_cmd":"fw_update"} and click Send.
b. To enter the command easily, open a notepad on the smartphone to type the command, and
then copy and paste the command on the Bluetooth® LE Mobile Application.
7. When the command "fw_update" is reached to the DA16600, it tries to connect to an OTA server
(192.168.0.230) to download a Bluetooth® LE firmware file. This log shows some details for the
steps.
[/DA16600/NVRAM] #
<<< GAPC_CONNECTION_REQ_IND
...
<<< GATTC_WRITE_REQ_IND
Receive - FW_UPDATE
COMBO_WIFI_CMD_FW_BLE_DOWNLOAD received
[ota_fw_update_combo] uri_rtos =
[ota_fw_update_combo] uri_ble =
http://192.168.0.230/pxr_sr_coex_ext_531_6_0_14_1114_1_ota.img
[BLE_OTA] New FW: ver = v_6.0.14.1114.3, timestamp = 1587376260
[BLE_OTA] bank_1 (act): ver = v_6.0.14.1114.2, timestamp = 1588134660
[BLE_OTA] bank_2 : ver = v_6.0.14.1114.1, timestamp = 1588134660
...
>> HTTP(s) Client Downloading... 100 %(17232/17232 Bytes)
...
- OTA Update : <BLE_FW> Download - Success
For Option 2, a Bluetooth® LE Peer App should 'write' the following command on the characteristic
"Wi-Fi CMD" to trigger an OTA FW update:
{
"dialog_cmd":"fw_update"
}
Upon receipt of the command, GATTC_WRITE_REQ_IND is sent to the DA14531 and DA16200, and
then a handler is invoked, refer to the following steps:
● Host Bluetooth® LE application (Mobile phone) ‘fw_update’ command
> DA16600 receives the command and call the following functions
> HandleBleMsg (bType = GATTC_WRITE_REQ_IND)
> gattc_write_req_ind_hnd()
> user_custom_profile_wfsvc_write_cmd_ind_xxx()
> wifi_conf_parse_json()
> ota_fw_update_combo()
> ota_update_start_download()
> ota_update_http_client_update_proc(): handles http connection, http download,
and firmware renewing process
NOTE
The connection with a Bluetooth® LE Peer is not required in the Gas Leak Detection Sensor application.
6.3.3 Workflow
The gas leak detection example starts by typing the command – ble.iot_sensor start in console. the
following function is invoked after the command:
● [/DA16600] # ble.iot_sensor start >
> ConsoleSendSensorStart()
> ConsoleEvent_handler(CONSOLE_IOT_SENSOR_START or STOP)
> app_sensor_start() or app_sensor_stop()
> BleMsgAlloc(APP_GAS_LEAK_SENSOR_START, TASK_ID_EXT_HOST_BLE_AUX, TASK_ID_GTL, 0);
● The message " APP_GAS_LEAK_SENSOR_START" is sent to Bluetooth® LE(DA14531) which
starts the sensor reading task (periodically reads a gas-leak sensor)
In the DA14531, to exchange messages or commands to an external host (DA16200), the following
code should be implemented on both Wi-Fi and Bluetooth® LE SDKs:
● For both DA16200 SDK and DA14531 SDK, define custom messages:
a. DA16600 SDK: send a custom user-defined message via the GTL interface with
TASK_ID_EXT_HOST_BLE_AUX as the destination task.
b. DA14531 SDK: enable the DA14531 AUX task (TASK_ID_EXT_HOST_BLE_AUX) to receive
user-defined custom messages.
c. The same ext_host_ble_aux_task_msg_t should be defined on both the app.h (in DA16600 SDK)
and the ext_host_ble_aux_task.h (in DA14531 SDK).
typedef enum {
...
APP_GAS_LEAK_SENSOR_START,
APP_GAS_LEAK_SENSOR_START_CFM,
APP_GAS_LEAK_SENSOR_STOP,
APP_GAS_LEAK_SENSOR_STOP_CFM,
APP_GAS_LEAK_EVT_IND,
APP_GAS_LEAK_SENSOR_RD_TIMER_ID,
...
APP_CUSTOM_COMMANDS_LAST,
} ext_host_ble_aux_task_msg_t;
● Regarding the message handlers in the DA14531 SDK/ext_host_ble_aux_task.c:
○ DA16600/BleMsgAlloc(APP_GAS_LEAK_SENSOR_START)
> DA14531/ext_host_ble_aux_task_handler (APP_GAS_LEAK_SENSOR_START)
> DA14531/app_gas_leak_sensor_start_cfm_send with APP_GAS_LEAK_SENSOR_START_CFM
DA16200
When the gas leak sensor starts, the DA16600 enters Sleep mode. Later, if a gas leak event occurs,
the DA14531 wakes up DA16200, and then sends a message to a server and enters Sleep mode
again.
● system_start() > sleep2_monitor_start()
● gtl_init() > sleep2_monitor_regi()
● app_sensor_event_ind_hnd()
● > sleep2_monitor_set_state(SLEEP2_CLR)
● > set iot_sensor_data_info.is_gas_leak_happened = TRUE
● udp_client(): send the warning message to server when gas leak occurred and tell
sleep2_monitor to enter sleep
6.4.3 Workflow
TCP Client thread which uses DPM manage – tcp_client_dpm_sample is run when network is alive.
User callbacks for TCP events are registered in tcp_client_dpm_sample_init_user_config() including
tcp_client_dpm_sample_recv_callback(). In the receive callback, once a user receives and processes data,
then calls the dpm_mng_job_done().
● tcp_client_dpm_sample()
> tcp_client_dpm_sample_init_user_config(): Callback functions are registered
> tcp_client_dpm_sample_recv_callback(): called when received the packet, process the data
> dpm_mng_job_done()
The TCP Client application is a network application, and the Provisioning application is a
Bluetooth® LE application. Both applications should register to the DPM subsystem that coordinates
how these two applications enter DPM Sleep.
● gtl_init() > dpm_app_register(): register to DPM sub-system
● gapc_connection_req_ind_handler()
> dpm_app_sleep_ready_clear(): if a peer is connected (until disconnected), tell DPM sub-system to
hold entering sleep
> dpm_abnormal_chk_hold(): told DPM Abnormal Checker. DPM Abnormal Checker can force sleep
if network is disconnected, hold its operation until the job (Provisioning APP's job) is done
● gapc_disconnect_ind_handler()
> dpm_app_sleep_ready_set(): tell DPM sub-system to enter sleep as the peer is disconnected
> dpm_abnormal_chk_resume(): tell DPM Abnormal Checker to resume its work
Configuration_1
Configuration_2
4. After booting with a correct Bluetooth® LE test image, a user can find the version string printed at
boot as in Figure 38.
6.5.4 Workflow
This example application is not required for the Wi-Fi provisioning and controls the DA14531
peripherals (GPIOs) by sending commands in the DA16200 and each example to the DA14531 via
the GTL interface.
● Most types and definitions for GTL messages are defined in the app.h below
[DA16600_SDK_ROOT]\apps\da16600\get_started\src\ble_svc\include\app.h
● ext_host_ble_aux_task_msg_t must be exactly same as in both DA16600 and DA14531 SDK
● Timer buz console command flow in the DA16600, all test cases should have similar workflow
ble.peri timer0_buz start
> cmd_peri_sample()
> app_peri_timer0_buz_start_send()
> BleSendMsg()
● Timer buz console command flow in the DA14531
GTL > ext_host_ble_aux_task_handler (msgid = APP_PERI_TIMER0_BUZ_START)
> app_peri_timer0_buz_start_ind_send(): run a timer to start the sample action
and send back the GTL "APP_PERI_TIMER0_BUZ_START_IND" to DA16200 indicating
timer0_buz sample soon will start. On receipt of this message, DA16200 prints
that TIMER0_BUZ started
> ext_host_ble_aux_task_handler(): handles for the other commands as well
> app_peri_timer0_buz_run()
> pwm0_user_callback_function()
6. By typing ble and proxm_sensor_gw command below, the commands available in the example are
displayed as below log box.
[/DA16600/] # ble
[/DA16600/ble] # proxm_sensor_gw
...
proxm_sensor_gw [OPTION]
OPTION DESCRIPTION
scan
Scan BLE peers around
show_conn_dev
shows connected BLE peers with status
rd_rssi_conn_dev
read rssi for all connected devices
read_temp
read temperature sensor values from all connected devices
conn [1~9]
connect to a ble peer from the scan list
choose index from the scan list
peer [1~9] [A|B|...|Z]
take an action on a connected BLE peer
------------proxm cmd ----------------
A: Read Link Loss Alert Level
B: Read Tx Power Level
C: Start High Level Immediate Alert
D: Start Mild Level Immediate Alert
E: Stop Immediate Alert
F: Set Link Loss Alert Level to None
G: Set Link Loss Alert Level to Mild
H: Set Link Loss Alert Level to High
I: Show device info
------------custom cmd ----------------
J: Enable iot sensor's temperature posting
K: Disable iot sensor's temperature posting
------------common cmd ----------------
Z: Disconnect from the device
exit
all peers are disconnected
7. To connect the devices (NO 1 and 2) in the scan list, type these commands:
[/DA16600/ble] # proxm_sensor_gw conn 1
...
[/DA16600/ble] # proxm_sensor_gw conn 2
...
# No. Model No. BDA Bonded RSSI LLA TX_PL Temp
# * 1 iot_sensor b8:00:00:00:00:01 NO
# 2 iot_sensor b8:00:00:00:00:02 NO
# 3 -- Empty Slot --
8. To enable the notification from the peer device - the IoT sensor device, type the command in the
log box. Then the temperatures should be posted from the peer device to the gateway device.
[/DA16600/ble] # proxm_sensor_gw peer 1 J
...
NOTE
Depending on a user's RF signal environment, sensor_1 or sensor_2 may not easily get connected. In such a
case, run the scan again and try to connect.
9. Command "J" let sensor start temperature posting.
10. ssh_win_1 or mobile application: the temperature data will be posted to the server as follows:
...
root@raspberrypi:/home/pi# python udp_server.py
UDP Server: waiting for a messsage ... at 172.16.30.136:10954
...
>>> iot_sensor[1], temperature value = 33
>>> iot_sensor[2], temperature value = 11
>>> iot_sensor[1], temperature value = 31
>>> iot_sensor[2], temperature value = 8
...
The following is happening:
1. This example application acts as Bluetooth® LE GAP Central. A user will see it starts Bluetooth®
LE scanning when it is booted.
2. We have two Bluetooth® LE temperature sensors running by sensor_1 and sensor_2. And they
act as GAP Peripheral devices.
3. This example application tries to find two sensors during Bluetooth® LE Scan.
4. If a user run proxm_sensor_gw conn 1, this example application initiates connection to
sensor_1. Same way, a user also initiates a connection to sensor_2.
5. Once a connection is made, depending on the RF environment, a user may need to try the scan
command proxm_sensor_gw scan several times to get sensor 1 or 2 correctly listed.
6. When two sensors are connected, a user can set each sensor to start reading and posting
temperature values with the commands: proxm_sensor_gw peer 1 J or proxm_sensor_gw
peer 2 J.
7. Sensor Service detail: implement the following GATT service on a user Bluetooth® LE device:
a. SVC: UUID = '12345678-1234-5678-1234-56789abcdef0'.
b. Temperature characteristic: UUID = '12345678-1234-5678-1234-56789abcdef1', Permission
= READ | NOTIFY, Value size = 1 byte.
c. If subscription (on CCCD) is requested by a peer, periodic notification starts every five sec
(the temperature value is notified every five seconds).
8. Every five seconds, sensor_1 and sensor_2 each post the current temperature to the
sensor_gateway – DA16600.
9. In the meantime, sensor_gateway is programmed to post one temperature message per every
tenth message from a sensor, so a user can see the UDP Server print the message received
from sensor_gateway – DA16600 at ssh_win_1.
6.6.3 Workflow
After provisioned and boot up, the DA16600 tries to scan and connect the peripheral devices. The
connection between the DA14531 and peripheral is established then the sensor data is transmitted to
the DA16600 (DA14531 - GTL - DA16200) and then DA16200 sends the data to the server.
● The DA16600 tries to scan automatically after booted up or by typing the following scan
command to start
[/DA16600] # ble.proxm_sensor_gw scan
● ConsoleEvent(): UI handler for controlling sensor gateway, the console commands are sent to the
DA14531 via the GTL
● Connect the devices and enable the notification to the peripheral devices
● The peripheral devices send the data to the DA14531
● They are transferred to the DA16200 and posted to the server
Initialization
Provisioning Mode
#ifdef __APPEND_EXTRA_INFO_AT_DEVICE_NAME
#define USER_DEVICE_NAME ("DA16600-XXXX")
#else
#define USER_DEVICE_NAME ("DA16600")
#endif
The ADV interval should not be too long, we recommend not to set it bigger than 1 or 2 seconds
because it may not be scanned well by the host due to its longer advertising. The shorter interval can
be scanned faster by the hosts of course, but to save the power consumption we have set it to the
appropriate value – 687.5 ms.
#if defined(__BLE_PERI_WIFI_SVC__) ||
defined(__BLE_PERI_WIFI_SVC_TCP_DPM__) ||
defined(__BLE_CENT_SENSOR_GW__)
#define __CFG_ENABLE_BLE_HW_RESET__ // Enable H/W reset of BLE
#endif
And it needs to configure the POR register in DA14531 for P0_11 working as a reset pin, the
CFG_ENABLE_POR_PIN should be defined as following in the DA14531 SDK as well, build the SDK
and replace the image file – da14531_multi_part_proxr.img or da14531_multi_part_proxm.img.
//[DA14531_SDK_ROOT]\projects\target_apps\ble_examples\prox_reporter_sensor_ext_coe
x\src\config\da1458x_config_advanced.h (reporter project) or
[DA14531_SDK_ROOT]\projects\target_apps\ble_examples\prox_monitor_aux_ext_coex\src\
config\da1458x_config_advanced.h (Monitor/Central project)
/*******************************************************************/
/* Enable HW RESET by P0_11 if need */
/*******************************************************************/
#define CFG_ENABLE_POR_PIN
Note that the GPIOC_8/DA16200 and P0_11 should not be used in any other cases apart from this
purpose to use the Bluetooth® LE HW reset properly. When run the reset, the SW reset is run first
and if it is failed then the HW reset is run next in the SDK. See the wired jumpers in Figure 47.
Revision History
Revision Date Description
1.6 Aug. 18, 2023 Removed unnecessary example: quad_decoder
1.2 Jan. 12, 2022 ● Corrected typos, references, formats, and links
● Updated some comments
1.1 Oct. 27, 2021 ● Added Appendix A: the Bluetooth® LE ADV device name change
● Added Appendix B: ADV interval change
● Added Appendix C: Reset pin configuration
● Re-organized whole document and added some more sections
● Updated the file paths and code based on the SDK version 3.2.0.0
release
1.0 May 12, 2021 First Release
Status Definitions
Status Definition
DRAFT The content of this document is under review and subject to formal approval, which may result in modifications or
additions.
APPROVED The content of this document has been approved for publication.
or unmarked
RoHS Compliance
Renesas Electronics’s suppliers certify that its products are in compliance with the requirements of Directive 2011/65/EU of the European
Parliament on the restriction of the use of certain hazardous substances in electrical and electronic equipment. RoHS certificates from our
suppliers are available on request.
These resources are intended for developers skilled in the art designing with Renesas products. You are solely responsible for (1) selecting the
appropriate products for your application, (2) designing, validating, and testing your application, and (3) ensuring your application meets
applicable standards, and any other safety, security, or other requirements. These resources are subject to change without notice. Renesas
grants you permission to use these resources only for development of an application that uses Renesas products. Other reproduction or use of
these resources is strictly prohibited. No license is granted to any other Renesas intellectual property or to any third party intellectual property.
Renesas disclaims responsibility for, and you will fully indemnify Renesas and its representatives against, any claims, damages, costs, losses, or
liabilities arising out of your use of these resources. Renesas' products are provided only subject to Renesas' Terms and Conditions of Sale or
other applicable terms agreed to in writing. No use of any Renesas resources expands or otherwise alters any applicable warranties or warranty
disclaimers for these products.
Corporate Headquarters
TOYOSU FORESIA, 3-2-24 Toyosu Contact Information
Koto-ku, Tokyo 135-0061, Japan For further information on a product, technology, the most
www.renesas.com up-to-date version of a document, or your nearest sales
office, please visit:
https://www.renesas.com/contact/
Trademarks