RENESAS RX200, RX23W User Manual

All information contained in these materials, including products and product specifications, represents information on the product at the time of publication and is subject to change by Renesas Electronics Corp. without notice. Please review the latest information published by Renesas Electronics Corp. through various means, including the Renesas Electronics Corp. website (http://www.renesas.com).
Bluetooth Low Energy Protocol Stack Basic Package
Users Manual
Rev.1.03 Mar 2021
32
RENESAS MCU RX Family / RX200 Series / RX23W Group
User s Manual
www.renesas.com
© 2021 Renesas Electronics Corporation. All rights reserved.

Notice

1. Descriptions of circuits, software and other related information in this document are provided only to illustrate the operation of semiconductor products and application examples. You are fully responsible for the incorporation or any other use of the circuits, software, and information in the design of your product or system. Renesas Electronics disclaims any and all liability for any losses and damages incurred by you or third parties arising from the use of these circuits, software, or information.
2. Renesas Electronics hereby expressly disclaims any warranties against and liability for infringement or any other claims involving patents, copyrights, or other intellectual property rights of third parties, by or arising from the use of Renesas Electronics products or technical information described in this document, including but not limited to, the product data, drawings, charts, programs, algorithms, and application examples.
3. No license, express, implied or otherwise, is granted hereby under any patents, copyrights or other intellectual property rights of Renesas Electronics or others.
4. You shall be responsible for determining what licenses are required from any third parties, and obtaining such licenses for the lawful import, export, manufacture, sales, utilization, distribution or other disposal of any products incorporating Renesas Electronics products, if required.
5. You shall not alter, modify, copy, or reverse engineer any Renesas Electronics product, whether in whole or in part. Renesas Electronics disclaims any and all liability for any losses or damages incurred by you or third parties arising from such alteration, modification, copying or reverse engineering.
6. Renesas Electronics products are classified according to the following two quality grades: “Standard” and “High Quality”. The intended applications for each Renesas Electronics product depends on the product’s quality grade, as indicated below. "Standard": Computers; office equipment; communications equipment; test and measurement equipment; audio and visual equipment; home
electronic appliances; machine tools; personal electronic equipment; industrial robots; etc.
"High Quality": Transportation equipment (automobiles, trains, ships, etc.); traffic control (traffic lights); large-scale communication equipment; key
financial terminal systems; safety control equipment; etc. Unless expressly designated as a high reliability product or a product for harsh environments in a Renesas Electronics data sheet or other Renesas Electronics document, Renesas Electronics products are not intended or authorized for use in products or systems that may pose a direct threat to human life or bodily injury (artificial life support devices or systems; surgical implantations; etc.), or may cause serious property damage (space system; undersea repeaters; nuclear power control systems; aircraft control systems; key plant systems; military equipment; etc.). Renesas Electronics disclaims any and all liability for any damages or losses incurred by you or any third parties arising from the use of any Renesas Electronics product that is inconsistent with any Renesas Electronics data sheet, user’s manual or other Renesas Electronics document.
7. No semiconductor product is absolutely secure. Notwithstanding any security measures or features that may be implemented in Renesas Electronics hardware or software products, Renesas Electronics shall have absolutely no liability arising out of any vulnerability or security breach, including but not limited to any unauthorized access to or use of a Renesas Electronics product or a system that uses a Renesas Electronics product. RENESAS ELECTRONICS DOES NOT WARRANT OR GUARANTEE THAT RENESAS ELECTRONICS PRODUCTS, OR ANY SYSTEMS CREATED USING RENESAS ELECTRONICS PRODUCTS WILL BE INVULNERABLE OR FREE FROM CORRUPTION, ATTACK, VIRUSES, INTERFERENCE, HACKING, DATA LOSS OR THEFT, OR OTHER SECURITY INTRUSION (“Vulnerability Issues”). RENESAS ELECTRONICS DISCLA IMS ANY AND ALL RESPONSIBILITY OR LIABILITY ARISING FROM OR RELATED TO ANY VULNERABILITY ISSUES. FURTHERMORE, TO THE EXTENT PERMITTED BY APPLICABLE LAW, RENESAS ELECTRONICS DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, WITH RESPECT TO THIS DOCUMENT AND ANY RELATED OR ACCOMPANYING SOFTWARE OR HARDWARE, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
8. When using Renesas Electronics products, refer to the latest product information (data sheets, user’s manuals, application notes, “General Notes for Handling and Using Semiconductor Devices” in the reliability handbook, etc.), and ensure that usage conditions are within the ranges specified by Renesas Electronics with respect to maximum ratings, operating power supply voltage range, heat dissipation characteristics, installation, etc. Renesas Electronics disclaims any and all liability for any malfunctions, failure or accident arising out of the use of Renesas Electronics products outside of such specified ranges.
9. Although Renesas Electronics endeavors to improve the quality and reliability of Renesas Electronics products, semiconductor products have specific characteristics, such as the occurrence of failure at a certain rate and malfunctions under certain use conditions. Unless designated as a high reliability product or a product for harsh environments in a Renesas Electronics data sheet or other Renesas Electronics document, Renesas Electronics products are not subject to radiation resistance design. You are responsible for implementing safety measures to guard against the possibility of bodily injury, injury or damage caused by fire, and/or danger to the public in the event of a failure or malfunction of Renesas Electronics products, such as safety design for hardware and software, including but not limited to redundancy, fire control and malfunction prevention, appropriate treatment for aging degradation or any other appropriate measures. Because the evaluation of microcomputer software alone is very difficult and impractical, you are responsible for evaluating the safety of the final products or systems manufactured by you.
10. Please contact a Renesas Electronics sales office for details as to environmental matters such as the environmental compatibility of each Renesas Electronics product. You are responsible for carefully and sufficiently investigating applicable laws and regulations that regulate the inclusion or use of controlled substances, including without limitation, the EU RoHS Directive, and using Renesas Electronics products in compliance with all these applicable laws and regulations. Renesas Electronics disclaims any and all liability for damages or losses occurring as a result of your noncompliance with applicable laws and regulations.
11. Renesas Electronics products and technologies shall not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited under any applicable domestic or foreign laws or regulations. You shall comply with any applicable export control laws and regulations promulgated and administered by the governments of any countries asserting jurisdiction over the parties or transactions.
12. It is the responsibility of the buyer or distributor of Renesas Electronics products, or any other party who distributes, disposes of, or otherwise sells or transfers the product to a third party, to notify such third party in advance of the contents and conditions set forth in this document.
13. This document shall not be reprinted, reproduced or duplicated in any form, in whole or in part, without prior written consent of Renesas Electronics.
14. Please contact a Renesas Electronics sales office if you have any questions regarding the information contained in this document or Renesas Electronics products.
(Note1) “Renesas Electronics” as used in this document means Renesas Electronics Corporation and also includes its directly or indirectly controlled
subsidiaries.
(Note2) “Renesas Electronics product(s)” means any product developed or manufactured by or for Renesas Electronics.
(Rev.5.0-1 October 2020)
Corporate Headquarters
Contact information
TOYOSU FORESIA, 3-2-24 Toyosu, Koto-ku, Tokyo 135-0061, Japan
www.renesas.com
For further information on a product, technology, the most up-to-date version of a document, or your nearest sales office, please visit:
www.renesas.com/contact/.
Trademarks
Renesas and the Renesas logo are trademarks of Renesas Electronics Corporation.
The Bluetooth® word mark and logos are registered trademarks owned by Bluetooth SIG, Inc. and any use of such marks by Renesas Electronics Corporation is under license. All trademarks and registered trademarks are the property of their respective owners.

General Precautions in the Handling of Microprocessing Unit and Microcontroller Unit Products

The following usage notes are applicable to all Microprocessing unit and Microcontroller unit products from Renesas. For detailed usage notes on the products covered by this document, refer to the relevant sections of the document as well as any technical updates that have been issued for the products.
1. Precaution against Electrostatic Discharge (ESD) A strong electrical field, when exposed to a CMOS device, can cause destruction of the gate oxide and ultimately degrade the device operation. Steps
must be taken to stop the generation of static electricity as much as possible, and quickly dissipate it when it occurs. Environmental control must be adequate. When it is dry, a humidifier should be used. This is recommended to avoid using insulators that can easily build up static electricity. Semiconductor devices must be stored and transported in an anti-static container, static shielding bag or conductive material. All test and measurement tools including work benches and floors must be grounded. The operator must also be grounded using a wrist strap. Semiconductor devices must not be touched with bare hands. Similar precautions must be taken for printed circuit boards with mounted semiconductor devices.
2. Processing at power-on The state of the product is undefined at the time when power is supplied. The states of internal circuits in the LSI are indeterminate and the states of
register settings and pins are undefined at the time when power is supplied. In a finished product where the reset signal is applied to the external reset pin, the states of pins are not guaranteed from the time when power is supplied until the reset process is completed. In a similar way, the states of pins in a product that is reset by an on-chip power-on reset function are not guaranteed from the time when power is supplied until the power reaches the level at which resetting is specified.
3. Input of signal during power-off state Do not input signals or an I/O pull-up power supply while the device is powered off. The current injection that results from input of such a signal or I/O
pull-up power supply may cause malfunction and the abnormal current that passes in the device at this time may cause degradation of internal elements. Follow the guideline for input signal during power-off state as described in your product documentation.
4. Handling of unused pins Handle unused pins in accordance with the directions given under handling of unused pins in the manual. The input pins of CMOS products are
generally in the high-impedance state. In operation with an unused pin in the open-circuit state, extra electromagnetic noise is induced in the vicinity of the LSI, an associated shoot-through current flows internally, and malfunctions occur due to the false recognition of the pin state as an input signal become possible.
5. Clock signals After applying a reset, only release the reset line after the operating clock signal becomes stable. When switching the clock signal during program
execution, wait until the target clock signal is stabilized. When the clock signal is generated with an external resonator or from an external oscillator during a reset, ensure that the reset line is only released after full stabilization of the clock signal. Additionally, when switching to a clock signal produced with an external resonator or by an external oscillator while program execution is in progress, wait until the target clock signal is stable.
6. Voltage application waveform at input pin Waveform distortion due to input noise or a reflected wave may cause malfunction. If the input of the CMOS device stays in the area between VIL (Max.)
and VIH (Min.) due to noise, for example, the device may malfunction. Take care to prevent chattering noise from entering the device when the input level is fixed, and also in the transition period when the input level passes through the area between VIL (Max.) and VIH (Min.).
7. Prohibition of access to reserved addresses Access to reserved addresses is prohibited. The reserved addresses are provided for possible future expansion of functions. Do not access these
addresses as the correct operation of the LSI is not guaranteed.
8. Differences between products Before changing from one product to another, for example to a product with a different part number, confirm that the change will not lead to problems.
The characteristics of a microprocessing unit or microcontroller unit products in the same group but having a different part number might differ in terms of internal memory capacity, layout pattern, and other factors, which can affect the ranges of electrical characteristics, such as characteristic values, operating margins, immunity to noise, and amount of radiated noise. When changing to a product with a different part number, implement a system­evaluation test for the given product.

How to Use This Manual

1. Purpose and Target Readers
This manual is designed to provide the user with an understanding of the usages and the provided functions of the Bluetooth® Low Energy protocol stack. It is intended for users designing applications incorporating the software. A basic knowledge of MCUs and software development environment and Bluetooth® Low Energy is necessary in order to use this manual.
The manual comprises an overview of the product; how to install, how to build and the usage of the provided functions.
Particular attention should be paid to the precautionary notes when using the manual. These notes occur within the body of the text and at the end of each section.
The revision history summarizes the locations of revisions and additions. It does not list all revisions. Refer to the text of the manual for details.
The following documents apply to the RX23W Group. Make sure to refer to the latest versions of these documents. The newest versions of the documents listed may be obtained from the Renesas Electronics Web site.
Document Type
Description
Document Title
Document No.
Data Sheet
Hardware overview and electrical characteristics
RX23W Group Datasheet
R01DS0342EJ
User’s manual for Hardware
Hardware specifications (pin assignments, memory maps, peripheral specifications, electrical characteristics, and timing charts) and descriptions of operation
RX23W Group User’s Manual: Hardware
R01UH0823EJ
User’s manual for Software
Detailed descriptions of the CPU and instruction set
RX Family RXv2 Instruction Set Architecture User’s Manual: Software
R01US0071EJ
User’s manual for
Middleware
Overview of the product, how to install, how to build and usage of the provided function
Bluetooth Low Energy Protocol Stack Basic Package User's Manual
This User’s
manual
Application Note
Notes on Printed Circuit Board Patterns
RX Family Hardware Design Guide
R01AN1411EJ
RX23W Group Tuning procedure of Bluetooth dedicated clock frequency
R01AN4762EJ
Examples of applications and sample programs
RX23W Group BLE Module Firmware Integration Technology
R01AN4860EJ
RX23W Group Bluetooth Low Energy Profile Developer’s Guide
R01AN4553EJ
RX23W Group Bluetooth Low Energy Application Developer’s Guide
R01AN5504EJ Renesas Technical Update
Product specifications, updates on documents, etc.
2. List of Abbreviations and Acronyms
Abbreviation
Full Form
API
Application Programming Interface
ATT
Attribute Protocol
BD
Bluetooth Device
BD_ADDR
Bluetooth Device Address
BLE
Bluetooth Low Energy
BSP
Board Support Package
BTTS
Bluetooth Test Tool Suite
CLI
Command Line Interface
CMT
Compare Match Timer
CSRK
Connection Signature Resolving Key
DFU
Device Firmware Update
ECDH
Elliptic curve Diffie–Hellman key exchange
EDIV
Encrypted Diversifier
FIT
Firmware Integration Technology
GAP
Generic Access Profile
GATT
Generic Attribute Profile
HCI
Host Controller Interface
L2CAP
Logical Link Control and Adaptation Protocol
IRK
Identity Resolving Key
LE
Low Energy
LL
Link Layer
LTK
Long Term Key
MCU
Micro Controller Unit
MITM
Man-in-the-middle
OOB
Out of Band
OS
Operating System
OTA
Over The Air
PHY
Physical layer
QE
Quick and Effective tool solution
RF
Radio Frequency
RFP
Renesas Flash Programmer
RPA
Resolvable Private Address
RSK
Renesas Starter Kit
RSSI
Received Signal Strength Indication
RSSK
Renesas Solution Starter Kit
Abbreviation
Full Form
SC
Smart Configurator
SCI
Serial Communication Interface
SM
Security Manager
SMP
Security Manager Protocol
STK
Short Term Key
TB
Target Board
TK
Temporary Key
UART
Universal Asynchronous Receiver Transmitter
USB
Universal Serial Bus
UUID
Universal Unique Identifier
VS
Vendor Specific
WDT
Watchdog Timer

Contents

1. Overview ............................................................................................................................ 1
1.1 Features ..................................................................................................................................................... 1
1.2 Specifications ............................................................................................................................................. 2
2. Installation ......................................................................................................................... 3
2.1 Package Contents ...................................................................................................................................... 3
2.2 Project Configuration ................................................................................................................................. 5
2.3 Build Environment ...................................................................................................................................... 6
2.4 Install .......................................................................................................................................................... 7
2.4.1 BLE FIT Module ............................................................................................................................... 7
2.4.2 Demo projects .................................................................................................................................. 7
3. Software Structure ............................................................................................................. 8
3.1 BLE Protocol Stack .................................................................................................................................... 9
3.1.1 BLE Protocol Stack structure ........................................................................................................... 9
3.1.2 BLE Protocol Stack library ............................................................................................................. 12
3.2 app_lib...................................................................................................................................................... 15
3.2.1 Abstraction API............................................................................................................................... 15
3.2.2 Software Timer ............................................................................................................................... 15
3.2.3 Security Data Management ............................................................................................................ 15
3.2.4 Profile Common.............................................................................................................................. 16
3.2.5 Logger ............................................................................................................................................ 16
3.2.6 Command line ................................................................................................................................ 16
3.2.7 LED and Switch Control ................................................................................................................. 16
3.2.8 BLE Task Control ........................................................................................................................... 16
4. Software Setting .............................................................................................................. 17
4.1 Configuration options ............................................................................................................................... 17
4.2 Sections ................................................................................................................................................... 25
4.2.1 Linker settings for application project ............................................................................................. 26
4.3 Bluetooth Device Address........................................................................................................................ 29
4.4 Bluetooth Device Name ........................................................................................................................... 29
4.4.1 Inform by Advertising packet .......................................................................................................... 29
4.4.2 Inform by Device Name Characteristic .......................................................................................... 31
5. Original Features ............................................................................................................. 32
5.1 Command Line Interface.......................................................................................................................... 32
5.1.1 GAP command ............................................................................................................................... 34
5.1.2 Vendor Specific (VS) command ..................................................................................................... 47
5.1.3 SYS command ............................................................................................................................... 52
5.1.4 BLE command ................................................................................................................................ 53
5.2 Security Data Management ..................................................................................................................... 54
5.2.1 Security data management information ......................................................................................... 55
5.2.2 Local device security data .............................................................................................................. 56
5.2.3 Remote device security data .......................................................................................................... 58
5.3 RF communication timing notification ...................................................................................................... 60
5.3.1 Connection event notification timing .............................................................................................. 61
5.3.2 Advertising event notification timing ............................................................................................... 62
5.3.3 Scan / Initiator event notification timing ......................................................................................... 62
5.3.4 RF sleep mode event notification timing ........................................................................................ 63
5.3.5 RF communication timing notification specifications ..................................................................... 64
5.4 Device-specific Data Management .......................................................................................................... 65
5.4.1 Specifying Device-specific data location block .............................................................................. 65
5.4.2 Device-specific data format ............................................................................................................ 66
5.4.3 Writing to user area (ROM) ............................................................................................................ 66
5.4.4 Writing to data area (E2 DataFlash) .............................................................................................. 67
5.4.5 RX23W flash memory protection function ...................................................................................... 69
5.4.6 BD address adoption flow .............................................................................................................. 70
6. HCI Mode ........................................................................................................................ 71
6.1 Software Structure ................................................................................................................................... 71
6.2 Demo Project ........................................................................................................................................... 72
6.2.1 Change device type of project ........................................................................................................ 74
6.3 UART Driver ............................................................................................................................................. 78
6.3.1 Configuration Options of UART Driver ........................................................................................... 78
7. Appendix .......................................................................................................................... 80
7.1 Firmware writing procedure for Target Board for RX23W (retaining device-specific data) ..................... 80
R01UW0205EJ0103 Rev.1.03 Page 1 of 85 Mar.30.2021

1. Overview

1.1 Features

The Bluetooth® Low Energy Protocol Stack Basic Package includes the BLE FIT module for RX23W group compliant with Bluetooth Core Specification version 5.0 and fundamental software for developing Bluetooth Low Energy application.
Bluetooth Low Energy Protocol Stack Basic Package User's Manual 1. Overview
R01UW0205EJ0103 Rev.1.03 Page 2 of 85 Mar.30.2021

1.2 Specifications

Table 1.1 shows the specifications of the software provided by the Bluetooth Low Energy Protocol Stack Basic Package.
Table 1.1. Specifications
Item
Description
BLE FIT module
The BLE FIT module for RX23W group provides the following BLE features by R_BLE API. <Feature of Bluetooth 5.0>
LE 2M PHY
LE Coded PHY
LE Advertising Extensions
LE Channel Selection Algorithm #2
High Duty Cycle Non-Connectable Advertising
<Feature of Bluetooth 4.2>
LE Secure Connections
Link Layer Privacy
LE Data Packet Length Extension
Link Layer Extended Scanner Filter Policies
<Feature of Bluetooth 4.1>
LE L2CAP Connection Oriented Channel Support
Low Duty Cycle Directed Advertising
32-bit UUID Support in LE
LE Link Layer Topology
LE Ping
The following features for BLE Application are provided. [app_lib]
Abstraction API
Software Timer
Security Data Management
Profile Common
Logger
Command line
LED and Switch Control
BLE Task Control
[BLE Protocol Stack]
RF communication timing notification
Device-specific Data Management
Demo projects
The following projects are provided as sample applications for BLE initial operation check.
Custom profile GATT server application
Custom profile GATT client application
HCI mode
Utility
The following tools (Windows applications) are provided for HCI mode.
Public BD address writing tool for HCI mode (BDAddrWriter)
Operation tool for calibration for HCI mode (CLVALTune)

Bluetooth Low Energy Protocol Stack Basic Package User's Manual 2. Installation

R01UW0205EJ0103 Rev.1.03 Page 3 of 85 Mar.30.2021
2. Installation

2.1 Package Contents

The Bluetooth Low Energy Protocol Stack Basic Package is available from the Renesas RX23W FIT module Web page (https://www.renesas.com/products/software-tools/software-os-middleware-driver/software-
package/fit-rx23w.html) or “RX23W Group BLE Module Firmware Integration Technology Application Note” on
e2studio Smart Browser. If you want to download only the BLE FIT module, see “2.4 Install”.
Figure 2.1. e2studio Smart Browser
Bluetooth Low Energy Protocol Stack Basic Package User's Manual 2. Installation
R01UW0205EJ0103 Rev.1.03 Page 4 of 85 Mar.30.2021
Table 2.1 shows the contents of the Bluetooth Low Energy Protocol Stack Basic Package.
Table 2.1. Contents of the Bluetooth Low Energy Protocol Stack Basic Package
r01an4860xxXXXX-rx23w-ble-fit.zip
XXXX: Revision number
FITDemos\
Sample application folder
ble_demo_rsskrx23w_profile_client.zip
GATT client project for RSSK RX23W
ble_demo_rsskrx23w_profile_server.zip
GATT server project for RSSK RX23W
ble_demo_rsskrx23w_uart_hci.zip
HCI mode project for RSSK RX23W
ble_demo_tbrx23w_FreeRTOS_multi_services.zip
FreeRTOS GATT server project for Target Board for RX23W
ble_demo_tbrx23w_profile_client.zip
GATT client project for Target Board for RX23W
ble_demo_tbrx23w_profile_server.zip
GATT server project for Target Board for RX23W
ble_demo_tbrx23w_uart_hci.zip
HCI mode project for Target Board for RX23W
ble_demo_tbrx23wmodule_profile_client.zip
GATT client project for Target Board for RX23W module
ble_demo_tbrx23wmodule_profile_server.zip
GATT server project for Target Board for RX23W module
ble_demo_tbrx23wmodule_uart_hci.zip
HCI mode project for Target Board for RX23W module
ROM_Files\
Mot files
ble_demo_rsskrx23w_profile_client.mot
GATT client project mot file for RSSK RX23W
ble_demo_rsskrx23w_profile_server.mot
GATT server project mot file for RSSK RX23W
ble_demo_rsskrx23w_uart_hci.mot
HCI mode project mot file for RSSK RX23W
ble_demo_tbrx23w_FreeRTOS_multi_services.mot
FreeRTOS GATT server project mot file for Target Board for RX23W
ble_demo_tbrx23w_profile_client.mot
GATT client project mot file for Target Board for RX23W
ble_demo_tbrx23w_profile_server.mot
GATT server project mot file for Target Board for RX23W
ble_demo_tbrx23w_uart_hci.mot
HCI mode project mot file for Target Board for RX23W
ble_demo_tbrx23wmodule_profile_client.mot
GATT client project mot file for Target Board for RX23W module
ble_demo_tbrx23wmodule_profile_server.mot
GATT server project mot file for Target Board for RX23W module
ble_demo_tbrx23wmodule_uart_hci.mot
HCI mode project mot file for Target Board for RX23W module
FITModules\
FIT module folder
r_ble_rx23w_vX.XX.xml
BLE FIT module xml file
r_ble_rx23w_vX.XX.zip
BLE FIT module body package
r_ble_rx23w_vX.XX_extend.mdf
BLE FIT module mdf file
utilities\
Utility folder
BDAddrWriter.zip
Public BD address writing tool for HCI mode
CLVALTune.zip
Operation tool for calibration for HCI mode
r01an4860ejXXXX-rx23w-ble.pdf
BLE FIT Module Application Note (English)
r01an4860jjXXXX-rx23w-ble.pdf
BLE FIT Module Application Note (Japanese)
r_ble_api_spec.chm
R_BLE API document (English)
Bluetooth Low Energy Protocol Stack Basic Package User's Manual 2. Installation
R01UW0205EJ0103 Rev.1.03 Page 5 of 85 Mar.30.2021

2.2 Project Configuration

A BLE Application template project consists of Smart Configurator generation codes extracted from the BLE FIT module, the BLE QE Utility module and the QE for BLE and other FIT modules. Table 2.2 shows the project configuration.
Table 2.2. BLE Application template project configuration
[project name]\
Project directory
src\ smc_gen\
A set of source codes generated by Smart Configurator
Config_BLE_PROFILE\
A set of source codes generated by QE for BLE
app_main.c
Framework for user application and profile
gatt_db.c
GATT database
gatt_db.h
r_ble_[profile name]s.c
Profile API
r_ble_[profile name]s.h
r_ble_[profile name]c.c
r_ble_[profile name]c.h
r_ble_rx23w\
BLE FIT module
lib\
BLE Protocol Stack library
ref\
Configuration reference
src\
app_lib\
BLE application auxiliary features
abs\
Abstraction API
board\
LED and Switch Control
cli\
Command line (Input/Output to terminal software)
cmd\
Command line (Command implementation)
discovery\
Profile Common (discovery)
logger\
Logger
profile_cmn\
Profile Common
rtos\
BLE Tack Control
sec_data\
Security Data Management
timer\
Software Timer
platform\
Platform dependent codes
driver\
Data Flash driver for the BLE FIT module
r_ble_pf_config_private.h
BLE configuration control
r_ble_pf_configs.c
r_ble_pf_functions.c
RF driver platform dependent
r_ble_pf_lowpower.c
MCU low power consumption program
r_ble_rx23w_if.h
BLE interface definition file
FIT modules other than the BLE FIT module
[project].c
Application template
Bluetooth Low Energy Protocol Stack Basic Package User's Manual 2. Installation
R01UW0205EJ0103 Rev.1.03 Page 6 of 85 Mar.30.2021

2.3 Build Environment

Table 2.3 shows the hardware requirements for building and debugging a BLE Application.
Table 2.3. Hardware requirements
Hardware
Description
Host PC
Windows 10 PC with USB interface.
RX23W Board
Target Board for RX23W [RTK5RX23W0C00000BJ] Target Board for RX23W module [RTK5RX23W0C01000BJ] RSSK RX23W [RTK5523W8AC00001BJ]
On-chip debugging emulators
E2 emulator Lite [RTE0T0002LKCE00000R] or E1 emulator [R0E000010KCE00]
When using the RSSK, either emulator is required. The Target Board has an on-board debugger equivalent to the E2 emulator Lite, so
there is no need to prepare an emulator.
USB cables
Used to connect to the emulator and RX23W board.
E2 or E1 emulator: 1 USB A-miniB cable Target Board: 2 USB A-microB cable RSSK: 1 USB A-microB cable
Table 2.4 shows the software requirements for building and debugging a BLE Application.
Table 2.4. Software requirements
Software
Version
Description
CC-RX environment
e² studio
v7.8.0 (32bit) 2021_01 (64bit)
Integrated development environment (IDE) for Renesas devices.
CC-RX compiler
v2.08.00
C/C++ Compiler for RX Family. (download from e2 studio installer)
Renesas Flash Programmer
v3.06.00
Tool for programming the on-chip flash memory of Renesas microcontrollers.
IAR environment
IAR Embedded Workbench for Renesas RX
v4.14.1
Integrated development environment (IDE) for Renesas devices made by IAR Systems.
Note: Supported by BLE FIT module v1.10 or later.
Bluetooth Low Energy Protocol Stack Basic Package User's Manual 2. Installation
R01UW0205EJ0103 Rev.1.03 Page 7 of 85 Mar.30.2021

2.4 Install

2.4.1 BLE FIT Module

This module must be added to each project in which it is used. Renesas recommends using “Smart Configurator” described in (1) or (3).
(1) Adding the FIT module to your project using “Smart Configurator” in e2 studio.
By using the “Smart Configurator” in e
2
studio, the FIT module is automatically added to your project.
Refer to “Renesas e
2
studio Smart Configurator User Guide (R20AN0451)” for details.
(2) Adding the FIT module to your project using “FIT Configurator” in e2 studio
By using the “FIT Configurator” in e
2
studio, the FIT module is automatically added to your project. Refer
to “Adding Firmware Integration Technology Modules to Projects (R01AN1723)” for details.
(3) Adding the FIT module to your project using “Smart Configurator” on CS+
By using the “Smart Configurator Standalone version” in CS+, the FIT module is automatically added to your project. Refer to “Renesas e
2
studio Smart Configurator User Guide (R20AN0451)” for details.
(4) Adding the FIT module to your project in CS+
In CS+, please manually add the FIT module to your project. Refer to “Adding Firmware Integration Technology Modules to CS+ Projects (R01AN1826)” for details.

2.4.2 Demo projects

2.4.2.1 e2 studio Project
Import the demo project zip file under the FITDemos folder to the lowest possible hierarchy. (e.g. C:\RenesasBLE ) If the folder hierarchy is deep, intermediate files cannot be output when building with e2 studio, and the build may fail.
Also, select a location that does not contain blank character, multi-byte characters, and ampersand character
“&” in the decompression destination path.
Refer to “BLE Module Firmware Integration Technology Application Note (R01AN4860)” for details on
importing the demo project zip file to the e2 studio workspace. Note: If the demo project import location is not appropriate, the e2 studio build may fail.
2.4.2.2 IAR Embedded Workbench for Renesas RX Project
Unzip the demo project zip file under the “FITDemos” folder and double-click the eww file. Build the project by [Project][Rebuild All] on IAR Embedded Workbench for Renesas RX. After successful build, download the firmware to the board by selecting [Project][Download and Debug].

Bluetooth Low Energy Protocol Stack Basic Package User's Manual 3. Software Structure

R01UW0205EJ0103 Rev.1.03 Page 8 of 85 Mar.30.2021
3. Software Structure
Figure 3.1 shows the BLE Application software structure.
Figure 3.1. BLE Application software structure
The BLE Application consists of BLE Protocol Stack and app_lib provided by the BLE FIT module and skeleton programs and BLE Profile generated by QE for BLE.
By calling the R_BLE API function provided by the BLE Protocol Stack, the BLE Application can use the BLE function.
The app_lib provides auxiliary features that can be used by the BLE Application. The BLE communication can be easily used by using Abstraction API that abstracts R_BLE API included in app_lib.
QE for BLE, a solution toolkit that runs on e2 studio, generates skeleton programs for application and profile development using BLE Protocol Stack and Abstraction API.
Renesas recommends BLE application development using QE for BLE. For details about how to design a profile with QE for BLE, see “RX23W Group Bluetooth Low Energy Profile
Developer's Guide (R01AN4553)”. For details about how to develop BLE Application, see “RX23W Group Bluetooth Low Energy Application Developer's Guide (R01AN5504)”.
Bluetooth Low Energy Protocol Stack Basic Package User's Manual 3. Software Structure
R01UW0205EJ0103 Rev.1.03 Page 9 of 85 Mar.30.2021

3.1 BLE Protocol Stack

3.1.1 BLE Protocol Stack structure

Figure 3.2 shows the BLE Protocol Stack structure.
BLE Protocol Stack
Host Stack
R_BLE API
L2CAP
Link Layer
GAP
L2CAP
Vendor Specific
MCU Low Power Consumption
Common
HCI
ATTSMP
HCI
Scheduler
Vendor Specific
GAP GATT
GATT Client
GATT Server
GATT Common
BLE (H/W)
BLE Application Layer
Vendor Specific
Figure 3.2. BLE Protocol Stack structure
BLE Protocol Stack consists of R_BLE API, Host Stack, Link Layer, and Scheduler.
Bluetooth Low Energy Protocol Stack Basic Package User's Manual 3. Software Structure
R01UW0205EJ0103 Rev.1.03 Page 10 of 85 Mar.30.2021
R_BLE API
The R_BLE API provides the APIs shown in Table 3.1 to provide BLE functions for BLE applications. Refer to R_BLE API document (r_ble_api_spec.chm)” for detailed specifications of each API.
Table 3.1. R_BLE API overview
R_BLE_API
Protocol/Profile
Description
Common API
API for control BLE Open / Close and scheduler processing. Main features
Open/Close the BLE protocol stack.
Execute the BLE task.
Add an event in the BLE protocol stack internal queue.
GAP API
GAP SMP
API for supports procedures defined in GAP and SMP. Main features
GAP Advertising, Scan, Connection, Security
SMP Pairing
GATT Server API
ATT GATT
API for GATT Server that publishes service-related attributes and data sets (GATT Database).
Main features
Access to GATT Database
Notification / Indication
GATT Client API
ATT GATT
API for GATT Client that makes requests to GATT Server. Main features
Service/Characteristic Discovery
Characteristic Read/Write
GATT Common API
ATT GATT
API for functions used in common with GATT Server/Client. L2CAP API
L2CAP
API for data transfer on channels that perform credit-based flow control.
Vendor Specific API
API that provides Renesas original extended features. Main features
Enhanced Direct Test Mode
Set/Get BD Address
MCU Low Power Consumption API
API for reducing MCU power consumption.
The supported API differs depending on the type of BLE Protocol Stack. See Table 3.4 for the APIs supported by each library.
Bluetooth Low Energy Protocol Stack Basic Package User's Manual 3. Software Structure
R01UW0205EJ0103 Rev.1.03 Page 11 of 85 Mar.30.2021
Host Stack
Host Stack provides the protocol and profile functions specified by Bluetooth SIG. The data received from the R_BLE API is sent to the Link Layer according to the procedures specified in each protocol and profile, and the data received from the Link Layer is notified as an R_BLE API event or data.
Link Layer
The Link Layer controls the BLE hardware implemented in the MCU and provides BLE functions such as Advertising, Scan, Connection, and Data Communication to the Host Stack via HCI (Host Controller Interface). BLE commands and transmission data are sent from Host Stack to Link Layer. BLE command results and data received from remote devices are sent from Link Layer to Host Stack.
Scheduler
Scheduler processes the task according to the message queue sent to the task of each layer of BLE Protocol Stack by R_BLE_Execute() of Common API. Figure 3.3 shows the basic sequence chart of BLE Protocol Stack.
R_BLE API Scheduler Host Stack Link Layer(LL) BLE H/WApplication
Call R_BLE API
return R_BLE API
Send Message to
Host Stack
Call R_BLE_Execute()
return R_BLE_Execute()
Execute Task
return
Send Message to LL
Execute Task
return
Access BLE H/W
Send Message to Host Stack
BLE Interrupt
Execute Task
return
return
callback
R_BLE event callback
return
Send Message to LL
Call R_BLE_Execute()
return R_BLE_Execute()
Execute Task
return
Access BLE H/W
Send Message to Host Stack
Execute Task
return
callback
return
R_BLE event callback
return
Function Call
Send Message
return
BLE Interrupt
Access BLE H/W
Software HardwareSource Code Library
BLE Protcol Stack
Figure 3.3. Basic sequence chart of BLE Protocol Stack
Bluetooth Low Energy Protocol Stack Basic Package User's Manual 3. Software Structure
R01UW0205EJ0103 Rev.1.03 Page 12 of 85 Mar.30.2021

3.1.2 BLE Protocol Stack library

The BLE FIT module provides the following three types of BLE Protocol Stack as a static library according to the supported BLE features. By selecting the type according to the feature used in the BLE Application, it is possible to reduce the ROM/RAM code size of the program.
Refer to “BLE Module Firmware Integration Technology (R01AN4860) 2.10 Code Size” for the code size of each type.
Table 3.2. BLE Protocol Stack library
Library Type
Library File Name
Description
All features
lib_ble_ps_ccrx_a.lib
All features supported by BLE Protocol Stack can be used.
Balance
lib_ble_ps_ccrx_b.lib
LE Advertising Extensions with large ROM/RAM size usage is disabled. However, LE 2M PHY and LE Coded PHY can be changed after connection.
Compact
lib_ble_ps_ccrx_c.lib
Dedicated to BLE slave operation, it can be used in applications that do not require master operation, such as sensor devices.
Table 3.3 shows the BLE features supported by each type of BLE Protocol Stack.
Table 3.3. Features supported by each type of BLE Protocol Stack
BLE Features
Library Type
All features
Balance
Compact
LE 2M PHY
Yes
Yes
No
LE Coded PHY
Yes
Yes
No
LE Advertising Extensions
Yes
No
No
LE Channel Selection Algorithm #2
Yes
Yes
No
High Duty Cycle Non-Connectable Advertising
Yes
Yes
Yes
LE Secure Connections
Yes
Yes
Yes
Link Layer privacy
Yes
Yes
Yes
Link Layer Extended Scanner Filter policies
Yes
Yes
No
LE Data Packet Length Extension
Yes
Yes
Yes
LE L2CAP Connection Oriented Channel Support
Yes
No
No
Low Duty Cycle Directed Advertising
Yes
Yes
Yes
LE Link Layer Topology
Yes
Yes
No
LE Ping
Yes
Yes
Yes
GAP Role
Central
Peripheral
Observer
Broadcaster
Central
Peripheral
Observer
Broadcaster
Peripheral
Broadcaster
GATT Role
Sever Client
Sever Client
Sever Client
32-bit UUID Support in LE
Yes
Yes
Yes
Bluetooth Low Energy Protocol Stack Basic Package User's Manual 3. Software Structure
R01UW0205EJ0103 Rev.1.03 Page 13 of 85 Mar.30.2021
LE 2M PHY
Supports BLE communication with 2Msym/s PHY.
LE Coded PHY
Supports BLE communication with Coded PHY. Communication over a long range than 1M PHY and 2M PHY is possible.
LE Advertising Extensions
An extension of Advertising. The features are as follows. Up to 4 independent advertising can be executed simultaneously.
(Use the configuration option BLE_CFG_RF_ADV_SET_MAX to set the number of Advertising executed simultaneously.)
Expansion of Advertising Data / Scan Response Data size up to 1650 bytes.
(Set the maximum size (bytes) with the configuration option BLE_CFG_RF_ADV_DATA_MAX.)
Periodic Advertising is possible.
LE Channel Selection Algorithm # 2
This feature selects a channel using the algorithm for selecting a hopping channel added in Version 5.0.
High Duty Cycle Non-Connectable Advertising
This feature supports non-connectable advertising with a minimum interval of 20 msec.
LE Secure Connections
Elliptic curve Diffie-Hellman key agreement method (ECDH) supports passive eavesdropping pairing.
Link Layer privacy
This feature avoids tracking from other BLE devices by changing the BD Address periodically.
LE Data Packet Length Extension
This feature expands the BLE data communication packet size. It can be expanded to 251 bytes.
LE L2CAP Connection Oriented Channel Support
This feature supports communication using the L2CAP credit based flow control channel.
Low Duty Cycle Directed Advertising
This feature supports low duty cycle advertising for reconnection with known devices.
LE Link Layer Topology
This feature supports both Master and Slave roles and can operate as Master when connected to a remote device and as Slave when connected to another remote device.
Bluetooth Low Energy Protocol Stack Basic Package User's Manual 3. Software Structure
R01UW0205EJ0103 Rev.1.03 Page 14 of 85 Mar.30.2021
LE Ping
After connection encryption, this feature checks whether connection is maintained by a packet transmission request including MIC field.
GAP Role
GAP Role supports the following.
Central: A device that sends a connection request to a peripheral device. Peripheral: A device that accepts connection requests from Central and establishes a connection. Observer: A device that scans Advertising. Broadcaster: A device that sends Advertising.
GATT Role
GATT Role supports the following.
Server: A device that prepares Characteristic provided by service in GATT Database and responds to requests
from Client.
Client: A device that makes request for services provided by Server.
32-bit UUID Support in LE
Supports GATT 32-bit UUID.
Table 3.4 shows R_BLE API support for each BLE Protocol Stack library.
Table 3.4. R_BLE API support for BLE Protocol Stack library
R_BLE_API
Library Type
All features
Balance
Compact
Common API
Yes
Yes
Yes
GAP API
Yes
C.1
C.1
GATT Common API
Yes
Yes
Yes
GATT Server API
Yes
Yes
Yes
GATT Client API
Yes
Yes
Yes
L2CAP API
Yes
No
No
Vendor Specific API
Yes
Yes
Yes
MCU Low Power Consumption API
Yes
Yes
Yes
C.1: Support for each GAP API varies depending on the type of BLE Protocol Stack library.
Refer to R_BLE API document (r_ble_api_spec.chm) for details.
The BLE Protocol Stack type is determined by the BLE_CFG_LIB_TYPE definition value in the configuration file (r_ble_rx23w_config.h). Determine which type is used by BLE_CFG_LIB_TYPE at the time of build, rename lib_ble_ps_ccrx_x.lib (x: a or b or c) to lib_ble_ps_ccrx.lib and link.
Bluetooth Low Energy Protocol Stack Basic Package User's Manual 3. Software Structure
R01UW0205EJ0103 Rev.1.03 Page 15 of 85 Mar.30.2021

3.2 app_lib

Figure 3.4 shows the app_lib structure. Details of each are explained in “5 Original Features”.
Figure 3.4. app_lib structure
The functions provided by app_lib are described below.

3.2.1 Abstraction API

Abstraction API is an API that makes it easy to use frequently used functions in BLE Protocol Stack. Refer to R_BLE API document (r_ble_api_spec.chm) for detailed specifications of Abstraction API.

3.2.2 Software Timer

The software timer uses Compare Match Timer (CMT). When using this function, add CMT FIT module to the application. The CMT channel to be used is dynamically
allocated by FIT. Refer to “RX23W Group Bluetooth Low Energy Application Developer’s Guide (R01AN5504)
4.1 Software Timer” for details.

3.2.3 Security Data Management

Provides an interface for automatically saving bonding information to Data Flash when pairing is successful. When using this feature, set BLE_CFG_EN_SEC_DATA to “1” from the BLE FIT module component settings.
About the use of security data management, see “RX23W Group Bluetooth Low Energy Application Developer’s Guide (R01AN5504) 4.4 Security Data Management”. About data configuration of security data management, see “5.2 Security Data Management ”.
Bluetooth Low Energy Protocol Stack Basic Package User's Manual 3. Software Structure
R01UW0205EJ0103 Rev.1.03 Page 16 of 85 Mar.30.2021

3.2.4 Profile Common

The Profile Common is common functions to BLE Profile. It is called from the profile source code generated by QE for BLE.

3.2.5 Logger

Outputs a log message. The output level is set by the configuration option BLE_CFG_LOG_LEVEL. Refer to “RX23W Group Bluetooth Low Energy Application Developer’s Guide (R01AN5504) 4.3 Logger” for details.

3.2.6 Command line

The command line feature uses the BLE functions via a command input from serial. It uses Serial Communication Interface (SCI). Command types are standard commands provided by the BLE FIT module and user commands created by user. For details of standard commands and user commands, see the documents in Table 3.5.
Table 3.5.Command line reference documents
Command
Reference
Standard Specification
5.1 Command Line Interface
Usage
RX23W Group Bluetooth Low Energy Application Developer’s Guide (R01AN5504)
4.2.1 How to use the standard command
User
Creation Method
RX23W Group Bluetooth Low Energy Application Developer’s Guide (R01AN5504)
4.2.2 How to create a user command

3.2.7 LED and Switch Control

The LED and Switch Control feature controls LEDs and switches on board. About setting the BLE FIT and the
IRQ FIT configuration options to use this feature, see “RX23W Group BLE Module Firmware Integration
Technology (R01AN4860) 4.5.4 LED and Switch Control”. About how to use this feature, see “RX23W Group Bluetooth Low Energy Application Developer’s Guide (R01AN5504) 4.5 Board and LED switch”.

3.2.8 BLE Task Control

The BLE Task Control feature is enabled if a project including the BLE FIT module has “FreeRTOS” as RTOS. Another task wakes the BLE task up by this feature. About how to use it, see “RX23W Group BLE Module Firmware Integration Technology (R01AN4860) 6.4 Wake up BLE task from another task”.

Bluetooth Low Energy Protocol Stack Basic Package User's Manual 4. Software Setting

R01UW0205EJ0103 Rev.1.03 Page 17 of 85 Mar.30.2021
4. Software Setting
User can configure the BLE Application according to the purpose with the BLE FIT module.

4.1 Configuration options

Table 4.1 shows configuration options of the BLE FIT module. Configuration option settings are determined by the macro definition in r_ble_rx23w_config.h. When using Smart Configurator, configuration options can be set on the software component setting screen. The setting value is automatically reflected in r_ble_rx23w_config.h when adding a module.
Table 4.1. List of configuration options (1/8)
Configuration Options
Description
BLE_CFG_LIB_TYPE Default : "0"
Type of the BLE Protocol Stack. Select one of the followings.
0: All features 1: Balance 2: Compact
Refer to “3.1.2 BLE Protocol Stack” for details.
BLE_CFG_RF_DBG_PUB_ADDR Default : "{0xFF,0xFF,0xFF,0x50,0x90,0x74}"
Initial Public Address. If the public addresses in the Code Flash and the Data Flash are all 0x00 or 0xFF, the device adopts this public address. If all 0x00 or 0xFF is set, the device uses 74:90:50:FF:FF:FF as public address.
BLE_CFG_RF_DBG_RAND_ADDR Default : “{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}"
Initial Static Address. If the static addresses in the Code Flash and the Data Flash are all 0x00 or 0xFF, the device adopts this static address. If all 0x00 or 0xFF is set, the device uses the value generated with the device specific value the static address.
BLE_CFG_RF_CONN_MAX Default : "7"
Maximum number of simultaneous connections. Range : 1 to 7
BLE_CFG_RF_CONN_DATA_MAX Default : "251"
Maximum packet data length (bytes). Range : 27 to 251
BLE_CFG_RF_ADV_DATA_MAX Default : "1650"
Maximum advertising data length (bytes). Range : 31 to 1650
The maximum advertising data length of the BLE Protocol Stack libraries other than "All features" is fixed to 31bytes.
BLE_CFG_RF_ADV_SET_MAX Default : "4"
Maximum number of the advertising set. Range : 1 to 4
The number of the advertising set of the BLE Protocol Stack libraries other than "All features" is fixed to one.
BLE_CFG_RF_SYNC_SET_MAX Default : "2"
Maximum number of periodic sync set. Range : 1 to 2
If the BLE Protocol Stack library is other than "All features", this option is not used.
Bluetooth Low Energy Protocol Stack Basic Package User's Manual 4. Software Setting
R01UW0205EJ0103 Rev.1.03 Page 18 of 85 Mar.30.2021
Table 4.1. List of configuration options (2/8)
Configuration Options
Description
BLE_CFG_EVENT_NOTIFY_CONN_START Default : "0"
Enable or disable start interrupt notification of a connection complete event.
0: Disable 1: Enable
Because the start notification is triggered by the interrupt, it occurs after the actual RF event.
BLE_CFG_EVENT_NOTIFY_CONN_CLOSE Default : "0"
Enable or disable end interrupt notification of a connection complete event.
0: Disable 1: Enable
If the connection is terminated by a command, the notification doesn't occur.
BLE_CFG_EVENT_NOTIFY_ADV_START Default : "0"
Enable or disable the advertising event start interrupt notification.
0: Disable 1: Enable
The notification occurs at the following timings.
Start Primary Advertising channel.
Start Secondary Advertising Channel
Start Periodic Advertising. (When the Extended Advertising is
enabled.)
Because the start notification is triggered by the interrupt, it occurs after the actual RF event.
BLE_CFG_EVENT_NOTIFY_ADV_CLOSE Default : "0"
Enable or disable the advertising event complete interrupt notification.
0: Disable 1: Enable
The notification occurs at the following timings.
Complete Primary Advertising channel.
Complete Secondary Advertising Channel
Complete Periodic Advertising.(When the Extended Advertising is
enabled.)
If the advertising is terminated by a command, the notification doesn't occur.
Bluetooth Low Energy Protocol Stack Basic Package User's Manual 4. Software Setting
R01UW0205EJ0103 Rev.1.03 Page 19 of 85 Mar.30.2021
Table 4.1. List of configuration options (3/8)
Configuration Options
Description
BLE_CFG_EVENT_NOTIFY_SCAN_START Default : "0"
Enable or disable the scan start interrupt notification.
0: Disable 1: Enable
If the scan interval is equal to the scan window, this notification doesn't occur.
Because the start notification is triggered by the interrupt, it occurs after the actual RF event.
BLE_CFG_EVENT_NOTIFY_SCAN_CLOSE Default : "0"
Enable or disable the scan complete interrupt notification
0: Disable 1: Enable
If the scan interval is equal to the scan window, this notification doesn't occur.
If the scan is terminated by a command, the notification doesn't occur.
BLE_CFG_EVENT_NOTIFY_INIT_START Default : "0"
Enable or disable the notification that the scan start interrupt has occurred in sending a connection request.
0: Disable 1: Enable
If the scan interval is equal to the scan window, this notification doesn't occur.
Because the start notification is triggered by the interrupt, it occurs after the actual RF event.
BLE_CFG_EVENT_NOTIFY_INIT_CLOSE Default : "0"
Enable or disable the notification that the scan complete interrupt has occurred in sending a connection request.
0: Disable 1: Enable
If the scan interval is equal to the scan window, this notification doesn't occur.
If the connection request is terminated by a command, the notification doesn't occur.
BLE_CFG_EVENT_NOTIFY_DS_START Default : "0"
Enable or disable the RF_DEEP_SLEEP start notification.
0: Disable 1: Enable
BLE_CFG_EVENT_NOTIFY_DS_WAKEUP Default : "0"
Enable or disable the RF_DEEP_SLEEP wakeup notification.
0: Disable 1: Enable
Bluetooth Low Energy Protocol Stack Basic Package User's Manual 4. Software Setting
R01UW0205EJ0103 Rev.1.03 Page 20 of 85 Mar.30.2021
Table 4.1. List of configuration options (4/8)
Configuration Options
Description
BLE_CFG_RF_CLVAL Default : "6"
Adjustment value of the 32MHz crystal oscillator for RF part. Set this option according to the board environment. Range : 0 to 15
Refer to"RX23W Group Tuning procedure of Bluetooth dedicated clock frequency(R01AN4762)" for details.
If you select R5F523W8CxLN or R5F523W8DxLN, set “7”.
BLE_CFG_RF_DDC_EN Default : "0"
Enable or disable the DC-DC on the RF.
0: Disable 1: Enable
If you use Target Board, set “0”.
BLE_CFG_RF_EXT32K_EN Default : "0"
Slow clock source to the RF.
0: RF_LOCO 1: External 32.768kHz
If this option is set to 1, the sub clock is required to be enabled in the Smart Configurator clock configuration.
BLE_CFG_RF_MCU_CLKOUT_PORT Default : "0"
Port of the MCU CLKOUT.
0: PE3 1: PE4
If BLE_CFG_RF_EXT32K_EN option is 0, this option is ignored.
BLE_CFG_RF_MCU_CLKOUT_FREQ Default : "0"
Output frequency from the MCU CLKOUT.
0: MCU CLKOUT frequency 32.768kHz 1: MCU CLKOUT frequency 16.384kHz
If BLE_CFG_RF_EXT32K_EN option is 0, this option is ignored.
BLE_CFG_RF_SCA Default : "250"
Sleep Clock Accuracy(SCA) for the RF slow clock. Range : 0 to 500
If BLE_CFG_RF_EXT32K_EN option is 0, the SCA is fixed to more than 250 [ppm] and this option is ignored.
BLE_CFG_RF_MAX_TX_POW Default : "1"
Maximum transmit power configuration.
0: max +0dBm 1: max +4dBm
Bluetooth Low Energy Protocol Stack Basic Package User's Manual 4. Software Setting
R01UW0205EJ0103 Rev.1.03 Page 21 of 85 Mar.30.2021
Table 4.1. List of configuration options (5/8)
Configuration Options
Description
BLE_CFG_RF_DEF_TX_POW Default : "0"
Default transmit power level. Range : 0 to 2 This option depends on BLE_CFG_RF_MAX_TX_POW option.
If the BLE_CFG_RF_MAX_TX_POW option is 0 (0dBm), BLE_CFG_RF_DEF_TX_POW is as follows.
0 (High) : 0 dBm 1 (Mid) : 0 dBm 2 (Low) : -18 dBm
If the BLE_CFG_RF_MAX_TX_POW option is 1 (+4dBm), BLE_CFG_RF_DEF_TX_POW is as follows.
0 (High) : +4 dBm 1 (Mid) : 0 dBm 2 (Low) : -20 dBm
BLE_CFG_RF_CLKOUT_EN Default : "0"
CLKOUT_RF output. Select one of the followings.
0: No output 5: 4MHz output 6: 2MHz output 7: 1MHz output
BLE_CFG_RF_DEEP_SLEEP_EN Default : "1"
Enable or disable the RF Deep Sleep.
0: Disable 1: Enable
BLE_CFG_MCU_MAIN_CLK_KHZ Default : "4000"
MCU main clock frequency (kHz). This option needs to be configured according to the board environment. If the HOCO is used, this option is ignored. If the Main Clock is used, set a value within the range between 1000
and 20000. If the PLL Circuit is used, set a value within the range between 4000
and 12500. Set the clock frequency configured in the Smart Configurator clock
configuration.
BLE_CFG_DEV_DATA_CF_BLOCK Default : "16"
The Code Flash(ROM) block stored the device specific data. Range : -1 to 255
If this option is set to -1, the device specific data in the Code Flash is not used.
The blocks from "0" to "15" are the Start-Up Program Protection block. If the Start-Up Program Protection is used, don’t use the blocks from "0" to "15".
Bluetooth Low Energy Protocol Stack Basic Package User's Manual 4. Software Setting
R01UW0205EJ0103 Rev.1.03 Page 22 of 85 Mar.30.2021
Table 4.1. List of configuration options (6/8)
Configuration Options
Description
BLE_CFG_DEV_DATA_DF_BLOCK Default : "-1"
The E2 Data Flash block stored the device specific data. Range : -1 to 7
If this option is set to -1, the device specific data in the E2 DataFlash is not used.
Specify a block number different from the block number specified by BLE_CFG_SECD_DATA_DF_BLOCK.
BLE_CFG_GATT_MTU_SIZE Default : "247"
The MTU size (bytes) for the GATT communication. Range : 23 to 247
BLE_CFG_NUM_BOND Default : "7"
Maximum number of the bonding information stored in the Data Flash. Range : 1 to 7
BLE_CFG_EN_SEC_DATA Default : "0"
Enable or disable the security data management. The bonding information is stored in the Data Flash block specified by
BLE_CFG_SECD_DATA_DF_BLOCK by this option.
0: Disable 1: Enable
If this option is enabled, add the Data Flash FIT module.
BLE_CFG_SECD_DATA_DF_BLOCK Default : "0"
The Data Flash block for the security data management to store the bonding information.
Range : 0 to 7
Specify a block number different from the block number specified by BLE_CFG_DEV_DATA_DF_BLOCK.
BLE_CFG_CMD_LINE_EN Default : "0"
Enable or disable the command line function.
0: Disable 1: Enable
If this option is enabled, add the SCI FIT module.
Loading...
+ 67 hidden pages