STMicroelectronics UM2295 User Manual
STMicroelectronics UM2295 User Manual

STMicroelectronics UM2295 User Manual

St bluenrg-mesh embedded firmware
Table of Contents

Advertisement

Quick Links

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,
the Mesh stack in library form and a sample application in source code to demonstrate how to use the library.
BlueNRG-Mesh can be used in several applications requiring infrequent data transfer in a mesh network over Bluetooth Low
Energy, 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-IDB007V1
for
X-NUCLEO-IDB05A1
and
The sample application implements Smart Light control scenario, which you may modify according to your requirements.
UM2295 - Rev 1 - February 2018
For further information contact your local STMicroelectronics sales office.
Getting started with the ST BlueNRG-Mesh embedded firmware
BlueNRG-MS
devices with Mesh stack APIs and related event callbacks. The SDK provides
STEVAL-IDB008V2
for
BlueNRG-2
BlueNRG-1
NUCLEO-L152RE
for
BlueNRG-MS
UM2295

User manual

www.st.com

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the UM2295 and is the answer not in the manual?

Questions and answers

Summary of Contents for STMicroelectronics UM2295

  • Page 1: User Manual

    • STEVAL-IDB007V1 BlueNRG-1 • X-NUCLEO-IDB05A1 NUCLEO-L152RE BlueNRG-MS The sample application implements Smart Light control scenario, which you may modify according to your requirements. UM2295 - Rev 1 - February 2018 www.st.com For further information contact your local STMicroelectronics sales office.
  • Page 2: Getting Started

    STEVAL-IDB008V1 or STEVAL-IDB008V2 BlueNRG2 board setup To connect the STEVAL-IDB008V1 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 - Rev 1 page 2/35...
  • Page 3: Steval-Idb007V1 Bluenrg1 Board Setup

    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 - Rev 1 page 3/35...
  • Page 4: Nucleo-L152Re Plus X-Nucleo-Idb05A1 Board Setup

    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 manage the update. UM2295 - Rev 1 page 4/35...
  • Page 5: System Requirements

    • 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 - Rev 1 page 5/35...
  • Page 6: Installing Stsw-Bnrg-Mesh

    Please read the system requirements and setup information provided by the IDE provider. Installing STSW-BNRG-Mesh Extract the contents of the package in a temporary directory Launch the installer and follow the on-screen instructions Install in suitable folder in your disk-drive UM2295 - Rev 1 page 6/35...
  • Page 7: Firmware Structure

    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 - Rev 1 page 7/35...
  • Page 8: Root Folder

    The figure below shows the root folder structure of the firmware package. Figure 6. Root folder structure Driver folder This folder contains all low level drivers including peripheral drivers and HAL drivers corresponding to the hardware. UM2295 - Rev 1 page 8/35...
  • Page 9: Project Folder

    This folder contains the projects for IAR and Keil. Figure 8. Project folder Middleware folder This folder contains the middleware for the project including pre-compiled Mesh library for the BlueNRG-2, BlueNRG-1 BlueNRG-MS + STM32L1. UM2295 - Rev 1 page 9/35...
  • Page 10: Figure 9. Middleware Folder

    UM2295 Middleware folder Figure 9. Middleware folder UM2295 - Rev 1 page 10/35...
  • Page 11: Using The Bluenrg-Mesh Demo

    Use “ST-LINK Utility” tool to program the boards (NUCLEO-L152RE) connected via mini-USB cable 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 - Rev 1 page 11/35...
  • Page 12: Using The Iar And Keil Projects

    A project opens in the workspace. This project contains the information regarding your project files and folders (driver files, application files, middleware, output files, etc.). Build the program with Project→Make Option. Press (download and debug) button to debug the code and flash it to the board. UM2295 - Rev 1 page 12/35...
  • Page 13: Using Keil Project

    To build the program, select Project→Build Target or simply click on the Build Target icon. To debug the program, select Debug→Start/Stop Debug Session or click on the Start/Stop Debug Session icon. To flash the program to the flash memory on the board click on the icon. UM2295 - Rev 1 page 13/35...
  • Page 14: Firmware Initialization And Configuration

    Setting the transmit power of a node You can define the transmit power of a node by initializing a callback to the Mesh library. It runs in the following manner: Appli_BleStackInitCb, Appli_BleSetTxPowerCb, Appli_BleGattConnectionCompleteCb, Appli_BleGattDisconnectionCompleteCb, Appli_BleUnprovisionedIdentifyCb, UM2295 - Rev 1 page 14/35...
  • Page 15: Uart Interface On The Firmware

    Address = [%02x]:[%02x]:[%02x]:[%02x]:[%02x]:[%02x] \n\r",bdaddr[5],bdaddr[4],bdaddr[3],bdaddr[2],bdaddr[1],bdaddr[0] ); #endif After the board is connected and the terminal window is opened, press the reset button. If the firmware starts successfully, the following messages are printed to the virtual com window UM2295 - Rev 1 page 15/35...
  • Page 16: Mac Address Management

    LEDs Buttons LEDs Mesh Lib error DL3 Blinks continuously LD2 Blinks continuously Mesh Lib library 2 Blinks on DL3 NO Blinks successful start Provisioning DL3 Blinks for few times DL3 Blinks for few times UM2295 - Rev 1 page 16/35...
  • Page 17: Initialization Of Application Callbacks

    API to initialize the BlueNRG-1 device vector table, interrupt SystemInit() priorities and clock. The initialization is run similarly for the BlueNRG-MS platform. Step 2. Call the API to check the validity of the MAC address. Appli_CheckBdMacAddr() UM2295 - Rev 1 page 17/35...
  • Page 18 BLE communication. BLE_StackTick() Any application implementation shall be performed in the state-machine by non-blocking functions with frequent calls to BluenrgMesh_Process(). Step 11. Check for user-inputs or buttons regularly for any action to take. UM2295 - Rev 1 page 18/35...
  • Page 19: Mesh Networking Information

    Provisioning process The process of configuring a devices in a network is called provisioning. The process is started by a “Provisioner”, which is a BlueNRG-Mesh app running on the smartphone. UM2295 - Rev 1 page 19/35...
  • Page 20: Figure 16. Provisioning Process

    BlueNRG-Mesh user manual for your device type (Android or iOS) on www.st.com . The steps required for the provisioning are shown in the figure below. UM2295 - Rev 1 page 20/35...
  • Page 21: Gatt Connection/Disconnection Node

    For example: in the example project, for BlueNRG-1 and BlueNRG-2, a LED indication (LED2) is used to show the proxy connection. RELATED LINKS 5.3 Provisioning process on page 19 UM2295 - Rev 1 page 21/35...
  • Page 22: Write Command From Remote Node

    Mesh Library Mesh Library Destination Source The response data from the node is sent via the function. SendResponse Application functions and callbacks The following section explains the different APIs available for the user application. UM2295 - Rev 1 page 22/35...
  • Page 23: User Interface And Indications

    Function calls when a button is pressed for long duration Input parameter Void Output parameter Void Table 8. Appli_UpdateButtonState Function Description Prototype Void Appli_UpdateButtonState(int isPressed) Behaviour description Updates the button status Input parameter int isPressed Output parameter Void UM2295 - Rev 1 page 23/35...
  • Page 24: Device Ble Configuration Type Interface

    This function is called when GATTDisconnection is detected by the node. The application can use this callback to indicate to the user that node is no longer connected to the smartphone Input parameter None UM2295 - Rev 1 page 24/35...
  • Page 25: Network Data Communication Functions

    MOBLE_RESULT status of result Table 14. Appli_ReadLocalDataCb Function Description Prototype MOBLE_RESULT Appli_ReadLocalDataCb(MOBLE_ADDRESS peer_addr, MOBLE_ADDRESS dst_peer, MOBLEUINT8 command, MOBLEUINT8 const *data, MOBLEUINT32 length, MOBLEBOOL response) Behaviour description Callback function invoked when some data are required from node UM2295 - Rev 1 page 25/35...
  • Page 26: Mac Address Configuration

    Table 16. Appli_GetMACfromUniqueNumber Function Description Prototype #ifndef EXTERNAL_MAC_ADDR_MGMT static void Appli_GetMACfromUniqueNumber(void) Behaviour description Reads the unique serial number of the device and generates the MAC address from it Input parameter Void Output parameter Void UM2295 - Rev 1 page 26/35...
  • Page 27: A References

    UM2295 References References Table 17. References Name Title/description Bluetooth specifications Specification of the Bluetooth system (v4.0, v4.1, v4.2, v5.0) Bluetooth specifications Mesh profile specifications v1.0 UM2295 - Rev 1 page 27/35...
  • Page 28: B Licensing And Other Information

    • Developer-friendly license terms • Initial BlueNRG-Mesh is built over Motorola’s Mesh Over Bluetooth Low Energy (MoBLE) technology. The present solution is developed and maintained for both Mesh library and Applications solely by STMicroelectronics. UM2295 - Rev 1 page 28/35...
  • Page 29: Revision History

    UM2295 Revision history Table 18. Document revision history Date Revision Changes 09-Feb-2018 Initial release UM2295 - Rev 1 page 29/35...
  • Page 30: Table Of Contents

    Local and remote concept............19 UM2295 - Rev 1...
  • Page 31 Acronyms and abbreviations ............34 UM2295 - Rev 1...
  • Page 32: List Of Figures

    Read command from a remote node ........... . 22 UM2295 - Rev 1...
  • Page 33: List Of Tables

    Acronyms and abbreviations ............34 UM2295 - Rev 1...
  • Page 34: Acronyms And Abbreviations

    Bluetooth Low Energy Board support package Device firmware upgrade Graphical user interface Hardware abstraction layer Hardware Integrated development environment Light emitting diode Microcontroller unit MoBLE Mesh over Bluetooth Low Energy System-on-chip Universal serial bus UM2295 - Rev 1 page 34/35...
  • Page 35 IMPORTANT NOTICE – PLEASE READ CAREFULLY STMicroelectronics NV and its subsidiaries (“ST”) reserve the right to make changes, corrections, enhancements, modifications, and improvements to ST products and/or to this document at any time without notice. Purchasers should obtain the latest relevant information on ST products before placing orders. ST products are sold pursuant to ST’s terms and conditions of sale in place at the time of order acknowledgement.

Table of Contents