STMicroelectronics UM2295 User Manual

Introduction
BlueNRG-Mesh connects multiple BLE (Bluetooth Low Energy) devices in Mesh networking for IoT (Internet of Things) solutions. It integrates BlueNRG products with embedded Bluetooth Low Energy communication in a powerful, range-extending Mesh network with true full-duplex communication.
The solution contains the core functionality for secure communication and provides the flexibility you need to build applications. It uses BlueNRG-2, BlueNRG-1, BlueNRG-MS devices with Mesh stack APIs and related event callbacks. The SDK provides the Mesh stack in library form and a sample application in source code to demonstrate how to use the library.
, to create distributed control systems such as:
smart lighting
home and building automation
industrial automation
A demo example is available for the device evaluation boards. You can use it to change the application interface and use the library for the required hardware and software functionalities. The demo application is available for the following evaluation boards:
STEVAL-IDB008V1 and STEVAL-IDB008V2 for BlueNRG-2
STEVAL-IDB007V1 for BlueNRG-1
X-NUCLEO-IDB05A1 and NUCLEO-L152RE for BlueNRG-MS
The sample application implements Smart Light control scenario, which you may modify according to your requirements.
Getting started with the ST BlueNRG-Mesh embedded firmware
UM2295
User manual
UM2295 - Rev 1 - February 2018 For further information contact your local STMicroelectronics sales office.
www
.st.com
1 Getting started
The sample application implements a smart lighting control scenario. To modify the application, you need to follow the sequence below
.
Step 1. Connect the board to the PC
Step 2. Compile the firmware in IDE
Step 3. Flash the firmware to the board
Step 4. Provision the board in the BlueNRG-Mesh app
Step 5. T
oggle LED on board using the app
1.1 Hardware requirements
The following boards can be used for evaluation of the ST BlueNRG-Mesh solution.
T
able 1.
Hardware requirements
Devices Evaluation boards Description
BlueNRG-2 STEVAL-IDB008V1 and
STEVAL-IDB008V2
Evaluation platform based on the BlueNRG-2
BlueNRG-1
STEVAL-IDB007V1 Evaluation platform based on the BlueNRG-1
BlueNRG-MS X-NUCLEO-IDB05A1 Bluetooth Low Energy expansion board based on the SPBTLE-RF module
for STM32 Nucleo
NUCLEO-L152RE STM32 Nucleo-64 development board with the STM32L152RE MCU,
supports Arduino™ and ST morpho connectivity
1.2 Board interfaces
The following table explains the details of the evaluation boards for the power requirement, programming and user interface, for example LEDs and buttons.
Table 2. Evaluation board details
Devices Evaluation
boards
Powered by Programmed by LEDs Buttons
BlueNRG-2 STEVAL-
IDB008V1 and
STEVAL-
IDB008V2
Micro-B
USB Cable
Or AAA x 2 battery
External ST
-LINK/V2 or
USB port
3x user LEDs +1
power indication
Reset button + 2 x
user buttons
BlueNRG-1 STEVAL-
IDB007V1
Micro-B USB cable
or AAA x 2 battery
External ST-LINK/V2 or
USB port
3x user LEDs +1
power indication
Reset button +2 x
user buttons
BlueNRG-MS X-NUCLEO-
IDB05A1
Mini-USB cable In-Built STLINK on the
STM32 Nucleo board
1 user LED +1
power indication
Reset button + 1 x
user buttons
NUCLEO-
L152RE
1.3 STEVAL-IDB008V1 or STEVAL-IDB008V2 BlueNRG2 board setup
To connect the STEV
AL-IDB008V1 or
STEVAL-IDB008V2 (BlueNRG-2 evaluation board) and PC, a USB port is
required to provide power supply to the board. To connect the ST-Link/V2 debugger, an additional USB port is needed.
UM2295
Getting started
UM2295 - Rev 1
page 2/35
Note: The BlueNRG-2 device on these boards is clocked at 32 MHz XT
AL. These settings are performed in project
configurations.
Figure 1. Connection between the STEV
AL-IDB008V1 or STEV
AL-IDB008V2 and PC
RELATED LINKS
4.1 BlueNRG cold start configuration on page 14
1.4 STEVAL-IDB007V1 BlueNRG1 board setup
To connect the STEV
AL-IDB007V1 (
BlueNRG-1 evaluation board) and PC, one USB port is required to provide
power supply to the board. To connect the ST-Link/V2 debugger, an additional USB port is needed.
Note: Please note that the BlueNRG-1 on this evaluation board is clocked by 16 MHz XTAL. These settings are
performed in project configurations.
UM2295
STEVAL-IDB007V1 BlueNRG1 board setup
UM2295 - Rev 1
page 3/35
Figure 2. Connection between the STEV
AL-IDB007V1 and PC
RELATED LINKS
4.1 BlueNRG cold start configuration on page 14
1.5 NUCLEO-L152RE plus X-NUCLEO-IDB05A1 board setup
Connect the STM32 NUCLEO-L152RE +
X-NUCLEO-IDB05A1 (BlueNRG-MS board) thanks to a USB cable. The
USB cable is used for two purposes:
1. Providing power supply to the NUCLEO-L152RE + X-NUCLEO-IDB05A1 board
2. Helping in serial communication of data between the PC and the boards NUCLEO-L152RE + X-NUCLEO-
IDB05A1
The STM32 NUCLEO-L152RE board integrates the ST-LINK/V2-1 debugger/ programmer. You can download the relevant version of the STSW-LINK009 ST-LINK/V2-1 USB driver (according to your version of Windows).
Note: Ensure that BlueNRG-MS is updated with BLE stack version 7.2 c or higher. You can use BlueNRG GUI to
manage the update.
UM2295
NUCLEO-L152RE plus X-NUCLEO-IDB05A1 board setup
UM2295 - Rev 1
page 4/35
Figure 3. STM32 NUCLEO-L152RE plus X-NUCLEO-IDB05A1 connection with PC
1.6 System requirements
The minimum requirements to set up the software environment and run the BlueNRG-Mesh smart lighting application are:
PC with Intel or AMD processor running one of the following Microsoft operating systems: Win XP SP3 Vista/
Windows 7
At least 128 MB of RAM
2 x USB ports
UM2295
System requirements
UM2295 - Rev 1
page 5/35
40 MB of hard disk space
Development toolchains and compilers:
Keil µV
ision v5.23
IAR Embedded Workbench v7.80.4
Please read the system requirements and setup information provided by the IDE provider.
1.7 Installing STSW-BNRG-Mesh
1. Extract the contents of the package in a temporary directory
2.
Launch the installer and follow the on-screen instructions
3. Install in suitable folder in your disk-drive
UM2295
Installing STSW-BNRG-Mesh
UM2295 - Rev 1
page 6/35
2 Firmware structure
Figure 4. Firmware architecture
Applications
Middleware
Drivers
U t i l i t i e s
C M S I S
Hardware Abstraction
Layer API
LED light demo
Custom applications
Cryptographic
library
BlueNRG-Core
stack
BlueNRG-Mesh
library
Board Support
Packages
NUCLEO-L152RE
X-NUCLEO-IDB05A1
BlueNRG-MS
STEVAL-IDB007V1
STEVAL-IDB008V1/V2
H a r d w a r e
BlueNRG-2
BlueNRG-1
The following folders are included in the package firmware folder:
A Documentation folder with a compiled HTML file generated from the source code and detailed
documentation of the software components and APIs.
A Drivers folder with HAL drivers and specific drivers for supported boards, hardware platforms, and
components, and the CMSIS vendor-independent hardware abstraction layer for the Cortex-M processor series.
A Middleware folder with libraries for Mesh and BLE communication.
Horizontal interaction between layer components is handled directly by calling the feature APIs, while vertical interaction with the low level drivers is managed through specific callbacks and static macros implemented in the library system call interface.
A Projects folder contains the workspaces for IAR Embedded Workbench and Keil µVision integrated
development environments for the STEVAL-IDB008V1, STEVAL-IDB007V1 board and NUCLEO-L152RE plus X-NUCLEO-IDB05A1 board.
The EWARM folder contains the workspace for IAR Embedded Workbench and MDK-ARM folder contains the workspace for Keil µVision.
The source files in the folder bind the firmware layers to implement the functions that demonstrate Mesh over BLE functionality.
UM2295
Firmware structure
UM2295 - Rev 1
page 7/35
Figure 5. Folders, sub-folders and contents of the package
2.1 Root folder
The figure below shows the root folder structure of the firmware package.
Figure 6. Root folder structure
2.2 Driver folder
This folder contains all low level drivers including peripheral drivers and HAL drivers corresponding to the hardware.
UM2295
Root folder
UM2295 - Rev 1
page 8/35
Figure 7. Driver folder
2.3 Project folder
This folder contains the projects for IAR and Keil.
Figure 8. Project folder
2.4 Middleware folder
This folder contains the middleware for the project including pre-compiled Mesh library for the BlueNRG-2,
BlueNRG-1 and BlueNRG-MS + STM32L1.
UM2295
Project folder
UM2295 - Rev 1
page 9/35
Figure 9. Middleware folder
UM2295
Middleware folder
UM2295 - Rev 1
page 10/35
3 Using the BlueNRG-Mesh demo
IAR Embedded Workbench and Keil µVision are used to debug and burn the firmware into the flash memory of the STEV
AL-IDB008V1, STEV
AL-IDB007V1 and NUCLEO-L152RE+ X-NUCLEO-IDB05A1 boards.
3.1 Using binaries for BlueNRG-1 and BlueNRG-2
1. The pre-compiled binaries are available in Project\<Platform>\Application\<Demo>\Binary folder.
For example for BlueNRG-1, the path is “Projects\BlueNRG-1\Applications\Lighting_Demo\Binary”
2.
These can be programmed in the device using different utilities available for the devices, such as the BlueNRG-1 Flasher tool or ST-LINK Utility
3. Use "BlueNRG-1 Flasher" tool to program the (STEVAL-IDB007V1 or STEVAL-IDB008V1) boards
connected via micro-USB cable
4. Use "STSW-BNRG1STLINK: BlueNRG-1 ST-LINK utility for BlueNRG-1, BlueNRG-2 MCU” utility to program
boards via ST-LINK
Figure 10. Binaries for BlueNRG-1 and BlueNRG-2
3.2 Using binaries for the STM32L152 used with the BlueNRG-MS
1. The pre-compiled binaries are available in Project\<Platform>\Application\<Demo>\Binary folder
For example, for
BlueNRG-MS, the path is “Projects\BlueNRG-MS\Applications\Lighting_Demo\Binary
\STM32L152RE-Nucleo”
2. These can be programmed in the device using different utilities
3. Use “ST-LINK Utility” tool to program the boards (NUCLEO-L152RE) connected via mini-USB cable
4. Or, simply drag and drop the .bin file in the drive created by ST-LINK on the STM32 Nucleo board. The
binary will be programmed in the STM32L152 device on the Nucleo board
UM2295
Using the BlueNRG-Mesh demo
UM2295 - Rev 1
page 11/35
Loading...
+ 24 hidden pages