Home
BlueNRG-MS development kits
Contents
1. exem Test 5 09 02 29 707 ACI BLUE INITIALIZED EVENT 7 09 02 29 798 COMMAND COMPLETE EVENT 09 02 43 538 COMMAND COMPLETE EVENT TRANSMITTER RECEIVER V High Power 7 48dBm v Frequency 2402 MHz Channel 0 2402 MHz Channel 0 Start Receiver 4676 LengthofData 0x25 Packet Payload 0x00 Pseudo Random bit sequence 9 Packet Transmitted 4676 Packet Transmitted Packet Received 4676 Start Transmitter 0 Packet Error Rate 0 0 Start Tone 8 Clear List V Update Autoscroll Send Sent Received Packets Packet Details N Time Type Parameter Value Literal Info DoclD027602 Rev 2 UM1870 Programming with BlueNRG MS network processor 4 4 1 4 2 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 interface Since BlueNRG MS is a network processor the stack runs inside the device itself Hence no library is required on the external microcontroller except for profiles and all the functions needed to communicate with the BlueNRG MS SPI interface The develo
2. Crystal selection Power Management HS crystal Q 10 uH SMPS inductor Force SMPS Off LS source 32 768 kHz crystal 7 4 7 uH SMPS inductor Configuration Data Day Month Year Stack Mode Mode 2 Large DB 1 connection 11 2 x HS startup Slave SCA 100 ppm Master SCA 100 ppm LS Crystal Period 0x190000 LS Crystal Freq 0 28 5 2 Advanced Cold Table Hot Table Reg Addr Reg Addr Ox C 0x34 0x20 0x39 0x3C Test modes User mode D LS crystal measure HS startup time measure Warning use Read button to read IFR content gt DoclD027602 Rev 2 25 71 GUI software description UM1870 26 71 In the View Edit view the following operations are available Select the high speed HS crystal 16 or 32 MHz and the low speed oscillator source 32 kHz or the internal ring oscillator Set the Power Management options SMPS inductor or SMPS off configuration Change stack mode Each mode has a different functionality 1 slave master 1 connection only small GATT database RAM off during sleep Mode 2 slave master 1 connection only large GATT database RAM on during sleep Mode 3 slave master 8 connections small GATT database RAM on during sleep Mode 4 only on BlueNRG MS FW stack version gt 7 1a slave master simu
3. 5 ko bo RB L ET adoz 4405 zHW8 0z 080 a1SXo4 viaa Ya Slad 0029 LVS Su 9 ood Leh NIW VOJA MCN 19 902 090 doz 0 eod E gg 808 294 Lot NId li 62d g 1 p 894 jam B5 ovd 18584 un gp 1 07080 g 090 Wi Y 429208 2 _ vH x a NI ccm SWir 9v 2 gt Fr Z SS ZANAN OLY ELOd gt 64 Nas 27 zaan aon zada 87 lt lt 20007 og so PAOCANNWEDTDANCBHOWW J bb bb bn En bn En bn En bp en A o 2 5809 zad IY 9r vt igur zr W 438952052458 Edd 1 Tsun ozzeogQgz 922 zog 98d v S 19 a 28 68d 9 t 7199 z T GSPG0210D11140 DoclD027602 Rev 2 64 71 UM1870 Available board schematics Figure 30 STEVAL IDBO05V1 JTAG SWD 4 R6 NE R7 NE R9 NE ST Link
4. T 1 838 GSPGO0210DI1205 J4 J3 Figure 35 STEVAL IDBO05V1 daughterboard connectors E 2 S o Xz a MI to o9 P m 25 AAAA n n 8 mm B 2 N z S amp 8 _ gt 5 7 lt es 4 L 5 1 5 9 X 5 amp m 5 DO CO eo CO Eli g 0 0 0 0 e N z Gal x co qim aoaa ul 4 NI 9 T 9 O 0 0 lalo C 5 E e gt e 02 102 03 00000 65 0210011210 DoclD027602 Rev 2 68 71 Available board schematics Figure 36 STEVAL IDBOO06V1 USB dongle schematics ae moons ap 9 gt
5. Init GATT ACI GATT INIT Init GAP as central device GAP INIT Role CENTRAL When a script is calling a command which generates specific events the script can detect them by using the WAIT EVENT event code None timeout None continueOnEvtMiss False param checks command DoclD027602 Rev 2 UM1870 GUI software description Table 10 WAIT EVENT macro command Command name WAIT EVENT Description It waits an event with Event Code parameter equal to event code If no event code is indicated the macro command waits any event Optional filtering parameters allow Parameters event code None default timeout None default continueOnEvtMiss False default param checks optional Return An event with its parameters None if a timeout occurs and the input parameter continueOnEvtMiss is set to True An HCITimeoutError error exception is raised when a timeout occurs evt get param parameter name val to define is used for getting the specific event additional filters on event fields filtering parameters The WAIT EVENT macro command waits for an event with Event Code parameter equal to event code If no event code is indicated the macro command waits for any event The timeout parameter allows to set the event timeout If no timeout is set the macro command waits until an event occurs If a timeout
6. 0 00 descr 0x0000 Supported platforms The BlueNRG MS sensor profile demo is supported only on the BlueNRG MS development platform STEVAL IDBOO5V 1 and BlueNRG MS daughterboard STEVAL IDBO05V1D BlueNRG MS app for smartphones An application is available for smartphones iOS and android that works with the sensor profile demo The development kits are preprogrammed with the sensor profile demo firmware If the development board has been flashed with another firmware it can be programmed with the correct firmware Refer to Section 4 1 for the programming procedure using the device firmware upgrade feature and BlueNRG MS GUI The correct pre compiled firmware can be found inside firmware folder BlueNRG MS SensorDemo hex The source file for the demo is inside the project folder This app enables notifications on the acceleration characteristic and displays the value on the screen Data from environmental sensors are also periodically read and displayed DoclD027602 Rev 2 3 UM1870 BlueNRG MS sensor profile demo Figure 23 BlueNRG MS app Locked SIM 12 13 a Locked SIM 12 13 4 Bact Accel RSSI Back Accel Temp RSSI Back Accel Temp RSSI Ly 5 3 BlueNRG MS sensor profile demo connection with a central device This section describes how to interact with a central device while BlueNRG MS is actin
7. 58 8 2 BLE remote control application setup 59 8 2 1 Initializatlon 2 ee IRR Eae RR RI RE Nets 59 8 2 2 Define advertising data 59 8 2 3 Add service and characteristics 59 8 2 4 Connection with a BLE Central device 60 9 List 5 auus dicho alo E QC one ee ease 61 10 Available board schematics 62 11 Revision history 70 4 71 DoclD027602 Rev 2 UM1870 Getting started 1 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 1 1 STEVAL IDBOO5V1 kit contents This kit is composed of the following items 1 development motherboard e 1 BlueNRG MS daughterboard e 12 4 GHz Bluetooth antenna e 1058 cable Figure 1 BlueNRG MS kit motherboard with the STEVAL IDB005V1 daughterboard connected 1 2 STEVAL IDBO0O05V1D kit contents This kit is composed of the following items BlueNRG MS daughterboard Ly DoclD027602 Rev 2 5 71 Getting started UM1870 Figure 2 STEVAL IDB005V1D BlueNRG MS daughterboard Note The STEVAL IDBO05V1D BlueNRG MS daughterboard is identical to the BlueNRG MS daughterboard available within the STEVA
8. Cv UM1870 y emm 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 The following BlueNRG MS kits are available 1 BlueNRG MS development platform order code STEVAL IDBOO5V1 2 BlueNRG MS daughterboard order code STEVAL IDBO05V1D 3 BlueNRG MS USB dongle order code STEVAL IDBO06V1 The BlueNRG MS software package includes a graphical user interface application to control the BlueNRG MS through a simple ACI protocol December 2015 DoclD027602 Rev 2 1 71 www st com Contents UM1870 Contents 1 Getting started e 5 1 1 STEVAL IDBOO5V1 kit contents 5 1 2 STEVAL IDBOO5V1D kit contents 5 13 STEVAL IDBOO6V1 kit contents 6 1 4 System requirements 7 1 5 5 development kit setup 7 2 Hardware description 8 2 1 STEVAL IDBOO5V1 motherboard 8 2 1 1 Microcontroller and connections 9 2 1 2 PON
9. The command will return the service handle in chatServHandle The TX characteristic is added using the following command on BLE Chat Server role device aci gatt add char chatServHandle UUID TYPE 128 charUuidTX 20 CHAR PROP NOTIFY ATTR PERMISSION NONE 0 16 1 amp TXCharHandle Where charUuidTX is the private characteristic UUID 128 bits allocated for the TX characteristic notify property The characteristic handle is also returned on TXCharHandle The RX characteristic is added using the following command on BLE Chat Server role device aci gatt add char chatServHandle UUID TYPE 128 charUuidRX 20 CHAR PROP WRITE CHAR PROP WRITE WITHOUT RESP ATTR PERMISSION NONE GATT SERVER ATTR WRITE 16 1 amp RXCharHandle Where charUuidRX is the private characteristic UUID 128 bits allocated for the RX characteristic write property The characteristic handle is also returned on RXCharHandle See ACI documentation for more information on these commands as well as those that follow DoclD027602 Rev 2 53 71 BlueNRG MS chat demo application UM1870 6 2 3 6 2 4 54 71 Enter connectable mode On BLE chat server role device uses GAP ACI commands to enter into general discoverable mode aci gap set discoverable ADV IND 0 0 PUBLIC ADDR NO WHITE LIST USE 8 local name 0 NULL 0 0 The local name parameter contains the name that will be present in advertising data as described in the Blueto
10. Master DeviceDiscovery amp devDiscParam devDiscParam variable allows to set the discovery parameters discovery procedure interval window Refer to the master library doxygen documentation for more information about the command and related parameters The found devices are returned through the Master DeviceDiscovery CB master library callback DEVICE DISCOVERED status Connect to discovered sensor peripheral device Once a Sensor Peripheral device has been found the Sensor Central device connects to it by using the following master library command Master DeviceConnection amp connParam connParam variable allows to set the connection parameters connection procedure scan duration window Refer to the master library doxygen documentation for more information about the command and related parameters When the connection is established with success the Master Connection CB master library callback is called with CONNECTION ESTABLISHED EVT event Discovery sensor peripheral services and characteristics Once a Sensor Peripheral device has been connected the Sensor Central device starts discovery all primary service procedure by using the following master library command Master GetPrimaryServices Refer to the master library doxygen documentation for more information about the command and related parameters When services are discovered the Master ServiceCharacPeerDiscovery CB master library
11. STEVAL IDBOO6V1 BlueNRG MS chat demo application peripheral amp central devices This section describes how two BLE chat devices server peripheral amp client central interact with each other in order to set up a point to point wireless chat communication DoclD027602 Rev 2 Ly 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 This is done with two commands init e BLE Chat Server role aci gap init GAP PERIPHERAL ROLE 0 0x07 amp service_handle amp dev name char handle amp appearance char handle BLE Chat Client role gap init GAP CENTRAL ROLE 0 0x07 amp service handle amp dev name char handle amp appearance char handle Peripheral amp central BLE roles must be specified inside the GAP INIT command See documentation for more information on these commands and on those that follow 6 2 2 Add service and characteristics The chat service is added on the BLE chat server role device using the following command aci gatt add serv UUID TYPE 128 service uuid PRIMARY SERVICE 7 amp chatServHandle Where service uuid is the private service UUID 128 bits allocated for the chat service Primary service
12. Figure 4 The sensor is connected to the STM32L through the SPI interface Two lines for interrupts are also connected STLM75 a high precision digital CMOS temperature sensor with interface E in Figure 4 The pin for the alarm function is connected to one of the STM32L GPIOs Extension connector There is the possibility to solder a connector on the motherboard to extend its functionality F in Figure 4 16 pins of the microcontroller are connected to this expansion slot Table 1 Push buttons and joystick For user interaction the board has two buttons One is to reset the microcontroller while the other is available to the application There is also a digital joystick with 4 possible positions left right up down G in Figure 4 JTAG connector A JTAG connector on the board H in Figure 4 allows the programming and debugging of the STM32L microcontroller on board using an in circuit debugger and programmer such as the ST LINK V2 DoclD027602 Rev 2 11 71 Hardware description UM1870 2 1 7 LEDs Five LEDs are available l in Figure 4 001 green DL2 orange 003 DL4 blue DL5 yellow 2 1 8 Daughterboard interface The main feature of the motherboard is the capability to control an external board connected to the J4 and J5 connectors L in Figure 4 Table 1 shows which pins of the microcontroller are connected to the daughterboard Some of the lines are connec
13. GUI installed The STM32L in the STEVAL IDBOO5V1 kit has been preprogrammed with a demo application see Section 5 Hence new firmware must be loaded into the STM32L Firmware images can be found within the firmware folder The firmware image that must be programmed is latest BlueNRG_VCOM_x_x hex available within the BlueNRG DK SW package The GUI has the ability to Flash new firmware In order to download binary images into the internal Flash of the STM32L the microcontroller must be put into a special DFU device firmware upgrade mode To enter DFU mode 1 BlueNRG MS development platform STEVAL IDBOO5V1 Power up the board Press and hold USER button Resetthe board using RESET button keep USER button pressed while resetting The orange LED DL2 will start to blink Release USER button Use BlueNRG MS GUI to Flash the device with new firmware Tools gt Flash motherboard FW 2 BlueNRG MS USB Dongle order code STEVAL IDBO006V1 Press and hold SW1 button Plug the USB dongle on a PC USB port The orange LED D3 will start to blink Use BlueNRG GUI to Flash the device with a new firmware Tools gt Flash Motherboard FW The BlueNRG MS graphical user interface This section describes the main functions of BlueNRG MS GUI application You can run this utility by clicking on the BlueNRG MS GUI icon on the Desktop or under Start gt STMicroelectronics BlueNRG DK X X X BlueNRG MS GUI D
14. ID Beacon ID Fixed value Used to distinguish specific beacons Location UUID Beacons UUID from others Major number Identifier for a group of beacons Used to group a related set of beacons Minor number Identifier for a single beacon Used to identify a single beacon Tx Power Level 2 s complement of the Tx power now Tar youare irom device To configure a BlueNRG MS platform as a BLE beacon device click on Set Beacon tab GUI RF Test window The BlueNRG MS GUI provides the RF Test window that permits to perform the following tests 1 Start Stop a tone on a specific BLE RF channel 2 Perform a BLE Packer Error Rate PER tests using BLE Direct Test Mode DTM commands Start Stop a Tone For starting a tone on a specific RF BLE Channel performs these steps 1 Connect a BlueNRG MS platform to PC USB port 2 Launchan instance of BlueNRG MS GUI 3 Openrelated COM port 4 Go to RF Test window and in the TRANSMITTER section Set BLE channel by TX Frequency combo box Set TX power in the related combo box Click on Start Tone button For stopping a tone on a specific RF BLE Channel performs these steps 1 Go to RF Test window and in the TRANSMITTER section Click on Stop Tone button Stop button is available only when a tone is started DoclD027602 Rev 2 Ly UM1870 GUI software description Figure 17 GUI RF Test Start a tone r 27 BlueN
15. MS GUI ACI utilities window BlueNRG MS HW v3 1 BlueNRG MS FW 7 1 Motherboard FW v1 8 File Tools Settings Port COM197 ST Dk HW Reset ACICommands ACI Utilities Scripts Beacon RF Test Init Device Service Management Central Role Peripheral Role Scanning Advertising J 2 _ Update Advertising Data Update Connections Service Discovery Clear List 7 Update V Autoscroll 14 085850508 ACI_GATT_UPDATE_CHAR_VALUE 15 08 58 50 608 Sent Received Packets Packet Details N Time Type Parameter Value Literal Info i OxFDO6 ACI GATT UPDATE CHAR VAL 8 08 58 50 578 ACLHAL UD 9 HCLCOMMAND COMPLETE EVENT 0x0005 fchacHandie oos Hand 11 08 58 50 598 HCI COMMAND COMPLETE EVENT 0 00 Te 12 08 58 50 598 ACLGAP INIT 507 i 13 08 58 50 598 COMMAND COMPLETE EVENT Char Value 0x42 0x6 0x75 0x65 04 E 052 047 C Central and Peripheral roles are supported with the BLE operations described in Table 6 Table 7 and Table 8 DoclD027602 Rev 2 27 71 GUI software description UM1870 28 71 Table 6 GUI ACI utilities window available general operations Operation Associated actions Notes Allows to i
16. PA14 49 JTCK 14 PA15 50 JTDI 12 PC10 51 DB 103 IRQ 11 52 DB PIN1 PC12 53 DB PIN2 PD2 54 LED3 PB3 55 JTDO 10 4 56 JNTRST 8 PB5 57 TSEN INT PB6 58 I2C1 SCL PB7 59 2 1 SDA 10 71 DoclD027602 Rev 2 Ly UM1870 Hardware description Table 1 MCU pin description versus board function continued Board function Pin Pin LEDs DB connector Buttons Acceler Temp USB JTAG Ext joystick sensor conn BOOTO 60 PB8 61 4 PB9 62 6 VSS_3 63 VDD 3 64 1 These lines are also available on the test point row 2 1 2 Power The board can be powered either by the mini USB connector CN1 A in Figure 4 or by 2 AAA batteries To power the board through USB bus jumper JP1 must be in position 1 2 as in Figure 4 B To power the board using batteries 2 AAA batteries must be inserted in the battery holder at the rear of the board and jumper JP1 set to position 2 3 When the board is powered the green LED DL6 is C If needed the board can be powered by an external DC power supply Connect the positive output of the power supply to the central pin of JP1 pin 2 and ground to one of the four test point connectors on the motherboard TP1 TP2 TP3 and TP4 Sensors Two sensors are available on the motherboard LISSDH an ultra low power high performance three axis linear accelerometer D in
17. beacon manufacturing data ret aci gap delete ad type AD TYPE TX POWER LEVEL Define the beacon manufacturing payload const uint8 t manuf data 26 AD TYPE MANUFACTURER SPECIFIC DATA 0x30 0x00 Company identifier code Default is 0x0030 STMicroelectronics 0x02 HAD 0x15 Length of the remaining payload OxE2 0x0A 0x39 OxF4 0x73 OxF5 Ox4B 0 4 Location UUID Ox2F 0x17 OxD1 OxAD 0x07 0 9 0x61 0x00 0x00 Major number 0x00 0x00 Minor number 0xC8 2 s complement of the Tx power 56dB the beacon manufacturing data on the advertising packet ret aci gap update adv data 27 manuf data DoclD027602 Rev 2 57 71 BLE remote control demo application UM1870 8 8 1 58 71 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 The data content besides the manufacturer ID i e 0 0030 for STMicroelectronics is as follows Table 15 BLE remote advertising data Byte 0 Byte 1 Byte2 App ID 0x05 Temperature value little endian The temperature value is given in tenths of degrees Celsius The device is also connectable and exposes a characteristic used to control the LEDs
18. board can be used to develop applications that use the BlueNRG MS The board can be powered through the USB connector which can also be used for I O interaction with a USB host The board also has two buttons and two LEDs for user interaction Below is a list of some of the main features that are available on the board see Figure 2 BlueNRG MS network coprocessor e STM32L151CBU6 48 pin microcontroller USB connector for power supply and I O e One row of pins with SWD interface Chip antenna Two user buttons SW1 SW2 Two LEDs 02 03 BALF NRG 01D3 integrated balun DoclD027602 Rev 2 15 71 Hardware description UM1870 2 4 1 16 71 Microcontroller and connections The board utilizes an STM32L151CBU6 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 timers USART 2 SPI DAC and comparators The microcontroller is connected to various components such as buttons LEDs and connectors for external circuitry The following table shows which functionality is available on each microcontroller pin DoclD027602 Rev 2 Ly UM1870 Hardware description Table 4 MCU pin description versus board function Board function Pin name Pn num LEDs BlueNRG Buttons USB
19. callback is called with PRIMARY SERVICE DISCOVERY code In particular the sensor and environmental services are discovered For each discovered service the related characteristics are discovered by using the following master library command Master GetCharacOfService Refer to the master library doxygen documentation for more information about the command and related parameters DoclD027602 Rev 2 Ly UM1870 BlueNRG MS sensor profile demo 5 4 5 5 4 6 When the characteristics of a service are discovered the Master ServiceCharacPeerDiscovery CB master library callback is called with GET CHARACTERISTICS OF A SERVICE code In particular the sensor acceleration free fall and temperature characteristics are discovered 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 Master Notiflndic Status masterContext connHandle handle TRUE FALSE Refer to the master library doxygen documentation for more information about the command and related parameters When a characteristic notification is enabled the Master PeerDataExchange CB master library callback is called with NOTIFICATION INDICATION CHANGE STATUS code On a Sensor Central device context the sensor accelerati
20. comparators The microcontroller is connected to various components such as buttons LEDs and connectors for external circuitry The following table shows what functionality is available on each microcontroller pin Table 1 MCU pin description versus board function Board function Pin Pin LEDs DB connector USB JTAG joystick sensor conn VLCD 1 PC13 2 DB SDN RST PC14 3 3 PC15 4 5 OSC IN 5 OSC O 6 UT NRST 7 RESET 7 PCO 8 LED1 PC1 9 LED2 PC2 10 DB 11 9 VSSA 12 VDDA 13 PAO 14 11 PA1 15 13 PA2 16 15 17 17 VSS 4 18 VDD 4 19 4 20 55 21 SPH SCK PA6 22 SPI1 MISO PA7 23 SPI1 MOSI 24 LED4 PC5 25 LEDS PBO 26 JOY_DOWN DoclD027602 Rev 2 9 71 Hardware description UM1870 Table 1 MCU pin description versus board function continued Board function Pin Pin name LEDs DB connector Buttons d Acceler Temp USB JTAG Ext joystick sensor conn 1 27 JOY RIGHT PB2 28 18 PB10 29 INT1 PB11 30 INT2 VSS 1 31 VDD 1 32 PB12 33 DB CSN PB13 34 DB SCLK 14 35 _ 00 15 36 DB SDI PC6 37 PUSH BTN PC7 38 DB 1000 PC8 39 DB 1010 PC9 40 DB 1020 PA8 41 JOY LEFT PA9 42 JOY CENTER PA10 43 JOY UP PA11 44 USB DM PA12 45 USB DP PA13 46 JTMS 16 VSS 2 47 VDD 2 48
21. field Only the yellow cells of this table can be modified by the user The Parameter Total Length is fixed or automatically calculated after modifying cell content After the fields have been modified if required the command can be sent using the Send button HCI Packet history and details At the bottom of the main window two tables show packets sent to and received from the BLE controller as well as other events The left table sent received packets holds a history of all packets see Figure 11 The right one packet details shows all the details of the selected packet as is done in the command packet table Figure 11 Figure 11 Packet history and details N Time Type Parameter Value Literal Info 00000000000 1 15 58 26 239 COMMAND COMPLETE EVENT on 2 155830716 TheNumberof HCI com oC Command Disalowed HandleoftheGAP service DOO prance Character Double clicking a row of the sent received packets table shows the raw packet Ly DoclD027602 Rev 2 23 71 GUI software description UM1870 3 2 2 24 71 Figure 12 Raw packet dump E Raw Packet 0x01 0x0D 0x20 0x 19 0x00 0x40 0x00 0x40 0x00 0x00 0x00 0x00 00 0 00 0 00 0 00 0 00 0 06 0 00 0 80 0 0 0 00 0 80 0 x0C 0x00 0x00 0xFFOxFF Some events displayed in yellow cell
22. nRESET SWDIO SWO TRACE 6 SWCLK The connection to the ST LINK V2 interface is given in the table below as shown in Figure 7 o m Table 5 SWD connection Signal name pd pin number pin number 2 1 14 6 VDD 2 2 1 nRESET 3 T SWDIO 4 gt SWO TRACE 5 13 SWCLK 6 9 RF connector The STEVAL IDBOO6V1 provides two different RF connections antenna chip antenna default configuration and UFL connector Although the default configuration allows communication on air it can be useful to switch to the UFL connector in order to connect the STEVAL IDBOO6V1 to RF equipment such as a spectrum analyzer or RF signal generator To switch from antenna to UFL connector capacitor C10 must be removed and capacitor C42 must be soldered To restore the default configuration and use the antenna capacitor C42 must be removed and capacitor C10 must be soldered Both capacitors C10 and C42 have the same value 56 pF In Figure 8 the two pads for C10 and C42 are shown together with the chip antenna and UFL connector Figure 8 RF connector scheme UFL connector C42 C10 Antenna DoclD027602 Rev 2 19 71 Hardware description UM1870 2 4 4 Note 2 4 5 Note 2 4 6 2 4 7 2 4 8 20 71 Push buttons For user interaction the board has two buttons both available to the application SWI SW2 SW is the DFU button The BlueNRG MS USB dongle is preprogrammed
23. 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 Enable or Disable filters Set own address type Set passive or active scan Set Scanning interval and Window Scanning Allows to connect to a peer device by Searching for devices in Advertising Select the device to which to connect Select the connection parameters Theaddressesotihe Peer address and type detected advertising Scan Interval and Window devices are displayed Connection Interval min amp max Latency Supervision timeout Connection event length min amp max Connection Allows to update the connection parameters of available connections by Selecting the specific connection to be updated Update Set the new connection parameters Connections Connection interval min amp max Latency Supervision timeout Connection event length min amp max 2 DoclD027602 Rev 2 29 71 GUI software description UM1870 Table 8 GUI ACI utilities 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 ADV NONCONN IND Set L
24. peripheral device 50 5 4 3 Connect to discovered sensor peripheral device 50 5 4 4 Discovery sensor peripheral services and characteristics 50 5 4 5 Enable sensor peripheral acceleration and free fall notifications 51 5 4 6 Read the sensor peripheral temperature sensor characteristic 51 6 BlueNRG MS chat demo application 52 6 1 Supported platforms 2 gt 2525 2 4 2 52 6 2 BlueNRG MS chat demo application peripheral amp central devices 52 6 2 1 Initialization 53 6 2 2 Add service and characteristics 53 6 2 3 Enter connectable mode 54 6 2 4 Connection with central device 54 DoclD027602 Rev 2 3 71 Contents UM1870 7 BlueNRG MS Beacon demonstration application 56 7 1 Supported platforms x xe a RR EE PATER Ro Rex 56 7 2 BLE Beacon application setup 56 7 2 1 IritiallZatlOn xu ed Rr RO Rr RE OR 56 7 2 2 Define advertising data 56 7 2 3 Entering non connectable mode 57 8 BLE remote control demo application 58 8 1 Supported platforms
25. related to TX device The PER Packet Error Rate value is showed in the Packet Error Rate field Figure 19 GUI RF Test PER test TX device 57 BlueNRG GUI v1 9 0 1 File Tools Settings Help Port 197 ST DK ACI Commands ACIUti es Scripts Beacon RF Test per BlueNRG MS HW v3 1 BlueNRG MS FW 7 1 Motherboard FW v1 8 Test TRANSMITTER RECEIVER V HighPower 7 888 RXFreauency __ 2402 MHz Channel 0 TX Frequency 2402 MHz Channel 0 Start Receiver Length of Data 0x25 EE PER Packet Payload 0x00 Pseudo Random bit sequence 9 Packet Transmitted 0 Packet Received 0 2 Start Tone Start Transmitter Packet Error Rate PER Clear ist V Update 7 Autoscroll Send Sent Received Packets Packet Details N Time 2 USUZ 30 9U FILI CUIVIIVIAINU CUIVIFLEIE EVENIT 6 09 02 36 907 HCLLE y 09 02 36 917 COMMAND COMPLETE EVENT Parameter Value Literal Info 11 090229348 COMMAND COMPLETE EVENT 13 090239358 COMMAND COMPLETE EVENT DoclD027602 Rev 2 41 71 GUI software description UM1870 42 71 Figure 20 GUI RF Test PER test RX device sema S T File Tools Settings Help ACI Commands ACIUtites Scripts Beacon RF Test BlueNRG MS HW v3 1
26. s 21 2771 DoclD027602 Rev 2 UM1870 Contents 3 2 BlueNRG MS graphical user interface 21 3 2 1 GUI main window teens 22 3 2 2 Irae 24 3 2 3 GUI ACI utilities window 27 3 2 4 GUI Scripts window 30 3 2 5 GUI Beacon 37 3 2 6 GUI RF Test window 38 4 Programming with BlueNRG MS network processor 43 4 1 Requirements 43 4 2 Software directory structure 43 5 BlueNRG MS sensor profile 45 5 1 Supported platforms i3 2 dre cR XE EE wed bee hase 46 5 2 BlueNRG MS app for smartphones 46 5 3 BlueNRG MS sensor profile demo connection with a central device 47 5 3 1 initialization 47 5 3 2 Add service and characteristics 47 5 3 3 Set security requirements 48 5 3 4 Enter connectable mode 48 5 3 5 Connection with central device 48 5 4 BlueNRG MS sensor demo central profile role 49 5 4 1 Initialization 49 5 4 2 Discovery a sensor
27. sent at a fixed interval RECEIVER section This section permits to set the following items e The Frequency of Receiver Clicking on Receiver Test button test reference packets will be received at a fixed interval DoclD027602 Rev 2 39 71 GUI software description UM1870 40 71 Figure 18 GUI RF Test TRANSMITTER amp RECEIVER sections 7 BlueNRG GUI v1 9 0 a File Tools Settings Help Port COM197 ST Dk Sa CACI Commands Actutiities Scripts Beacon Test TRANSMITTER V High Power TX Frequency Length of Data Packet Payload RF Test 7 898 2402 MHz Channel 0 20 25 0x00 Pseudo Random bit sequence 9 Start Transmitter i Sent Received Packets N Time Start Tone Clear List Update 7 Autoscroll Type RECEIVER RX Frequency 2402 MHz Channel 0 Start Receiver PER Packet Transmitted 0 Packet Received 0 Packet Error Rate PER Packet Details Parameter BlueNRG MS HW v3 1 BlueNRG MS FW v7 1c Motherboard FW v1 8 Send Literal Info LL M a cm Packet Error Rate PER test procedure To perform a Packet Error Rate Test using standard BLE Direct Test Mode commands LE Transmitter Test LE Receiver Test and LE Test the following steps are needed Start PER test 1 2 3 Connect t
28. service just added 0xA001 The characteristic has a variable length attribute so you will not see any value Write a string into the characteristic and read it back BlueNRG MS can send notifications of the characteristic that has been previously added with UUID 0 002 after notifications have been enabled This be done using the following command update char value Service Handle Char Handle 0 0x05 hello where 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 demo central profile role This application implements a basic version of the BlueNRG MS Sensor Profile Central role which emulates the BlueNRG MS Sensor Demo applications available for smartphones iOS and Android It configures a BlueNRG MS device as a BlueNRG MS Sensor device Central role which is able to find connect and properly configure the free fall acceleration and environment sensor characteristics provided by a BlueNRG MS development platform configured as a BlueNRG MS Sensor device Peripheral role This application uses a new set of APIs that allow the performance of the following operations on a BlueNRG MS Master Central device Master Configuration Functions Master Device Discovery Functions Master Device Connection Functions Master Discovery Services amp Characteristic
29. service_uuid PRIMARY_SERVICE 7 amp RCServHandle Where service_uuid is the private service 128 bit UUID allocated for the BLE remote service ed0ef62e 9b0d 11e4 89d3 123b93f75cba The command returns the service handle in RCServHandle The BLE Remote Control characteristic is added using the following command if ENABLE_SECURITY ret aci_gatt_add_char RCServHandle UUID_TYPE_128 controlPointUuid 1 CHAR_PROP_READ CHAR_PROP_WRITE CHAR_PROP_WRITE_WITHOUT_RESP CH AR_PROP_SIGNED_WRITE DoclD027602 Rev 2 59 71 BLE remote control demo application UM1870 8 2 4 60 71 ATTR PERMISSION AUTHEN READ ATTR PERMISSION AUTHEN WRITE GATT NOTIFY ATTRIBUTE WRITE 16 1 amp controlPointHandle 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 NOTIFY ATTRIBUTE WRITE 16 1 amp controlPointHandle endif Where controlPointUuid is the private characteristic 128 bit UUID allocated for BLE Remote Control characteristic ed0efo1a 9b0d 11e4 89d3 123b93f75cba If security is enabled the characteristic properties must be set accordingly to enable authentication on controlPointUuid characteristic read and write Connection with a BLE Central device When connected to a BLE Central device another BlueNRG MS device or any SMART READY device the controlPointUuid characteristic is used to control
30. the BLE Remote Control platform LED Each time a write operation is done on controlPointUuid the EVT BLUE GATT ATTRIBUTE MODIFIED event is raised on the callback and the selected LED LEDs are turned on or off DoclD027602 Rev 2 Ly UM1870 List of acronyms 9 List of acronyms Table 16 List of acronyms used in this document Term Meaning BLE Bluetooth low energy IFR Information register USB Universal serial bus Ly DoclD027602 Rev 2 61 71 UM1870 Available board schematics Available board schematics 10 Figure 26 STEVAL IDBO05V1 BlueNRG MS daughterboard J0jeuuoo YWS T 2070 a 2 5 2070 0001 MSX 2070 AL 2090 UOOL 2070 NL 2070 3001 6 3 zzo zo ozo a ezo ZIVIA 2 SSA 2070 00 ISON 5 2 619 osal E LU gu 2 O 3zisai 1 8 su NUM nod 1
31. 01 Max Attributes 0 06 The command will return the service handle on variable Service Handle e g 0 000 characteristic must now be added to this service This service is identified by the service handle add char Service Handle 0x01 0xA002 10 0x1A 0x00 0x01 0x07 0x01 Handle Where Char UUID 0 01 Char UUID 1620xA002 Char Value Lengthz10 Char_Properties 0x1A 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 on variable Char_Handle Set security requirements BlueNRG MS exposes a command that the application can use to specify its security requirements a characteristic has security restrictions a pairing procedure must be initiated by the central in order to access that characteristic Let s assume we want the user to insert a passcode during the pairing procedure aci gap set authentication requirement 0x01 0 0 7 16 123456 1 Where MITM_Mode 0x01 OOB Enable 0 OOB_Data 0 Min Encryption Key Size 7 Max Encryption Key 16 Use Fixed 0 Fixed 123456 Bonding 1 Enter connectable mode Use GAP ACI commands to enter one of the discoverable and connectable modes aci gap set discoverable 0x00 0x800 0x900 0x00 0x00 0x08 l
32. 01 AL 30001 04 L M e so i on 92 pena z L L L L Ly 5 t T T van T 1 vom Tem ae aros _ 389 E Lo a D PPP T M 20005000 G31NDOW LON 8 92844444 360 280 ES a0 sas js zm T 3L sea CL ud Sa wax Hos levels n amas oft 5 el snensi wewis owns xous S Oan 5555 GNINDOM ION ss P EE 0505 Bj Won Age 5 Ha 835194800 He EEEN d m pasisi 2 qii 1355398 8 te 4 8 va He tiny wet roars Sd Md X sowousa g bihis se 8 w ow mo i 24 8 D T ange Trane ES s E 7 SN ay Somme ava Bt 8 xus 2 cous cmd zuownd xen SOW zus 82 ooo k arame aro zeeosio4 008 6 9 59050 mova r NN FL ALCOI n E awas aroos awone zwoore ow Omron 5888 Mo
33. 090 027 02 256 519 Su poo ____ Sasduine FEES NE eag y sog nolo 090 znz o MSX c090 nio 45 1 TTLP L98 SW poo asasn 5 2 o gt 78 vdd osieca 5 as sn GSPG0210DI1200 67 71 DoclD027602 Rev 2 UM1870 Available board schematics Figure 34 STEVAL IDBO05V1 button and joystick E 090 00 74 090 090 70907017 090 NOV 090 NOV px 090 NOLO p 8090 NOLO 6090 6090 YX 090 oroaganoys T y NOWWOO gt NMOG C gt ar ww dn gt an 9n gt Aor gt 1 090 3001 H 090 3001 Y 090 3001 H 090 1001 H 090 3001 Y p oza sza ayo ane 090 001 4 090 00 74 eza 65 02 8051 647 58 1Sd0 NOLLNSHSNd MS ZMS 5090 51001 ano S T 3 YX 090 NOLO 9 uaing 65 80 02 1SdGQ NOLL 8HShd MS 805 64 54 mp LA 090 NOLO 9 IMS 49 090 3001
34. 1 DoclD027602 Rev 2 Ly UM1870 BLE remote control demo application 8 2 8 2 1 8 2 2 8 2 3 BLE remote control application setup This section describes how to configure a BlueNRG MS device to acting as a remote control device Initialization The BlueNRG MS s stack must be correctly initialized before establishing a connection with another Bluetooth LE device This is done with two commands aci gatt init e aci gap init GAP PERIPHERAL ROLE 0 0x07 amp service handle amp dev name char handle amp appearance char handle Define advertising data The BLE Remote Control application advertises some manufacturing data as follows Set advertising device name as Node const uint8 t scan resp data 0x05 AD TYPE COMPLETE LOCAL NAME N o d e Set scan response data hci le set scan resp data sizeof scan resp data scan resp data Set Undirected Connectable Mode ret gap set discoverable ADV IND ADV INTERVAL MIN 5 1000 625 ADV INTERVAL MAX MS 1000 625 PUBLIC ADDR NO WHITE LIST USE 0 NULL 0 NULL 0 0 Set advertising data ret hci le set advertising data sizeof adv data adv data On the BlueNRG MS development platform STEVAL IDBOO5V1 the temperature sensor value is set within the adv_data variable Add service and characteristics The BLE Remote Control service is added using the following command aci_gatt_add_serv UUID_TYPE_128
35. 1531 2070 AL h gt 1noosos 81931 819 011531 I e 2070 UOOL 909 2070 1001 99 Sio SH UN x jo I Ei 909 20 0 dst KA 2 FO 2855 9007200719 zz elole le lale us lo r Jor lo i H ER 5 xg vr er LIWLX4 71531 8 pisal o e e Joo Jew edl0 ouN s1v8 OLS eisat 7 er 21591 ES 6 Siy ziedunp zn o Z S ENSA d d LIvixs OUI ds EU pE E Mil vn 19 EL LYSA ISOW Ids 22 v s L ISOW 8 20609200 Boase 250884 2O 459552600 6 5 1 1 e IN 09 Joo m in li z IL b o 298 ues 909 2090 dzz 909 Z0v0 dzz 92 so eer ou ou ou ou ul uos 902 070 400 M a xi Mn vo NNOO 9 E e n 6 0 5 1 8 21581 T _ 5 9 91631 usemjoq 5080 v visui 2 1 080 NOL sux 2090 vo0 MSX 200 NL l z 91581 w L n zo m 2 eje STEVAL IDB005V1D BlueNRG MS daughterb
36. 3 0 3 6V 5V tolerant IAR J Link 1 2 3 6V 5V tolerant R10 NE 3v3 PB4 T mer 1 JTCK JTDO PES 4 15 s i Male Connector RESET NRST 2x10 HDR straight pe NE 2 GND 1 2 3 4 5 6 7 8 01 02 D4 05 9 10 th 12 15 16 NO NO NO lt lt N 17 18 GND GND GND GND GND GND 19 20 JTAG RS 710 4288 RS 473 8282 GSPG0210D11145 GND Figure 31 STEVAL IDB005V1 USB 3v3 R5 NE USB 5V C A 1 50723 61 t DM 2 VBUS u4 DP pp RB DP USB DP PAI2 1 1 1011 1012 6 i5 R ORO 0603 3 5 4 Die GND VBUS 6 SHELL 11 RIN DM SHELL USB_DM 021 1 022 4 8 SHELL R 0RO 0603 USBLC6 2P6 9 9 SHELL era USBUFO2W6 et ae LI SND USB_miniB C 100N 0603 X7R R_1M_0603 bs AN7 0603 X7R 4 68 60210011150 Ly DoclD027602 Rev 2 65 71 Available board schematics UM1870 Figure 32 STEVAL IDB005V1 LED 3V3 3V3 3V3 DL1 DL2 GREEN W ORANGE W RED W R14 R15 R16 Le S gt P LED S gt PI LED3 gt P R_510_0603 R_680_0603 R_680_0603 3V3 DL4 DL5 BLUE 77 YELLOW W R17 R18 gt LEDs _ gt 680 0603 510 0603 66 71 GSPG0210D11155 DoclD027602 Rev 2 4 Available board schematics UM1870 Figure 33 STEVAL IDB005V1 power supply NidH9 2
37. A bootloader OTA bootloader is a tool that allows to Flash new firmware to the STM32L of a remote device via Bluetooth low energy technology Refer to the dedicated application note for more information b Two precautions must be taken for any firmware 1 change memory regions in linker script vector table and Flash must start at 0x08003000 2 Change the vector table offset NVIC_SetVectorTable DoclD027602 Rev 2 Ly UM1870 GUI software description Get production data From the tools menu it is possible to retrieve production information from the BlueNRG MS daughterboard This data is stored in the EEPROM on the daughterboard Get version The Get version tool is used to retrieve the version of the BlueNRG MS GUI firmware VCOM on the STM23L and hardware and firmware version from the BlueNRG MS Settings This tool allows to configure the firmware stack version to be used from the GUI when no device is actually connected to a PC USB port Further it allows to configure the GUI serial baud rate valid only for communication over serial UART and not through USB Virtual COM In order to use this function 1 Go to Settings gt select FW 7 1 for BlueNRG MS device 2 Go to Settings gt select Set Baud Rate and choose the value default is 115200 3 2 3 GUI ACI utilities window The BlueNRG MS GUI ACI utilities window provides several tabs to allow testing of some BlueNRG MS application scenarios Figure 14 BlueNRG
38. G egaus tae ade het lees 11 2 1 3 SENSOMS xia hha ede OE de ahd 11 2 1 4 Extension connector 11 2 1 5 Push buttons and joystick 11 2 1 6 JTAG COMNCCHOM ls Dele ed Ra n 11 2 1 7 LEDS zoe gs ae ee ala 12 2 1 8 Daughterboard interface 12 2 2 BlueNRG MS daughterboard 13 2 2 1 Current measurements 14 2 2 2 Hardware setup 14 2 2 3 STM32L preprogrammed application 14 2 3 SIEVAEJADBOOSV TD 15 2 4 STEVAL IDB906V1 USB dongle 15 2 4 1 Microcontroller and connections 16 2 4 2 SWbD interface xx eR ER Rx IY wid EE REY G nade 18 2 4 3 RF CONECO ee pete Rees Men PUR RR en 19 2 4 4 bete re xb CR RUE bos 20 2 4 5 User LEDS ise meet ee ae ee rur dae 20 2 4 6 BALF NRG 01D3 integrated balun 20 2 4 7 Hardware setup 20 2 4 8 STM32L preprogrammed application 20 3 GUI software description 21 3 1 Requirements
39. I gt sl 9 awos ao cows 1008 up so a a par g s tes awos 3o ais T 5 3S3u Ua 2 E 2 alt Patan m ap Ol t a i oo ONS lt p TONS e 9 aroos ASL aroos aroos F S 2e 5 4l Od wi 200005 3001 STEINI 92 1001 5 X9 ap naungana nanas 01 an g E rows ls joo a E zc E E a ___ wa Y dT TEG ean 2 gj a D ll wa 2 I man da F mn apwan 17 EN INONHd33 9 JSN eBejs Jewog suong Jes spe sN 300g QMS ap ae moe ATIS m rogus qui LAO Ey o 300 004 L E L wan TER ao a 31 m T moore 5 ei 32001 1001 MV 3 41001 FOL 001 001 AOL 30
40. ILABLE EVENT 34 71 DoclD027602 Rev 2 Ly UM1870 GUI software description Table 11 Event codes with related event parameter types continued event code event par type event parameter type value DISCONNECTION COMP LETE EVENT ENCRYPTION CHANGE EVENT READ REMOTE VERSIO N INFORMATION COMPLETE EVENT HCI COMMAND COMPLETE EVENT HCI COMMAND STATUS EV ENT HCI HARDWARE ERROR EV ENT NUMBER OF COMPLET ED PACKETS EVENT HCI DATA BUFFER OVERFL OW EVENT HCI ENCRYPTION KEY REF RESH COMPLETE EVENT Below are some code examples using the WAIT EVENT macro command Example 1 Wait any events evt WAIT EVENT if evt event code LE META EVENT User specific code evt event code HCI VENDOR EVENT User specific code Example 2 Wait an LE META EVENT evt WAIT EVENT HCI LE META EVENT Using evt get param Subevent Code val it s possible to identify the specific LE META EVENT parameter type value evtCode evt get param Subevent Code val Check if received event is HCl LE CONNECTION COMPLETE EVENT if LE CONNECTION COMPLETE EVENT If Connection Complete Status is success get connection handle if evt get param Status val 0x00 conn handle evt get param Connection DoclD027602 Rev 2 35 71 GUI software des
41. ISCOVERABLE 113 09 00 04 858 COMMAND COMPLETE EVENT 14 090001858 ACI DELETE AD TYPE 15 09 00 04 858 COMMAND COMPLETE EVENT i 09 00 04 858 RF Test C Program Files x86 STMicroelectronics BlueNRG DK 1 9 0 Application scripts BLE_Beacon BLE_Beacon py Packet Details Parameter US UU U4 BZ8 FILI CUIVIIVIAINU CUIVIFLEIE EVENT BlueNRG MS HW v3 1 BlueNRG MS FW v7 1c Motherboard FW v1 8 Send Value Literal Info Moreover the script engine supports other utility commands Table 9 GUI Scripts window 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 String to be A INFO displayed parameter Script is blocked until user presses OK button ERROR User message Raises an exception with a user defined debug message It allows to enter a specific char as input as the GET CHAR None C get char GET FILE None It allows to select a specific file as input GET NAME Returns the device name within an advertising packet Convert the array of bytes to an integer value Example GET VALUE Array of bytes X 0x33 0x22 VALUE X 0x2233 DoclD027602 Rev 2 31 71 GUI software description UM1870 32 71 Table 9 GUI Scripts window u
42. L IDBOO5V 1 kit refer to Section 1 1 1 3 STEVAL IDBOO6V1 kit contents This kit is composed of the following items 1USB dongle Figure 3 STEVAL IDBO06V1 BlueNRG MS USB dongle 6 71 DoclD027602 Rev 2 Ly UM1870 Getting started 1 4 System requirements The BlueNRG MS graphical user interface utility has the following minimum requirements e PCwith Intel or AMD processor running one of the following Microsoft operating systems Windows XP SP3 Windows Vista Windows 7 e 6 At least 128 Mb of RAM e 2USB ports e 40 Mb of hard disk space available e Adobe Acrobat Reader 6 0 or later 1 5 BlueNRG MS development kit setup e Extract the content of the BlueNRG_DK_ x x x Setup zip file into a temporary directory e Launch the BlueNRG DK x x x Setup exe file and follow the on screen instructions Note EWARM Compiler 7 40 3 or later is required for building the BlueNRG DK x x x demonstration applications BlueNRG DK software package supports both BlueNRG and BlueNRG MS devices DoclD027602 Rev 2 7 71 Hardware description UM1870 2 2 1 8 71 Hardware description The following sections describe the components of the kits STEVAL IDB0O05V1 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 The STM32L microcontrolle
43. Pos AOL 40s 59059 3 Le ke in E dads ae ao 8888 0 1870 69 71 GSPG0907151600SG DoclD027602 Rev 2 Revision history UM1870 11 70 71 Revision history Table 17 Document revision history Date Revision Changes 14 May 2015 1 Initial release Added Section 2 4 STEVAL IDBO06V1 USB dongle 03 Dec 2015 2 Figure 36 STEVAL IDBO006V1 USB dongle schematics Updated Figure 3 Figure 9 Figure 13 Figure 14 Figure 15 and Figure 16 DoclD027602 Rev 2 UM1870 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 Purchasers are solely responsible for the choice selection and use of ST products and ST assumes no liability for application assistance or the design of Purchasers products No license express or implied to any intellectual property right is granted by ST herein Resale of ST products with provisions different from the information set forth herein shall void any warranty granted by ST f
44. RG GUI v ET File Tools Settings BlueNRG MS HW v3 1 Port COM197 ST DK BlueNRG MS FW v7 1c Motherboard FW v1 8 LACI Commands 1 Scripts Beacon RF Test Test TRANSMITTER RECEIVER PER Stop Tone Clear List V Update 7 Autoscroll send Sent Received Packets Packet Details Time Type Parameter Value Literal Info ACLHAL_TONE START 1 090132865 HCLRESET Parameter Total Length 001 2 090132875 COMMAND COMPLETE EVENT IRF Chann 090 BLE 09 01 32 875 ACI BLUE INITIALIZED EVENT 4 09 01 32 976 5 09 01 32976 COMMAND COMPLETE EVENT ACLHAL TONE START 7 09 01 32986 COMMAND COMPLETE EVENT Direct Test Mode DTM tests The BlueNRG MS GUI provides RF Test that allows using the BLE Direct Test Modes commands to target a packet error rate test scenario Two sections are available 1 TRANSMITTER section for transmitting reference packets at a fixed interval 2 RECEIVER section for receiving reference packets at a fixed interval TRANSMITTER section This section permits to set the following items The power level of Transmitter e The Frequency of transmitter e Length of Data to transmit in each packet Packet Payload format as defined on Bluetooth Low Energy specification Direct Test Mode section Clicking on Start Transmitter button test reference packets will be
45. SWD VLCD 1 VBAT PC13 2 PC14 3 PC15 4 OSC 5 OSC OUT 6 NRST 7 VSS A 8 VDD A 9 PAO 10 PA1 11 Button SW2 PA2 12 13 4 14 PA5 15 PA6 16 PA7 17 PBO 18 Led D2 PB1 19 Led D3 PB2 20 Button SW1 PB10 21 BlueNRG IRQ PB11 22 VSS1 23 VDD1 24 PB12 25 SPI2 CS PB13 26 SPI2 CLK PB14 27 SPI2 MISO PB15 28 SPI2 MOSI PA8 29 PA9 30 EEPROM CS PA10 31 PA11 32 USB DM PA12 33 USB DP Ly DoclD027602 Rev 2 17 71 Hardware description UM1870 2 4 2 18 71 Table 4 MCU pin description versus board function continued Board function Pin name PIN num LEDs BlueNRG Buttons USB SWD PA13 34 SWDIO VSS2 35 VDD2 36 PA14 37 SWCLK PA15 38 39 SWO PB4 40 PB5 41 PB6 42 PB7 43 BOOTO 44 PB8 45 PB9 46 VSS 3 47 VDD 4 48 SWD interface The SWD interface is available through the J2 pins The SWD interface allows programming and debugging of the STM32L microcontroller on the board using an in circuit debugger and programmer like the ST LINK V2 In Figure 7the connection scheme illustrating how to connect the ST LINK V2 with the board pins is shown Figure 7 SWD connection scheme with ST LINK V2 v 18 17 151371975 3 1 00980808000 00089000008 20 18 16 14 1210 8 6 4 12 3455 The signals available on the STEVAL IDBOO6V1 00 10027602 Rev 2 UM1870 Hardware description 2 4 3 GND VDD
46. ands ACI Utilities Scripts Beacon RFTest Beacon Address hex 123456789AAA Public Random Company Identifier Code hex ID hex 0030 02 SIG company identifiers are available at the following link Location UUID hex Major Number hex Minor Number hex TX Power Level dBm E20A39F4 73F5 48C4 A12F 17D1ADO7A961 0000 0000 56 Set Beacon _ 7 Update V Autoscroll Sed Sent Received Packets Packet Details Time Parameter Value Literal Info USIUUIS4 225 CUIVIIVIAINU CUIVIFLE FE EVEIN T 10 09 00 34 523 ACI GAP INIT 11 09 00 34 532 COMMAND COMPLETE EVENT 09 00 34 532 ACI GAP SET DISCOVERABLE 13 09 00 34 532 COMMAND COMPLETE EVENT 09 00 34 542 ACI GAP DELETE AD TYPE 15 09 00 34 542 COMMAND COMPLETE EVENT 09 00 34 542 ACI GAP UPDATE ADV DATA 17 09 00 34 542 COMMAND COMPLETE EVENT The user can configure the following advertising data fields for the BLE Beacon device through the BlueNRG MS GUI Beacon window configuration parameters DoclD027602 Rev 2 37 71 GUI software description UM1870 3 2 6 38 71 Table 12 BlueNRG MS 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
47. aughterboard into J4 and J5 connectors as in Figure 1 2 Ensure the jumper configuration on the daughterboard is as in Figure 1 3 Connect the motherboard to the PC with an USB cable through connector CN1 4 Verify the PWR LED lights is on 2 2 3 STM32L preprogrammed application The STM32L STEVAL IDBO05V1 motherboard is preprogrammed with the sensor demo application when the kits components are assembled refer to Section 5 for the application description 14 71 DoclD027602 Rev 2 Ly UM1870 Hardware description 2 3 2 4 STEVAL IDBO05V1D Kit The STEVAL IDBOO5V1D kit is a standalone RF daughterboard which features the BlueNRG MS device an SMA connector for an antenna or measuring instruments and an SPI connector for external microcontroller It can be connected to the STM32L motherboards available with the STEVAL IDBO02V1 and STEVAL IDBO05V1 kits STEVAL IDB005V1D BlueNRG MS daughterboard is identical to the BlueNRG MS daughterboard available within the STEVAL IDBOOS5V1 kit refer to Section 2 2 BlueNRG MS daughterboara Figure 6 STEVAL IDB005V1D BlueNRG MS daughterboard STEVAL IDBO06V1 USB dongle The BlueNRG MS USB dongle allows users to easily add BLE functionalities to their PC by plugging the dongle into a USB port The USB dongle can be used as a simple interface between the BlueNRG MS and a GUI application on the PC The on board STM32L microcontroller can also be programmed so the
48. cription UM1870 Example 3 Wait VENDOR EVENT event code evt WAIT EVENT HCI VENDOR EVENT Using evt get_param Ecode val it s possible to identify the specific HCI VENDOR EVENT parameter type value evtCode evt get param Ecode val if evtCode ACI GATT NOTIFICATION EVENT conn handle evt get param Connection Handle val Example 4 Wait the Ecode ACI GATT PROC COMPLETE EVENT VENDOR EVENT event_code if no event occurs within the selected timeout an exception is raised WAIT EVENT HCI VENDOR EVENT timeout 30 Ecode ACI GATT PROC COMPLETE EVENT Note If no timeout parameter is specified it waits until the GATTI PROC COMPLETE EVENT Example 5 Wait an event for 10 seconds with continueOnEvtMiss set to True If no event occurs the script continues no exception is raised WAIT EVENT timeout 10 continueOnEvtMiss Note If continueOnEvtMiss parameter is set to False and if no event within the selected timeout occurs an exception is raised Example 6 Wait the DISCONNECTION COMPLETE EVENT event code WAIT EVENT HCI DISCONNECTION COMPLETE EVENT Example 7 Create a Connection and wait for the LE CONNECTION COMPLETE EVENT GAP CREATE CONNECTION Peer Address 0x12 0x34 0x00 OxE1 0x80 0x02 event WAIT EVENT HCI LE META EVENT timeout 30 Subevent Code HCI LE CONNECTION COMPLETE EVENT if event get_param Status val 0x00 Store th
49. e 22 shows the whole GATT database including the GATT and GAP services that are automatically added by the stack One of the acceleration service s characteristics has been called free fall characteristic This characteristic cannot be read or written but can be notified The application will send a notification on this characteristic with value equal to 0x01 if a free fall condition has been detected by the LIS83DH MEMS sensor the condition is detected if the acceleration on the axes is near zero for a certain amount of time Notifications can be enabled or disabled by writing on the related client characteristic configuration descriptor The other characteristic exposed by the service gives the current value of the acceleration that is measured by the accelerometer The value is made up of six bytes Each couple of bytes contains the acceleration on one of the 3 axes The values are given in mg This characteristic is readable and can be notified if notifications are enabled Another service is also defined This service contains characteristics that expose data from some environmental sensors temperature pressure and humidity For each characteristic a characteristic format descriptor is present to describe the type of data contained inside the characteristic All of the characteristics have read only properties An expansion board with LPS25H pressure sensor and HTS221 humidity sensor can be connected to the motherboard through t
50. e connection handle conn handle event get param Connection Handle val User defined code GUI script engine loading and running steps To load and run a python script using the BlueNRG MS GUI script engine the following steps must be observed 36 71 DoclD027602 Rev 2 Ly UM1870 GUI software description Note 3 2 5 3 1 Inthe BlueNRG MS GUI Scripts window Script Engine section click on tab browse to the script location and select the script 2 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 section In the BlueNRG MS DK 1 7 0 and future versions some reference BlueNRG MS scripts are available in the GUl scripts folder It is worthy of note that in order to write and use the BlueNRG MS scripts the user is required to have some knowledge of the Python language Python 2 7 6 and a good understanding of the BlueNRG MS ACI commands and related events GUI Beacon window The BlueNRG MS GUI Beacon window provides some tabs allowing configuration of a BlueNRG MS device as a BLE Beacon device which transmits advertising packets with specific manufacturer data Figure 16 BlueNRG MS GUI Beacon window 27 BlueNRG GUI v1 9 0 So File Tools Settings _ BlueNRG MS HW v3 1 Port 197 ST Di Reset BlueNRG MS FW v7 1c Motherboard FW v1 8 ACI Comm
51. g as a peripheral The central device can be another BlueNRG MS acting as a master or any other Bluetooth smart or smart ready device First BlueNRG MS must be set up In order to do this a series of command need to be sent to the processor 5 3 1 Initialization BlueNRG MS s stack must be correctly initialized before establishing a connection with another Bluetooth LE device This is done with two commands aci gatt init gap init GAP PERIPHERAL ROLE 0 0x07 amp service handle amp dev name char handle amp appearance char handle Where PERIPHERAL ROLE privacy enabled 0 device name char len 0x07 See ACI documentation for more information on these commands and on those that follow as well Peripheral role privacy enabled or not device name length must be specified inside the aci gap init command 5 3 2 Add service and characteristics BlueNRG MS s Bluetooth LE stack has both server and client capabilities A characteristic is an element in the server database where data are exposed service contains one or more characteristics Add a service using the following command Parameters are provided only as an example add serv 0x01 0xA001 0x01 0x06 amp Service Handle Ly DoclD027602 Rev 2 47 71 BlueNRG MS sensor profile demo UM1870 5 3 3 5 3 4 5 3 5 48 71 Where Service UUID 0 01 Service UUID 1620xA001 Service 0
52. greater than zero is set and continueOnEvtMiss is False and no event occurs before the timeout an HClTimeoutError error happens Otherwise if the input parameter continueOnEvtMiss is True and a timeout greater than zero is set the macro command returns the value None even when no event occurs before the timeout If one or more optional filtering parameters are specified the macro command performs a check on them and it returns only the first detected event that satisfies these parameters The events received before the one returned are discarded The WAIT EVENT command return value can be e anevent e None if a timeout occurs and the input parameter continueOnEvtMiss is set to True An HClITimeoutError error exception is raised when a timeout occurs The event code parameter can be one of the following values Table 11 Event codes with related event parameter types event code LE META EVENT event par type event parameter type value LE CONNECTION COMPLETE EVENT HCI LE ADVERTISING REPORT EVENT HCI LE CONNECTION UPDATE COMPLETE EVENT Subevent Code LE READ REMOTE USED FEATURES COMPLETE EVENT HCI LE LONG TERM KEY REQUEST EVENT 3 DoclD027602 Rev 2 33 71 GUI software description UM1870 Table 11 Event codes with related event parameter types continued event code HCI VENDOR EVENT event par type Ecode event parameter type
53. has data to be sent it will send notifications which will contain the value of the TX characteristic The characteristic this is a writable characteristic When the client has data to be sent to the server it will write a value into this characteristic e The maximum length of the characteristic value is 20 bytes There are 2 device roles which can be selected through the specific EWARM workspace Server that exposes the chat service BLE peripheral device The Client that uses the chat service BLE central device The application requires 2 devices to be programmed respectively with the 2 devices roles server and client The user must connect the 2 devices to a PC through USB and open a serial terminal on both with the following configurations Table 13 Serial port configuration Baudrate 115200 bit sec Data bits 8 bit Parity None bit Stop bits 1 bit The application will listen for keys typed into one device and upon pressing the keyboard return key it will send them to the remote device The remote device will listen for RF messages and will output them in the serial port In other words anything typed in one device will be visible to the other device Supported platforms The BlueNRG MS chat demo server amp client roles is supported on the BlueNRG MS development platform STEVAL IDB005V1 BlueNRG MS daughterboard STEVAL IDBOO5V1D and on BlueNRG MS USB dongle
54. he expansion connector F in Figure 4 If the expansion board is not detected only temperature from STLM75 will be used DoclD027602 Rev 2 45 71 BlueNRG MS sensor profile demo 5 1 5 2 46 71 Figure 22 BlueNRG MS sensor demo GATT database UM1870 3 0003 2A05 Service Changed start handle 0x0001 end handle 0xFFFF 4 0004 2902 Client Characteristic Configuration 0x0000 7 0007 2A00 Device Name 9 0009 2A01 Appearance 0x0000 E23E78A0CFA4A11E18FFCO Indication with value 1 when freel fall 002 505 51 Deren 900 condition is detected 2902 Client Characteristic Configuration 0x0000 14 000 0002 340A1B80CF4B11E1AC3600 Axis 2bytes Y Axis 2bytes Z Axis 02 505 518 Acceleration 0x000000000 2bytes 18 0012 2902 Client Characteristic Configuration 0x0000 A32E5520E47711E2A9E300 Temperature in tenths of degree 21 0015 cy Temperature 0x0000 m 2904 Characteristic Format fformat 0x0E exp 1 unit 0x272F n_sp 0x00 format sint 16 unit temperature 0 0000 celsius descr 0x 2803 1 CN udi oo a Pressure 0000000 Pressure in hundredths of millibar 25b S 2904 Characteristic Format lormat Ox0F exp 5 unit 0x2780 n_sp 0x00 format sint24 unit pressure bar descr 0x0000 01C50B60E48C11E2A07300 27 0018 02 505 51 Humidity 0x0000 Humidity in tenths of RH 001C 2904 Characteristic Format fformat 0x06 1 0 2700 n
55. ltaneous advertising and scanning up to 4 connections small GATT database RAM2 on during sleep e 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 Change sleep clock accuracy This must reflect the actual clock accuracy depending on the low speed oscillator or crystal in use Setlow speed LS crystal period and frequency e View change date to distinguish between different versions of configurations View registers that are written into the radio hot and cold table e Set some test modes for specific tests e Read IFR content from BlueNRG MS e Write IFR configuration to BlueNRG MS IFR The following general utilities are also available Load button allows to load a configuration file Save button allows to save the current parameters into a configuration file Flash motherboard firmware The BlueNRG MS GUI embeds a utility that allows to Flash firmware to the STM32L microcontroller on the motherboard without a JTAG SWD programmer This utility uses a bootloader that has been programmed in the first 12 KB of the Flash Any application to be programmed to the STM32L by this tool must first consider that the lower area of the Flash is used by the bootloader P OT
56. nection handle is the handle returned on connection creation as parameter of the EVT LE CONN COMPLETE event Once these ACI commands have been sent the values of the TX RX characteristics are displayed on the serial terminals DoclD027602 Rev 2 Ly UM1870 BlueNRG MS chat demo application Figure 24 BLE chat client example Figure 25 BLE chat server example 8 COM76 115200baud Tera Term VT elm COM78 115200baud Tera Term VT File Edit Setup Control Window Help File Edit Setup Control Window Help 4 DoclD027602 Rev 2 55 71 BlueNRG MS Beacon demonstration application UM1870 7 7 1 7 2 7 2 1 7 2 2 Note 56 71 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 Supported platforms The BlueNRG MS Beacon demo is supported by the BlueNRG MS development platform STEVAL 005 1 BlueNRG MS daughterboard STEVAL IDBOO5V 1D and on BlueNRG MS USB dongle STEVAL IDBOO6V 1 BLE Beacon application setup This section describes how to configure a BlueNRG MS device for acting as a beacon device Initialization The BlueNRG MS stack must be correctly initialized as follows aci gatt init aci gap ini
57. nitialize a device by selecting Role Stack Mode 1 2 3 4 Init Device Address type Public Random and value Tx power level Power mode Device Name Allows to add a service by selecting UUID type 16 or 128 bits After a characteristic is Service Type Primary or Secondary defined me User Cen edit its parameters Set max number of records and or delete if For each service it allows to add a characteristic Once a service and iis and related descriptors by selecting characteristics Msnagethisiitos UUID type 16 or 128 bits descriptors have been Properties Security permissions Variable length or not Length GATT Event mask Encryption key size defined click OK to add them to the GATT database The defined GATT database is showed on a specific view Service Discovery Allows to discover all services and related characteristics of available connections Service start handle end handle and UUID are showed For each selected Service the related Characteristics information are showed attribute handle property value handle and UUID For the available characteristic with Notify or Indication Property its possible to enable the Notification Indication Terminate Connection Allows to terminate the available connections DoclD027602 Rev 2 4 UM1870 GUI software description Table 7 GUI ACI utilities window available central
58. oard is identical to the BlueNRG MS daughterboard available within the STEVAL IDBOO5V1 kit DoclD027602 Rev 2 62 71 UM1870 Available board schematics 4 Figure 27 STEVAL IDB005V1 temperature sensor I2C1 12 1 SDA 10k 0603 R2 SDA VDD SCL 0 nOS INT A1 TSEN INT GND A2 C STLM75 Vcc 3V3 R ORO 0603 C1 gt 100 0603 X7R 10 0603 5 GSPG0210D11130 Figure 28 STEVAL IDB005V1 accelerometer Vcc 3V3 Vcc 3V3 Vdd IO NC NC SCL SPC GND SDA SDI SDO SDO SAO cs LIS3DH R3 3V3 SPI1_SCK SPI1_MOSI SPI1 MISO SPI1_NSS c4 R ORO 0603 C3 C 100N 0603 X7R C 10 0603 X5R GSPG0210D11135 DoclD027602 Rev 2 63 71 UM1870 Available board schematics Figure 29 STEVAL IDB005V1 MCU NSO wos 6090 NOOO oas las uoyng usnd oo Lol_aa zol 8a 1431 M31N39 dn aor Wa 95 dd 5 snar MX 5090 00 62 WOOL WHOOE dec m n A9 M 5080 9080 1 5 33 9900 gt 5090 NOOL 2 MJX 5090 001 zz QD oz 22 rsUBDo 82 13 dd 32890550 _ T lt v 5 5 96
59. ocal name 0x00 0x00 0x0000 0x0000 Where Advertising 0 00 Advertising Interval 0 800 Advertising Interval 0 900 Own Address 0 00 Advertising Filter Policyz0x00 Local Name 0 08 local name AD TYPE COMPLETE LOCAL NAME B l u e N R G Service UUID Lengthz0x00 Service UUID List 0x00 Slave Connection Interval Minz0x0000 Slave Connection Interval 0 0000 The Local Name parameter contains the name that will be present in advertising data as described in Bluetooth core specification version 4 1 Vol 3 Part C Ch 11 Connection with central device Once BlueNRG MS is put in a discoverable mode it can be seen by a central device in scanning Any Bluetooth smart and smart ready device can connect to BlueNRG MS such as a smartphone LightBlue is one of the applications in the Apple store for iPhone 45 5 and later versions of Apple s iPhone Start the LightBlue application It will start to scan for peripherals A device with the BlueNRG MS name will appear on the screen Tap on the box to connect to the device A list of all the available services will be shown on the screen Touching a service will show the characteristics for that service DoclD027602 Rev 2 Ly UM1870 BlueNRG MS sensor profile demo 5 4 5 4 1 BlueNRG MS has added two standard services GATT Service 0x1801 and GAP service 0x1800 Try to read the characteristic from the
60. ocal name and type complete or short Advertising Advertising intervals min amp max Policy Allow scan request from any allow connect request from any Allow scan request from white list only allow connect request from any Allow scan request from any allow connect request from white list only It allows to update the advertising data Update allows to set the scan response data Advertising Data It allows to update the location UUID major and minor number defined on the Beacon window 3 2 4 GUI Scripts window The GUI Scripts window allows the user to load and run a python script built using the available set of BlueNRG MS ACI commands and the related events For a list of supported HCI and ACI script commands and related parameters refer to the commands available in the BlueNRG MS GUI ACI Commands window 30 71 DoclD027602 Rev 2 Ly UM1870 GUI software description 3 Figure 15 BlueNRG MS GUI Scripts window section r 7 BlueNRG GUI v1 9 0 iS i x Port COM197 ST Scripts Engine Load Script File N Time ACI Commands File Tools Settings Help ACI Utilities Scripts Run Script Update 7 Autoscroll Sent Received Packets 09 00 04 838 ACI HAL SET TX POWER LEVEL 09 00 04 848 COMMAND COMPLETE EVENT 12 09 004848 ACI GAP SET D
61. oclD027602 Rev 2 21 71 GUI software description UM1870 3 2 1 22 71 GUI main window Figure 9 BlueNRG MS GUI main window 27 BlueNRG GUI v1 9 0 p elaks File Tools Settings Help BlueNRG MS HW v3 1 Port COM197 ST DK HW Reset BlueNRG MS FW v7 1c EE ACI Commands ACIUties Scripts Beacon RFTest SET NON DISCOVERABLE Command Packet ACLGAP SET LIMITED DISCOVERABLE Parameter Value Literal Info GAP SET DISCOVERABLE ACLGAP SET DIRECT CONNECTABLE ACI SET IO CAPABILITY SET AUTHENTICATION REQUIREM ACLGAP SET AUTHORIZATION REQUIREME GAP PASS KEY RESP ACLGAP AUTHORIZATION RESP ACLGAP INIT GAD SET CONNECTARI E D Filter SELECT ALL V GAP 7 12 7 HCI Test Clear List Update V Autoscroll Send Sent Received Packets Packet Details Parameter Value Literal Info 0 085734216 ACLGATTINT orc 8 1 08 57 34 226 COMMAND COMPLETE EVENT on B CETT oo 3 08 57 39 516 COMMAND COMPLETE EVENT 0x00 007 The BlueNRG MS GUI 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
62. on the BlueNRG MS platform The value of this characteristic is a bitmap of 1 byte Each bit controls one of the LEDs e bitO is the status of LED 1 e bit 1 is the status of LED 2 e bit 2 is the status of LED e bit 3 is the status of LED 4 e bit 4 is the status of LED 5 As a consequence a remote device can connect and write this byte to change or read the status of these LEDs 1 for LED ON 0 for LED OFF The peripheral disconnects after a timeout DISCONNECT_TIMEOUT to prevent that a central is always connected to the device By default no security is used but it can be enabled with ENABLE SECURITY refer to file BLE RC main h When security is enabled the central has to be authenticated before reading or writing the device characteristic In order to interact with a BlueNRG MS device configured as BLE Remote control another BLE device a BlueNRG MS or any SMART READY device can be used to scan and see broadcast data To control one of the LEDs the device has to connect to a BlueNRG MS BLE Remote Control device and write into the exposed control point characteristic The Service UUID is ed0ef62e 9b0d 11 e4 89d3 123b93f75cba The control point characteristic UUID is ed0efb1a 9b0d 11 e4 89d3 123b93f75cba Supported platforms The BlueNRG MS BLE Remote Control is supported on the BlueNRG MS development platform STEVAL_IDBO05V1 BlueNRG MS daughterboard STEVAL IDBO05V1D and on BlueNRG MS USB dongle STEVAL_IDBOO6V
63. on and free fall characteristics notifications coming from the Sensor Peripheral device are received through the Master PeerDataExchange CB master library callback NOTIFICATION DATA RECEIVED code Each received values is displayed on the connected hyper terminal 115200 8 N 1 Read the sensor peripheral temperature sensor characteristic Once the Sensor Peripheral device sensor temperature characteristic is discovered the Sensor Central device can read the related characteristic value by using the following master library command Master Read Value Refer to the master library doxygen documentation for more information about the command and related parameters The characteristic value is received though the Master PeerDataExchange CB master library callback READ VALUE STATUS code Each received value is also displayed on the connected hyper terminal 115200 8 N 1 DoclD027602 Rev 2 51 71 BlueNRG MS chat demo application UM1870 6 6 1 6 2 52 71 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 The chat service contains 2 characteristics The TX characteristic the client can enable notifications on this characteristic When the server
64. or such product ST and the ST logo are trademarks of ST All other product or service names are the property of their respective owners Information in this document supersedes and replaces information previously supplied in any prior versions of this document 2015 STMicroelectronics All rights reserved 3 DoclD027602 Rev 2 71 71
65. oth core specification version 4 1 Vol 3 Part C Ch 11 Connection with central device Once the BLE chat server role device is put in a discoverable mode it can be seen by the BLE chat client role device in order to create a Bluetooth low energy connection On BLE chat client role device uses GAP ACI commands to connect with the BLE chat server role device in advertising mode aci gap create connection 0x4000 0x4000 PUBLIC ADDR bdaddr PUBLIC ADDR 9 9 0 60 1000 1000 where bdaddr is the peer address of the BLE chat client role device Once the 2 devices are connected the user can set up a serial terminal and type into each of them The typed characters will be respectively stored in 2 buffers and upon pressing the keyboard return key BLE communication will work as follows 1 OnBLEchat server role device the typed characters will be sent to BLE chat client role device by notifying the TX characteristic that has been previously added after notifications have been enabled This can be done using the following command aci gatt update char value chatServHandle TXCharHandle 0 len tHalUint8 cmd j 2 OnBLEchat client role device the typed characters will be sent to the BLE chat server role device by writing the RX characteristic that has been previously added This can be done using the following command aci write without response connection handle RX_HANDLE 1 len tHalUint8 Where con
66. pment kit software includes sample code that shows how to configure BlueNRG MS and send commands or parsing events The source library is called simple BlueNRG MS HCI to distinguish it from the library for the complete profile framework not present in the software development kit This library is able to handle multiple profiles at the same time and supports several Bluetooth GATT based profiles for BilueNRG MS Documentation on the ACI is provided in a separate document Figure 21 Profile framework structure Proximity FindMe HOGP Basic profile framework Requirements In order to communicate with BlueNRG MS network processor very few resources are needed by the main processor These are listed below SPI interface Platform dependent code to write read to from SPI Atimer to handle SPI timeouts or to run Bluetooth LE Profiles Minimum requirements in terms of Flash and RAM space largely depend on the functionality needed by the application on the microprocessor that will run the code and on the compiler toolchain used to build the firmware Software directory structure The Projects folder contains some sample code that can be used on the application processor to control the BlueNRG MS Platform dependent code is also provided for STM32L1 platforms The example project provided in the package will run as is on the development kit The files are organized using the following folder struct
67. r on the board can also be programmed so the board can be used to develop applications using the BlueNRG MS A connector on the motherboard Figure 1 allows access to the JTAG interface for programming and debugging The board can be powered through a mini USB connector that can also be used for I O interaction with a USB Host The board includes sensors and buttons and a joystick for user interaction The RF daughterboard can be easily connected through a dedicated interface This is a list of some of the features that are available on the boards e STM32L151RBT6 64 pin microcontroller e Mini USB connector for power supply and I O JTAG connector e RF daughterboard interface One RESET button and one USER button e OneLIS3DH accelerometer e One STLM75 temperature sensor joystick e 5LEDs e One PWR LED e battery holder for 2 AAA batteries e One row of test points on the interface to the RF daughterboard Figure 4 Motherboard for the BlueNRG MS development kit DoclD027602 Rev 2 Ly UM1870 Hardware description 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
68. s 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 auto scrolling check boxes enable or disable updating and auto scrolling of the Sent received packets table while new packets are sent or received however information will still be printed The sent received packets can be stored and later reloaded on the GUI by using the utilities provided on File menu 1 History it saves the current list of sent commands and received events CSV file 2 Load History it loads a list of sent commands and received events previously stored on a CSV file 3 Save Python Script it allows to store the current list of sent commands and received events as a script file python format This script file can be used on GUI Script window after proper customization by adding specific code for handling events parameters in order to address an user application scenario refer to Section 3 2 5 Tools The BlueNRG MS GUI has some functions that can be accessed through the tools menu These tools are described in this section BlueNRG MS updater This tool can be used to update the firmware inside the BlueNRG MS by using its internal bootloader VCOM firmware must be present on the STM32L and COM port must be open in order to use this f
69. s Functions Master Data Exchange Functions Master Security Functions Master Common Services Functions These APIs are provided through binary libraries available on Projects Bluetooth LEWProfile Framework The master library APIs are documented in doxygen format within the SW package The BlueNRG MS Sensor Demo Central role is supported on the BlueNRG MS development platform STEVAL IDB005V1 BlueNRG MS daughterboard STEVAL IDBOO5V1D and on BlueNRG MS USB dongle STEVAL_IDBOO6V 1 The sections that follow describe how to use the master library APIs for configuring a BlueNRG MS Sensor Demo Central device Initialization BlueNRG MS s master library must be correctly initialized before establishing a connection with another Bluetooth LE device This is done with this command Master Init amp param DoclD027602 Rev 2 49 71 BlueNRG MS sensor profile demo UM1870 5 4 2 5 4 3 5 4 4 50 71 param variable allows to set the initialization parameters device address name Refer to the master library doxygen documentation for more information about the command and related parameters On the application main loop the Master Process API has to be called in order to process the Master library state machines 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
70. t GAP PERIPHERAL ROLE 0 0x07 amp service handle amp dev name char handle amp appearance char handle Define advertising data The BLE Beacon application advertises the following manufacturing data Table 14 BlueNRG MS Beacon advertising manufacturing data Data field Description Notes Default is 0 0030 Company identifier code SIG company identifier STMicroelectronics ID Beacon ID Fixed value Location UUID Beacons UUID Used to gistinguish specific beacons from others Used to group a related set of Major number Identifier for a group of beacons beacons Minor number Identifier for a single beacon Used to identify a single beacon Tx Power 2 s complement of the Tx power Hepes HOW tae you are from device SIG company identifiers are available at https www bluetooth org en us specification assigned numbers company identifiers DoclD027602 Rev 2 Ly 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 uses the following GAP ACIs Remove TX power level field from the advertising data it is necessary to have enough space for the
71. ted also to a row of test points M a The STM32L is preprogrammed with a DFU firmware that allows the downloading of a firmware image without the use of a programmer If an user accidentally erases DFU firmware he can reprogram it through STLink using the hex image DFU Bootloader hex available on BlueNRG MS DK SW package firmware folder 12 71 DoclD027602 Rev 2 Ly UM1870 Hardware description 2 2 BlueNRG MS daughterboard The BlueNRG MS daughterboard Figure 5 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 for RF matching and balun and small number of additional components required by the BlueNRG MS for proper operation see the schematic diagram in Figure 26 Figure 5 BlueNRG MS daughterboard Bons lan UH The main features of the BlueNRG MS daughterboard J BlueNRG MS low power network processor for Bluetooth low energy BLE with embedded host stack High frequency 16 MHz crystal Low frequency 32 kHz crystal for the lowest power consumption Integrated balun and harmonic filter SMA connector The daughterboard is also equipped with a discrete inductor for the integrated high efficiency DC DC converter for best in class power consumption It is still possible
72. the BLE controller When a COM port is opened the following information are displayed BlueNRG MS HW version BlueNRG MS FW version STM32L motherboard GUI firmware VCOM version commands The Commands tab contains a list of all the available commands Commands be filtered by checking unchecking boxes under the filter section After clicking on one of the commands all the packet fields will be displayed on the command packet table in the upper right section of the tab see Figure 10 3 DoclD027602 Rev 2 UM1870 GUI software description Figure 10 Command packet table GATT INIT Command Packet ACLGATT ADD SERVICE Parameter Value Literal Info ACI GATT INCLUDE SERVICE ACI GATT ADD CHAR GATT ADD CHAR DESC ACI GATT UPDATE CHAR VALUE GATT DEL CHAR ACI GATT DEL SERVICE GATT DEL INCLUDE SERVICE GATT SET EVENT MASK r7 SELECT ALL GAP V HAL L2CAP HCI Test HCI 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 e Value field value represented hexadecimal format right click on a cell to change its representation format e Literal meaning of the current field value e Info description of the corresponding
73. tility commands continued Command name GET LIST Parameters Integer Number of bytes Description Convert the integer value to an array of Number of bytes Example X 0x2233 LIST X 2 0x33 0x22 Return the device information HW version amp GET STACK VERSION None FW version as hw fw Returns a random number between 0 and GET RAND KEY None 999999 INSERT PASS KEY Allows to enter a pass key value used for the security pass key method Print utility it displays information on GUI PRINT string Sent Received Packets RESET None SW reset SLEEP time sleeps for time milliseconds SET_MODE Mode Set stack mode 1 2 3 4 Mode 4 is supported from BlueNRG MS FW stack version 7 1 b SET_PUBLIC_ADDRESS Public address Set public address optional SENSORDEMO GET TE It allows to get the temperature value from the MPERATURE None ACI ATT READ RESP EVENT only for the SensorDemo Central script it allows to get the acceleration values 2 AG None from the GATT NOTIFICATION EVENT CELERATION only for the SensorDemo Central script TIME It returns the time as floating point number expressed in seconds since the epoch in UTC The following pseudo code describes how to initialize a BlueNRG MS device as a peripheral using a simple python script Reset BlueNRG MS HW RESET
74. to disable the DC DC converter In this case the following changes must be performed on the daughterboard see Figure 26 Remove inductor from solder pads 1 and 2 of D1 Place a 0 ohm resistor between pads 1 and 3 Move resistor on R2 to R1 For proper operation jumpers must be set as indicated in Figure 5 The following tables show the connections between the daughterboard and the main board DoclD027602 Rev 2 13 71 Hardware description UM1870 Table 2 Connections between BlueNRG MS board and motherboard on left connector Pin J4 motherboard J3 daughterboard 1 DB NC 2 3V3 3V3 3 DB_PIN3 NC 4 NC NC 5 GND GND 6 DB_PIN2 ns 7 GND GND 8 3V3 U2 pin 1 9 DB_SDN_RST RST 10 3V3 U2 pin 1 Table 3 Connections between BlueNRG MS board and motherboard on right connector Pin J5 motherboard J4 daughterboard 1 GND GND 2 GND GND 3 DB_CSN CSN 4 _1 IRQ IRQ 5 DB SCLK CLK 6 DB 102 NC 7 DB SDI MOSI 8 DB 101 NC 9 DB SDO MISO 10 DB 100 NC 2 2 1 Current measurements To monitor power consumption of the entire BlueNRG MS daughterboard remove the jumper from U2 and insert an ammeter between pins 1 and 2 of the connector Since power consumption of the BlueNRG MS during most operation time is very low an accurate instrument in the range of few microamps may be required 2 2 2 Hardware setup 1 Plug the BlueNRG MS d
75. unction 1 Goto Tools gt BlueNGR updater 2 Selectthe correct stack firmware img 3 Press update to start the update procedure If the procedure completes with no errors the new firmware has been loaded into the BlueNRG MS internal Flash DoclD027602 Rev 2 Ly UM1870 GUI software description BlueNRG MS IFR To preserve BlueNRG MS s flexibility its firmware uses a table of configurable parameters This table resides in a sector of the Flash called Information Register IFR The BlueNRG MS IFR tool can read and modify this portion of BlueNRG MS s Flash This tool is available in BlueNRG MS GUI Tools BlueNRG IFR item The BlueNRG MS GUI IFR utility is a tool that allow the customer to define the IFR data in a controller way Using this utility is the only supported mode to define IFR data based on customer needs The utility provides the following windows e View Edit view displays the IFR regions with related fields and description The user can modify some of these fields according to his needs Memory view displays the IFR field memory addresses and related values that are generated by BlueNRG MS GUI according to the specified values C view displays the C language structure related to the IFR configuration data region matching the View Edit and Memory view Figure 13 BlueNRG GUI IFR tool View Edit view y BlueNRG IFR BuchRG MS View Edit Memory View C View
76. ure Drivers It contains all the STM32L1xx Cube library framework files MiddlewaresST STM32 BlueNRG SimpleBlueNRG Contains the code that is used to send ACI commands to the BlueNRG MS network processor It contains also definitions of BlueNRG MS events platform Contains all the platform dependent files only on STM32L1xx standard library framework These can be taken as an example to build applications that can be run on other platforms Project Cube Projects STD Library Contains source based respectively on STM32L1xx Cube library and on STM32L1xx standard library frameworks that DoclD027602 Rev 2 43 71 Programming with BlueNRG MS network processor UM1870 can be used as an example to build other applications that will use the Bluetooth technology with the BlueNRG MS Project files for IAR embedded workbench are also available 44 71 DoclD027602 Rev 2 Ly UM1870 BlueNRG MS sensor profile demo 5 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 The purpose of this project is simply to show how to implement a given profile This profile exposes two services acceleration service and environmental service Figur
77. value ACI BLUE INITIALIZED EVENT ACI GAP LIMITED DISCOVERABLE EVENT GAP PAIRING COMPLETE EVENT ACI GAP PASS KEY REQ EVENT GAP AUTHORIZATION EVENT ACI GAP SLAVE SECURITY INITIATED EVENT BOND LOST EVENT GAP DEVICE FOUND EVENT GAP PROC COMPLETE EVENT ACI GAP RECONNECTION ADDRESS EVENT ADDR NOT RESOLVED EVENT ACI L2CAP CONNECTION UPDATE RESP EVENT L2CAP PROC TIMEOUT EVENT L2CAP CONNECTION UPDATE EVENT ACI ATTRIBUTE MODIFIED EVENT GATT PROC TIMEOUT EVENT EXCHANGE MTU RESP EVENT FIND INFO RESP EVENT FIND BY TYPE VALUE RESP EVENT READ BY TYPE RESP EVENT ACI ATT READ RESP EVENT ACI ATT READ BLOB RESP EVENT READ MULTIPLE RESP EVENT ACI ATT READ BY GROUP TYPE RESP EVENT ACI ATT WRITE RESP EVENT PREPARE WRITE RESP EVENT EXEC WRITE RESP EVENT GATT INDICATION EVENT ACI NOTIFICATION EVENT GATT PROC COMPLETE EVENT ACI GATT ERROR RESP EVENT ACI GATT DISC READ CHAR BY UUID RESP EVENT ACI GATT WRITE PERMIT REQ EVENT GATT READ PERMIT REQ EVENT ACI GATT READ MULTI PERMIT REQ EVENT ACI GATT TX POOL AVA
78. with DFU application allowing upgrades to the STM32L firmware image through USB and using the BlueNRG GUI To activate the DFU press button SW1 and plug the BlueNRG MS USB dongle into a PC USB port User LEDs Two LEDs are available D2 red D3 orange When DFU is activated LED D3 is blinking BALF NRG 01D3 integrated balun BALF NRG 01D3 integrated balun is an ultra miniature balun which integrates a matching network and harmonics filter Hardware setup Plug the BlueNRG USB dongle into a PC USB port STM32L preprogrammed application The STM32L on the STEVAL IDBOO6V1 motherboard is preprogrammed with the BlueNRG VCOM x x hex application when the kit components are assembled refer to Section 3 1 for the application description DoclD027602 Rev 2 Ly UM1870 GUI software description 3 3 1 3 2 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 commands to the controller and receive events from it It lets the user configure each field of the command packets to be sent and analyzes all received packets In this way BlueNRG MS can be easily managed at low level Requirements In order to use the BlueNRG MS GUI make sure you have correctly set up your hardware and software BlueNRG MS
79. wo BlueNRG MS platforms TX and RX to PC USB ports Open two instances of BlueNRG MS GUI one for TX and RX BlueNRG MS devices In each instance of BlueNRG MS GUI Open COM Port related to TX RX BlueNRG MS device Ensure that antennas are plugged into the BlueNRG MS devices where applicable In the GUI related to RX BlueNRG MS device Go to RF Test window RECEIVER section Set RX frequency Click on Start Receiver Button to start Receiver Test In the GUI related to TX BlueNRG MS device Go to RF Test window TRANSMITTER section Set TX power Set TX Frequency Set Length of Data Set Packet Payload format Click on Start Transmitter Button to start Transmitter Test DoclD027602 Rev 2 UM1870 GUI software description Stop PER test 1 Inthe GUI related to TX BlueNRG MS device Qoto RF Test window TRANSMITTER section Click on Stop Transmitter button The number of transmitted packets are displayed on Packet Transmitted field 2 Inthe GUI related to Rx BlueNRG MS device Qoto RF Test window RECEIVER section Click on Stop Receiver button The number of received packets are displayed on Packet Received field Get PER Packet Error Rate value 1 Inthe GUI related to RX BlueNRG MS device Goto RF Test window RECEIVER section Inthe PER section insert the number of transmitted packet from TX device in the Packet Transmitted field read this value from TRANSMITTER section in the GUI
Download Pdf Manuals
Related Search
Related Contents
DeLOCK USB Bluetooth adapter EDR 80m JVC LYT0105-001B Camcorder User Manual Guía de Usuario de Microarray de Agilent MS-24 U MSM1036 Ma 1507-29.indd Rommelsbacher TL 2595 hob ABUS Secvest 2WAY EVO - Advanced Accessories Copyright © All rights reserved.
Failed to retrieve file