Page 1
UM1870 User manual BlueNRG-MS development kits Introduction This document describes the BlueNRG-MS development kits and related hardware and ® software components. The BlueNRG-MS is a very low power Bluetooth low energy (BLE) single-mode network processor, compliant with Bluetooth specifications core 4.1. The BlueNRG-MS can support multiple roles simultaneously.
UM1870 Getting started Getting started This section describes all the software and hardware requirements for running the BlueNRG-MS GUI utility as well as the related installation procedure. STEVAL-IDB005V1 kit contents This kit is composed of the following items: • 1 development motherboard •...
Getting started UM1870 BlueNRG-MS development kit setup • Extract the content of the BlueNRG_DK_-x.x.x-Setup.zip file into a temporary directory. • Launch the BlueNRG-DK-x.x.x-Setup.exe file and follow the on-screen instructions. Note: EWARM Compiler 6.60 version is required for building the BlueNRG_DK_x.x.x demonstration applications.
UM1870 Hardware description Hardware description The following sections describe the components of the kits. STEVAL-IDB005V1 motherboard The motherboard included in the development kit allows testing of the functionality of the BlueNRG-MS processor. The board can be used as a simple interface between the BlueNRG-MS and a GUI application on the PC.
Hardware description UM1870 2.1.1 Microcontroller and connections The board features an STM32L151RB microcontroller, which is an ultra low-power microcontroller with 128 KB of Flash memory, 16 KB of RAM, 32-bit core ARM cortex-M3, 4 KB of data EEPROM, RTC, LCD, timers, USART, I C, SPI, ADC, DAC and comparators.
Page 9
UM1870 Hardware description Table 1. MCU pin description versus board function (continued) Board function Buttons / Temp. Ext. name LEDs DB connector Acceler. JTAG joystick sensor conn JOY_RIGHT PB10 INT1 PB11 INT2 VSS_1 VDD_1 PB12 DB_CSN PB13 DB_SCLK PB14 DB_SDO...
Figure 2.1.6 JTAG connector A JTAG connector on the board (H in Figure 2) allows the programming and debugging of the STM32L microcontroller on board , using an in-circuit debugger and programmer such as the ST-LINK/V2. 10/58 DocID027602 Rev 1...
UM1870 Hardware description 2.1.7 LEDs Five LEDs are available (I in Figure – DL1: green – DL2: orange – DL3: red – DL4: blue – DL5: yellow 2.1.8 Daughterboard interface The main feature of the motherboard is the capability to control an external board,...
Hardware description UM1870 BlueNRG-MS daughterboard The BlueNRG-MS daughterboard (Figure 3) included in the development kit is a small circuit board to be connected to the main board. It contains the BlueNRG-MS network processor (in a QFN32 package), an SMA antenna connector, discrete passive components...
UM1870 Hardware description Table 2. Connections between BlueNRG-MS board and motherboard on left connector J4 motherboard J3 daughterboard DB_PIN1 DB_PIN3 DB_PIN2 U2 pin 1 DB_SDN_RST U2 pin 1 Table 3. Connections between BlueNRG-MS board and motherboard on right connector J5 motherboard...
GUI software description UM1870 GUI software description The BlueNRG-MS GUI included in the software package is a graphical user interface that can be used to interact and evaluate the capabilities of the BlueNRG-MS network processor. This utility can send standard and vendor-specific HCI commands to the controller and receive events from it.
UM1870 GUI software description 3.2.1 GUI main window Figure 4. BlueNRG-MS GUI main window The BlueNRG-MS GUI main window is characterized by different zones. Some of these zones can be resized. Port and interface selection The uppermost zone allows the user to open the COM port associated to the BLE controller.
Page 16
GUI software description UM1870 Figure 5. Command packet table The command packet table contains four columns: • Parameter: name of the packet field as they are named in volume 2, part E of Bluetooth specification. • Value: field value represented in hexadecimal format (right-click on a cell to change its representation format).
UM1870 GUI software description Figure 7. Raw packet dump Some events (displayed in yellow cells) can provide other information. HCI packets sent towards the BLE controller are displayed in gray cells while received packets are shown inside white cells. The Sent/received packets table can be cleared by clicking on clear list button. Update and...
Page 18
GUI software description UM1870 • C view: displays the C language structure related to the IFR configuration data region matching the View/Edit and Memory view. Figure 8. BlueNRG GUI IFR tool: View/Edit view In the View/Edit view, the following operations are available: •...
Page 19
UM1870 GUI software description • Change HS startup time parameter. This parameter control the time offset between the wakeup of the device and the start of RX/TX phase. It must be big enough to allow the device to be ready to transmit or receive after wakeup from sleep. This time depends on the startup time of the high speed crystal.
GUI software description UM1870 Go to Settings --> select FW 7.1 for BlueNRG-MS device Go to Settings --> select Set Baud Rate… and choose the value (default is 9600) 3.2.3 GUI scripts window The BlueNRG-MS GUI scripts window provides several tabs to allow testing of some BlueNRG-MS application scenarios.
Page 21
UM1870 GUI software description Table 4. GUI scripts window: available general operations Operation Associated actions Notes Allows to initialize a device by selecting: - Role - Stack Mode (1,2,3); Init Device… - Address type (Public, Random) and value - Tx power level...
Page 22
GUI software description UM1870 Table 5. GUI scripts window: available central operations Operation Associated actions Notes Allows to put device in scanning mode by selecting: - GAP Procedure (Limited, general, general-connection establishment and terminate general-connection establishment procedures) Scanning - Enable or Disable filters...
Page 23
UM1870 GUI software description Table 6. GUI Scripts window: available peripheral operations Operation Associated actions Notes Allows to put a Peripheral device in Advertising mode by selecting: - Discoverable mode (limited, non discoverable and general discoverable) - Type (ADV_IND, ADV_SCAN_IND,...
Page 24
GUI software description UM1870 Figure 10. BlueNRG-MS GUI script engine section Moreover, the script engine supports other utility commands: Table 7. GUI script engine: utility commands Command name Parameters Description HW_BOOTLOADER None Hardware bootloader activation HW_RESET None HW reset Open a message window and show the input...
Page 25
UM1870 GUI software description Table 7. GUI script engine: utility commands (continued) Command name Parameters Description Convert the integer value to an array of Number of bytes. Example: Integer, Number of GET_LIST bytes X = 0x2233 GET_LIST(X, 2) = [0x33,0x22]...
Page 26
GUI software description UM1870 Table 8. WAIT_EVENT macro-command Command name Parameters Description event_code = None (default) It waits an event with ‘Event Code’ parameter timeout = None (default) equal to event_code. If no event_code is continueOnEvtMiss = False WAIT_EVENT indicated, the macro-command waits any event.
Page 28
GUI software description UM1870 Table 9. WAIT_EVENT: event_code types (continued) event param. event_code event parameter name name HCI_DISCONNECTION_COMP LETE HCI_ENCRYPTION_CHANGE HCI_READ_REMOTE_VERSIO N_INFORMATION_COMPLETE HCI_COMMAND_COMPLETE HCI_COMMAND_STATUS HCI_HARDWARE_ERROR HCI_NUMBER_OF_COMPLET ED_PACKETS HCI_DATA_BUFFER_OVERFL HCI_ENCRYPTION_KEY_REF RESH_COMPLETE Below are some code examples using the WAIT_EVENT() macro-command: Example 1...
Page 29
UM1870 GUI software description Example 3 # Wait HCI_VENDOR event_code evt = WAIT_EVENT(HCI_VENDOR) #Using evt.get_param('Ecode').val it's possible to verify the type of HCI_VENDOR #event. evtCode = evt.get_param('Ecode').val if (evtCode == EVT_BLUE_GATT_NOTIFICATION): conn_handle=evt.get_param('Connection_Handle').val Example 4 # Wait the Ecode EVT_BLUE_GATT_PROCEDURE_COMPLETE (HCI_VENDOR #event_code).
GUI software description UM1870 In the BlueNRG-MS GUI, Scripts window, Script Engine section, click on tab “…”, browse to the script location and select the script Click on the “Run Script” tab to run the script. The execution flow (commands and events) will be displayed in the BlueNRG-MS GUI “Sent/Received Packets”...
Page 31
UM1870 GUI software description Table 10. BlueNRG GUI beacon window configuration parameters Data field Description Notes Address Device address Public or Random Device address type Company Identifier Code SIG company identifier Default is 0x0030 (STMicroelectronics) Beacon ID Fixed value Used to distinguish specific beacons...
Programming with BlueNRG-MS network processor UM1870 Programming with BlueNRG-MS network processor The BlueNRG-MS provides a high level interface to control its operation. This interface is called ACI (application-controller interface). The ACI is implemented as an extension to the standard Bluetooth HCI interface. Since BlueNRG-MS is a network processor, the stack runs inside the device itself.
UM1870 BlueNRG-MS sensor profile demo BlueNRG-MS sensor profile demo The software development kit contains an example, which implements a proprietary Bluetooth profile: the sensor profile. This example is useful for building new profiles and applications that use the BlueNRG-MS network processor. This GATT profile is not compliant to any existing specification.
BlueNRG-MS sensor profile demo UM1870 Figure 13. BlueNRG-MS sensor demo GATT database Supported platforms The BlueNRG-MS sensor profile demo is supported only on the BlueNRG-MS development platform (STEVAL-IDB005V1). BlueNRG-MS app for smartphones An application is available for smartphones (iOS and android), that works with the sensor profile demo.
UM1870 BlueNRG-MS sensor profile demo Figure 14. BlueNRG-MS app BlueNRG-MS sensor profile demo: connection with a central device This section describes how to interact with a central device, while BlueNRG-MS is acting as a peripheral. The central device can be another BlueNRG-MS acting as a master, or any other Bluetooth smart or smart-ready device.
BlueNRG-MS sensor profile demo UM1870 Security_Permissions=0x00, GATT_Evt_Mask=0x01, Enc_Key_Size=0x07, Is_Variable=0x01) With this command a variable-length characteristic has been added, with read, write and notify properties. The characteristic handle is also returned (Char_Handle). 5.3.3 Set security requirements BlueNRG-MS exposes a command that the application can use to specify its security requirements.
UM1870 BlueNRG-MS sensor profile demo BlueNRG-MS can send notifications of the characteristic that has been previously added, with UUID 0xA002 (after notifications have been enabled). This can be done using the following command: – ACI_GATT_UPD_CHAR_VALUE(Service_Handle=0x000C, Char_Handle=0x000D, Val_Offset=0, Char_Value_Length=0x05, Char_Value='hello') Once this ACI command has been sent, the new value of the characteristic will be displayed on the phone.
BlueNRG-MS sensor profile demo UM1870 5.4.2 Discovery a sensor peripheral device In order to discover a Sensor Peripheral device, a discovery procedure has to be started with the master library command: – Master_DeviceDiscovery(&devDiscParam); devDiscParam variable allows to set the discovery parameters (discovery procedure, interval, window, …).
UM1870 BlueNRG-MS sensor profile demo 5.4.5 Enable sensor peripheral acceleration and free fall notifications Once the Sensor Peripheral device sensor acceleration and free fall characteristics have been discovered, the Sensor Central device can enable the related characteristics notification by using the following master library command: –...
BlueNRG-MS chat demo application UM1870 BlueNRG-MS chat demo application The software development kit contains another example, which implements a simple 2-way communication between two BlueNRG-MS devices. It shows a simple point-to-point wireless communication using the BlueNRG-MS product. This demo application exposes one service: chat service.
UM1870 BlueNRG-MS chat demo application First, BlueNRG-MS must be set up on both devices. In order to do this, a series of ACI commands need to be sent to the processor. 6.2.1 Initialization BlueNRG-MS’s stack must be correctly initialized before establishing a connection with another Bluetooth LE device.
BlueNRG-MS chat demo application UM1870 initiated by the central in order to access that characteristic. On BLE chat demo, a fixed pin (123456) is used as follows: aci_gap_set_auth_requirement(MITM_PROTECTION_REQUIRED,OOB_AUTH_DATA_AB SENT,NULL,7,16, USE_FIXED_PIN_FOR_PAIRING,123456,BONDING); 6.2.4 Enter connectable mode On BLE chat, server role device uses GAP ACI commands to enter into general...
Page 43
UM1870 BlueNRG-MS chat demo application Figure 16. BLE chat client example Figure 17. BLE chat server example DocID027602 Rev 1 43/58...
BlueNRG-MS Beacon demonstration application UM1870 BlueNRG-MS Beacon demonstration application The software development kit contains another example, which shows how to configure a BlueNRG-MS device to advertise specific manufacturing data and allow another BLE device to know if it is in the range of the BlueNRG-MS beacon device.
UM1870 BlueNRG-MS Beacon demonstration application 7.2.3 Entering non-connectable mode The BLE Beacon device uses the GAP ACI command to enter non-connectable mode as follows: aci_gap_set_discoverable(ADV_NONCONN_IND, 160, 160, PUBLIC_ADDR, NO_WHITE_LIST_USE,0, NULL, 0, NULL, 0, 0); In order to advertise the specific selected manufacturer data, the BLE Beacon application...
BLE remote control demo application UM1870 BLE remote control demo application This demo application shows how to control a remote device (like an actuator) using a BlueNRG-MS device.This application periodically sends broadcast data (temperature values) that can be read by any device. The broadcast data is encapsulated in a manufacturer-specific AD type.
UM1870 BLE remote control demo application BLE remote control application setup This section describes how to configure a BlueNRG-MS device to acting as a remote control device. 8.2.1 Initialization The BlueNRG-MS's stack must be correctly initialized before establishing a connection with another Bluetooth LE device.
BLE remote control demo application UM1870 #else ret = aci_gatt_add_char(RCServHandle, UUID_TYPE_128, controlPointUuid, 1, CHAR_PROP_READ|CHAR_PROP_WRITE|CHAR_PROP_WRITE_WITHOUT_RESP, ATTR_PERMISSION_NONE, GATT_NOTIFY_ATTRIBUTE_WRITE, 16, 1, &controlPointHandle); #endif Where controlPointUuid is the private characteristic 128-bit UUID allocated for BLE Remote Control characteristic (ed0efb1a-9b0d-11e4-89d3-123b93f75cba). If security is enabled, the characteristic properties must be set accordingly to enable authentication on controlPointUuid characteristic read and write.
UM1870 List of acronyms List of acronyms Table 13. List of acronyms used in this document Term Meaning Bluetooth low energy Information register Universal serial bus DocID027602 Rev 1 49/58...
UM1870 Revision history Revision history Table 14. Document revision history Date Revision Changes 14-May-2015 Initial release DocID027602 Rev 1 57/58...
Page 58
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.
Need help?
Do you have a question about the UM1870 and is the answer not in the manual?
Questions and answers