Home

BlueNRG development kits

image

Contents

1. 8090 AWS am 50 QS m ane gosooouswu 200045 OMS 23 zoro ans Im E ayo aye z oN uuo 90 L S anans T zwogws 957 ONVHO waws 8 309 z T 2 gt 5 1 50 o icr 2 224 Teast wasn 2 z4 Tas wasn h 9n T 089 6 089 88 za MOMS 9 zoo ans ns ayo N zovoanss zovoans np T 2080 ayo sug 1 ayo ME 150 1 sss d ans zovo ans NOR Y nat nat SNOL ayo Sco 2080 on HNA ani ZMS IMS 9 322 g sn zoro ons m ASL 92901951 B it 1 Toma wa ye rg E Ped pesos i 8n vu 99 yos hea 2 D 5 xo sir n 01008 T m E mw m z uoyng uogng 40 3 T aun 17 aoa ooa asn 1 85
2. Board function Pin pin LEDs DB connector Buttons Acceler Temperatur USB JTAG Ext joystick e sensor conn VSSA 12 VDDA 13 PAO 14 11 1 15 13 2 16 15 17 17 VSS 4 18 VDD 4 19 4 20 SPI1 NSS PA5 21 SCK PA6 22 SPI1_MISO PA7 23 SPI1_MOSI PC4 24 LED4 PC5 25 LEDS m JOY DOW N 55 JOY 2 28 18 10 29 11 30 2 VSS 1 31 1 32 12 33 DB CSN PB13 34 DB SCLK 14 35 DB_SDO PB15 36 DB 5010 a7 PUSH_BT N PC7 38 DB 1000 39 DB 1010 PC9 40 DB 1020 PA8 41 JOY LEFT 9 45 Ly DoclD025464 Rev 5 9 70 Hardware description UM1686 Table 1 MCU pin description versus board function continued Board function Pin Pin LEDs DB connector Buttons Acceler Temperatur USB JTAG Ext joystick e sensor conn PA10 43 JOY_UP PA11 44 PA12 45 USB_D P PA13 46 JTMS 16 VSS_2 47 VDD 2 48 PA14 49 JTCK 14 PA15 50 JTDI 12 PC10 51 DB 52 DB PIN1 PC12 53 DB PIN2 PD2 54 LED3 PB3 55 JTDO 10 PB4 56 JNTRS 8 T PB5 57 TSEN INT PB6 58 2 501 PB7 59 12 1 SDA BOOTO 60 PB8 61 4 PB9 62 VSS 3 63 VDD 3 64 1 These lines are also available o
3. suong Jesf spe 195 1008 9 AMS 1642 ied Aodio 04 95900830150 zoro ans ano Eus zoro ons zoro AOL AD ZOO QNS E y A9 3000 szo szo F 50 ayo elven ENER TIVER ayo ayo ayo ayo ayo aae aae aa ara T ons ons zoroans QNS zoro ons ons ans zoroans zoro ans 30001 3900 AD JuoO dno 3900 ASL 3001 400 ASL 49001 ASL eur 220 920 120 ue E F ANS 55 we T 1 van X73 ayo ayo ayo zavo ans gus 49 PPE n ounama zor ans ayo ans_ GALNNOW LON zoro ons zovoans zarorWeszex 49800 21870 T FE 5 visar 1L 1 apas D ivan 555 T z T T z 51 EE py ads 00 2490 OZ E elvan ped ra eneo zonis P 1 Oyi oynang _ _ iN 88002 LON ses ES hous TOSS 089
4. The user can configure the following advertising data fields for the BLE Beacon device through the BlueNRG GUI Beacon window configuration parameters Table 12 BlueNRG GUI beacon window configuration parameters Data field Address Description Device address Notes Public or Random Device address type Company Identifier Code SIG company identifier Default is 0x0030 STMicroelectronics ID Beacon ID Fixed value DoclD025464 Rev 5 35 70 GUI software description UM1686 3 2 6 36 70 Table 12 BlueNRG GUI beacon window configuration parameters continued Data field Description Notes Location UUID Beacons UID Used to distinguish specific beacons 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 from To configure a BlueNRG platform BLE device click on Set Beacon tab GUI RF Test window The BlueNRG GUI provides the RF Test window that permits the performance of the following tests 1 a tone on a specific BLE RF channel 2 Perform BLE Packer Error Rate PER tests using BLE Direct Test Mode DTM commands Start Stop a tone To start a tone on a specific RF BLE channel perform these s
5. UM1686 y emm User manual BlueNRG development kits Introduction This document describes the BlueNRG development kits and related hardware and software components The BlueNRG is a very low power Bluetooth low energy BLE single mode network processor compliant with Bluetooth specifications core 4 0 The BlueNRG can act as master or slave There are two types of BlueNRG kits 1 BlueNRG development platform order code STEVAL IDB002V1 2 BlueNRG USB dongle order code STEVAL IDBOOSV1 The BlueNRG software package includes a graphical user interface application to control the BlueNRG through a simple ACI protocol December 2015 DoclD025464 Rev 5 1 70 www st com Contents UM1686 Contents 1 Getting Started Eau REGE Rb S e sage 5 1 1 STEVAL IDB002V1 kit contents 5 1 2 STEVAL IDBOOSV1 kit nh 5 13 System requirements 6 1 4 BlueNRG development kit setup 6 2 Hardware description 7 2 1 STEVAL IDBO02V1 motherboard 7 2 1 1 Microcontroller and connections 8 2 1 2 POWOL sodes eiu Mae eu PR VOR pde ae D Gees t 10 2 1 3 SENSO y MA wh 11 2 1 4 Extension connector 11 2 1 5
6. FW 6 8 ACI Commands ACI Utlities Scripts Beacon RF Test Service Management Central Role Peripheral Role Scanning z Advertising Connections Update Advertising Data Update Connections Service Discovery Terminate Connections Clear List V Update Autoscroll Send Sent Received Packets Packet Details N Time Type Parameter Value Literal Info CUMPLEIE EVENT 15 09 17 00 940 COMMAND COMPLETE EVENT 1 Central and Peripheral roles are supported with the BLE operations described in Table 6 Table 7 and Table 8 4 DoclD025464 Rev 5 25 70 GUI software description UM1686 26 70 Table 6 GUI ACI utilities window available general operations Operation Init Device Associated actions Allows to initialize a device by selecting Role Stack Mode 1 2 3 Address type Public Random and value Tx power level Power mode Device Name Notes Service Management Allows to add a service by selecting UUID type 16 or 128 bits Service Type Primary or Secondary Set max number of records For each service it allows to add a characteristic by selecting UUID type 16 or 128 bits Properties Security permissions Variable length or not Length GATT Event mask Encryption key size After a c
7. ud oas sd s 99 las ga rq 8189 Vaan NOW V99 uong 2 27 92d VSSA ool aag 2 5 299 59 lol aay gt er 994 294 Por lt gt gt 57 5 2 1431 2 gt 77119 4 99d 1031 2 7 2 ISHN Tsun lt 13838 LNO_OSO LHd bg a gt gt _ NI 2S0 0Hd 1107208058194 al L Vd 2 0560 9104 SWIC 2 SS 219 6194 199 Nas oP as o a 2mm nn c EI lair vas 1021 105 090 00 2 6 090 NOOL 090 WI WOOL S080 1 8 M 9080 NOL O NOW YIDA 090 NOOL 2 1 adog wddog zHW8 02 080 415 4 vH 0029 1954 SW 909 6090 402 0 90 zug XE 900 6090 402 0 99 GSPG0210D11140 DoclD025464 Rev 5 62 70 Available board schematics 4 Figure 28 STEVAL IDB002V1 JTAG SWD
8. 8 2 3 Add service and characteristics 57 8 2 4 Connection with a BLE Central device 58 9 List of 59 10 Available board schematics 60 11 Revision ee e C S e 69 4 70 00 10025464 Rev 5 UM1686 Getting started 1 Getting started This section describes all the software and hardware requirements for running the BlueNRG GUI utility as well as the related installation procedure 1 1 STEVAL IDBOO2V1 kit contents This kit is composed of the following items e 1development motherboard e 1 BlueNRG daughterboard e 12 4 GHz Bluetooth antenna e 1058 cable Figure 1 BlueNRG kit motherboard with the STEVAL IDB002V1 daughterboard connected z 80019 1 2 STEVAL IDBOO3V1 kit This kit is composed of the following items e 1 USB dongle Ly DoclD025464 Rev 5 5 70 Getting started UM1686 Figure 2 STEVAL IDB003V1 BlueNRG USB dongle 1 3 System requirements The BlueNRG graphical user interface utility has the following minimum requirements e PC with Intel processor running one of the following Microsoft operating systems Windows SP3 Windows Vista Windows 7 e Atleast 128 Mb of RAM e 2058 ports e 40 Mb of ha
9. SW is the DFU button BlueNRG USB dongle 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 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 Hardware setup Plug the BlueNRG USB dongle into a PC USB port STM32L preprogrammed application The STM32L on the STEVAL IDB003V1 motherboard is preprogrammed with the BlueNRG VCOM x x hex application when the kits components are assembled refer to Section 3 1 for the application description DoclD025464 Rev 5 Ly UM1686 GUI software description 3 3 1 3 2 GUI software description The BlueNRG GUI included in the software package is a graphical user interface that can be used to interact and evaluate the capabilities of the BlueNRG 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 can be easily managed at low level Requirements In order to use the BlueNRG GUI make sure you have correctly set up your hardware and software BlueNRG GUI installed The STM32L in the STEVAL IDBOO2V1 kit has been preprogrammed with a d
10. ZMS 090 51001 ano 5 YX 090 NOLO 9 4 __ gt uong ee 6S 80 02 8051 64 54 1Sdd NOLLNGHSNd MS LMS 27 090 NOL 49 2090 3001 Y L uasa GSPG0210D11205 DoclD025464 Rev 5 66 70 UM1686 Available board schematics Figure 33 STEVAL IDB002V1 daughterboard connectors J4 J3 3V3 3V3 T 1 4 10 9 SDN DB SDN RST 2 8 1 1 SDN 3 DB PIN2 6 5 CSN 4 0 4 SDI 5 3v3 2 1 DB PIN1 SDO 6 SCLK 1 GPIO2 8 102 03 00000 GPIO3 9 GPIO1 10 J5 Gradconn BB02 KY102 K03 A00000 GPIOO 11 12 1 DB 100 10 9 800 DB SDO DB 101 GPIO1 ue DB SDI RS 668 9549 PROBES DB 102 6 5 CEN DB SCLK DB 103 IRQ 2 1 DB 5 102 03 00000 GSPG0210D11210 4 025464 Rev 5 67 70 UM1686 Available board schematics Figure 34 STEVAL IDB003V1 USB dongle schematics
11. continueOnEvtMiss True Note If the continueOnEvtMiss parameter is set to False and no event within the selected timeout occurs 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 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 the 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 GUI script engine the following steps must be observed 34 70 DoclD025464 Rev 5 Ly UM1686 GUI software description Note 3 2 5 4 1 Inthe BlueNRG 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 GUI Sent Received Packets section In the BlueNRG DK 1 7 0 and future versions some reference BlueNRG scripts are available in the GUl scripts folder It is worthy of note that in order to write and use the BlueNRG scripts the user is requi
12. fov oo 20 0 1 18312002 5 29945309 gt 909 2090 a 2 19 VIX gt ol 7 5 BRB 7 909 20 dzz 0 ooo zoro dzz o 90 So zpvo 909 2070 400 m 9 5 aa 1 E 5 ia WORE T 5080 040 20 Z T ueeMjeq 4080 NOT I PTOS YX 2070 001 0 eo 1030euuo GSPG0210DI1215 DoclD025464 Rev 5 60 70 UM1686 Available board schematics 4 Figure 25 STEVAL IDB002V1 temperature sensor 2 1 SCL 12 1 SDA 10k 0603 R2 SDA SCL nOS INT TSEN INT GND c STLM75 3 3 R1 R ORO 0603 VDD SENS C1 C2 C 100N 0603 X7R C 1U 0603 X5R GSPGO0210D11130 Figure 26 STEVAL IDB002V1 accelerometer Vcc 3V3 Vcc 3V3 SCL SPC GND SDA SDI SDO SDO SA0 CS LISSDH 3V3 R3 SPIT SCK SPI1_MOSI SPIT MISO SPI1_NSS R ORO 0603 C4 C 100N 0603 X7R C 1U 0603 X5R GSPGO0210D11135 025464 5 61 70 UM1686 Available board schematics Figure 27 STEVAL IDB002V1 MCU 6090 NOOL 2 te lt lt 229 2 Bc au zz el 92628 UU lt v 5 5 9 15 5 LI ZENLS E po I gt 01 97 21 108 80 ay
13. 2 4 GUI Scripts window 28 3 2 5 GUI Beacon window 35 3 2 6 GUI RF Test window 36 4 Programming with BlueNRG network processor 41 4 1 Requirements CD ER 41 4 2 Software directory structure 41 5 BlueNRG sensor profile demo 43 5 1 44 52 BlueNRG app for smartphones 44 5 8 BlueNRG sensor profile demo connection with a central device 45 5 3 1 InitializatlOn 2 244 bie ak oe ea EUR wide Gat ae Heed 45 5 3 2 Add service and characteristics 45 5 3 3 Set security requirements 46 5 3 4 Enter connectable mode 46 5 3 5 Connection with central device 46 5 4 BlueNRG sensor demo central profile role 47 5 4 1 Initializatlon 47 5 4 2 Discovery a sensor peripheral device 48 5 4 3 Connect to discovered sensor peripheral device 48 5 4 4 Discovery sensor peripheral services and characteristics 48 5 4 5 Enable sensor peripheral acceleration and free fall notifica
14. 28888 umm ME pei uem 4 A 2 85028066 5 8 NV ayo zl zovo ans aws vazas an 21 984 8 SJ 2 6222 zn et 589 BB St 689 i M mes gra osa 3898 22 ziad anaorsrzenus eva In 50 F 55 sc zva B EG 285 9 viaa u ns OSN 245 12 v EH ud n sraa iamiweovd EE Zuma zany 222 01008 isWouwems C inoztoso siod EP 01008 0 clams siirerva FE roms HOU D ISBN CE er FE ons zoro ans zoo ons PALOMA agan 100 58044 48081 38888 5 PET e zo OYUN T lalalal NOW 1280 NOW DoclD025464 Rev 5 68 70 UM1686 Revision history 11 Revision history Table 17 Document revision history Date Revision Changes 28 Nov 2013 1 Initial release Added reference to the STEVAL IDBOO3V1 BlueNRG USB Dongle Added Section 6 Added Section 9 Added Section 10 Minor text edits throughout the document Added Section 3 2 3 Added Section 3 2 5 10 Dec 2014 3 Added Section 7 Renamed APIs with prefix BLUEHCI Section 5 3 1 to 5 3 5 and 6 2 1
15. GSPG0210D1I1150 3v3 R6 NE R7 NE R9 NE ST Link 3 0 3 6V 5V tolerant IAR J Link 1 2 3 6V 5V tolerant R10 NE 3V3 JNTRST PB 4 13 JTMS AT JTCK PB3 TEG PA15 5 Male Connector RESET NRST 2x10 HDR straight ANN _ R13 NE 2 GND 2 3 4 5 6 7 8 Di D2 D3 D4 05 9 10 1 12 BST QU 13 14 g 8 8 8 15 16 47 18 GND GND GND GND GND GND 19 20 JTAG RS 710 4288 RS 473 8282 GSPG0210D11145 GND Figure 29 STEVAL IDB002V1 USB 3V3 R5 NE USB_5V 1 SOT23 6L T DM 2 DP ___3 USB DP ANN 1 yo41 1012 8 42 410 0603 5 24 GND 4 8 SHELL R11 DM SHELL L4 DM __ USB_DM m ANN 3 1 021 1 022 SHELL R ORO 0603 USBLC6 2P6 SHELL GND era USBUF02W6 ca 12 GND USB miniB C 100N 0603 X7R pnis 4 7 0603 DoclD025464 Rev 5 63 70 Available board schematics UM1686 Figure 30 STEVAL IDB002V1 LED 3V3 3V3 3V3 DL1 DL2 GREEN ORANGE RED W R14 R15 R16 AE SAP AA 1 LED3 gt P AA 510 0603 680 0603 680 0603 3V3 DL4 DL5 BLUE YELLOW W R17 R18 LED4 gt AA 1 LEDS L P AA 680 0603 510 0603 5 210011155 4 64 70 DoclD025464 Rev 5 Available board schematics UM
16. Receiver Length ofData 0x25 x PER Packet Payload 0x00 Pseudo Random bit sequence 9 Packet Transmitted 0 Packet Received 0 Start Transmitter Packet Error Rate PER Start Tone Clear List Update V Autoscroll Sed Parameter Value Literal Info 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 End itis necessary to perform the following procedure Start PER test 1 Connect two BlueNRG platforms TX and RX to PC USB ports 2 Open two instances of BlueNRG GUI one for TX and BlueNRG devices 3 In each instance of the BlueNRG GUI Open the COM port related to TX RX BlueNRG device 4 Ensure that the antennas are plugged into the BlueNRG devices where applicable 5 Inthe BlueNRG GUI related to the BlueNRG device Go to the RF Test window RECEIVER section Setthe RX frequency Click on Start Receiver button to start the Receiver test 6 Inthe BlueNRG GUI related to TX BlueNRG device Go to RF Test window TRANSMITTER section Set TX power Set TX frequency Set Length of data Set Packet payload format Click on the Start Transmitter button to start the Transmitter test DoclD025464 Rev 5 Ly UM1686 GUI so
17. on the BlueNRG development platform STEVAL IDBOO2V1 and on the BlueNRG USB dongle STEVAL IDBOOSV 1 The sections that follow describe how to use the master library APIs for configuring a BlueNRG Sensor Demo Central device Initialization BlueNRG 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 DoclD025464 Rev 5 47 70 BlueNRG sensor profile demo UM1686 5 4 2 5 4 3 5 4 4 48 70 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 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 d
18. the STEVAL IDBOOSV1 GND VDD nRESET SWDIO SWO TRACE 6 SWCLK mcm The connection to the ST LINK V2 interface is given in the table below as shown Figure 5 Table 5 SWD connection Signal name ST LINKV2 pin number pin number 1 14 6 VDD 2 2 1 nRESET 3 T SWDIO 4 7 SWO TRACE 5 13 SWCLK 6 5 RF connector The STEVAL IDBOOSV1 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 IDB003V1 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 6 the two pads for C10 and C42 are shown together with the chip antenna and UFL connector Figure 6 RF connector scheme UFL Connector C42 C10 Antenna DoclD025464 Rev 5 17 70 Hardware description UM1686 2 3 4 Note 2 3 5 Note 2 3 6 2 3 7 18 70 Push buttons For user interaction the board has two buttons both available to the application SWI SW2
19. 0 GUI software description UM1686 Change sleep clock accuracy This must reflect the actual clock accuracy depending on the low speed oscillator or crystal in use Set low speed LS crystal period and frequency 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 Read IFR content from BlueNRG e Write IFR configuration to BlueNRG 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 GUI embeds a utility that allows to Flash firmware to the STM32L microcontroller on the motherboard without a JTAG SWD programmer This utility uses bootloader that has been programmed in the first 12 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 OTA 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 Get production data From the tools menu it is possible to retrieve production information from the BlueNRG daughterboard This data is stored in the EEPROM on t
20. 1686 Figure 31 STEVAL IDB002V1 power supply val zai pm 91a 2090 027 Y 02 2460 9 SH poo UT A MEM 2 E In 2 RUNE A9 Y 5080 o E090 znz MSX E090 915 1149 1968 SH poo vio I A tar DANS s 8sn woze znz 1 5 S vdd 0916 01 sn GSPG0210D11200 65 70 DoclD025464 Rev 5 UM1686 Available board schematics Figure 32 STEVAL IDB002V1 button and joystick 090 001 090 090 090 E090 NOLO 6090 NOLO oey L ezo A aL JL T 022 T NMOG x gt Aor e gt 1481 gt 14871 Hr gt dn gt C gt 1 090 3001 2 090 51001 i 090 51001 2 090 51001 090 51001 Y 2 szy 128 92H szy ENE ayo 090 00 090 00 2 6S 80 02 8051 6 7 54 15 5 MS
21. 7 BlueNRG GUI main window r DELE 0 b lelama File Tools Settings Help BlueliRG HW v3 0 Comes ero e Port conss Pw vea ACI Commands Beacon SET DISCOVERABLE 2 Command Packet GAP SET LIMITED DISCOVERABLE EXEC Value Literal Info GAP SET DISCOVERABLE rum SET DIRECT ACLGAP SET IO CAPABILITY ACLGAP SET AUTHENTICATION REQUIREM SET AUTHORIZATION REQUIREME ACLGAP PASS KEY RESP AUTHORIZATION RESP ACLGAP INIT SET NON CONNECTABLE ACLGAP SET UNDIRECTED SLAVE SECURITY REQ ACLGAP UPDATE ADV DATA ap Fiter SetecT ALL V GATT ATT Fina HCI Test V update Z Autos Sent Received Packets Packet Parameter Value Literal 4 Info 1 101229284 HCLCOMMAND_COMPLETE_EVENT 3 104251151 COMMAND COMPLETE EVENT 5 101301871 COMMAND COMPLETE EVENT The BlueNRG GUI main window is characterized by different zones Some of these zones can be resized Port and interface selection The uppermost zone allows the user to open the COM port associated to the BTLE contr
22. 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 Set beacon manufacturing data on the advertising packet ret aci gap update adv data 27 manuf data DoclD025464 Rev 5 55 70 BLE remote control demo application UM1686 8 8 1 56 70 BLE remote control demo application This demo application shows how to control a remote device like an actuator using a BlueNRG 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 0x0030 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 on the BlueNRG 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
23. AG connector e daughterboard interface e RESET button and one USER button e OneLIS3DH accelerometer e One STLM75 temperature sensor e joystick e 5LEDs e One PWR LED e One battery holder for 2 AAA batteries e One row of test points on the interface to the RF daughterboard DoclD025464 Rev 5 7 70 Hardware description UM1686 Figure 3 Motherboard for the BlueNRG development kit 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 of RAM 32 bit core ARM cortex M3 4 of data EEPROM RTC LCD timers USART 2 SPI ADC DAC and 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 connector Buttons acceler Temperatur Usg jpg Ext joystick e sensor conn VLCD 1 PC13 2 DB SDN RST PC14 3 PC15 4 OSC IN 5 OSC O 6 UT NRST 7 RESET 7 PCO 8 LED1 PC1 9 LED2 PC2 10 DB PC3 11 9 8 70 DoclD025464 Rev 5 Ly UM1686 Hardware description Table 1 MCU pin description versus board function continued
24. BlueNRG sensor profile demo UM1686 5 1 5 2 44 70 Figure 20 BlueNRG sensor demo GATT database 3 0003 2A05 Service Changed start handle 0x0001 end handle 0xFFFF 4 0004 2902 Client Characteristic Configuration 0x0000 9 0009 2A01 Appearance 0x0000 E23E78A0CF4A11E18FFCO T Indication with value 1 when a freel fall 3 002 002 505 518 Fros Fell 5 condition is detected 19 0013 2902 Client Characteristic Configuration 340A1B80CF4B11E1AC3600 X Axis 2bytes Y Axis 2bytes Z Axis 02 505 51 0 000000000000 2bytes 22 0016 2902 Client Characteristic Configuration 0 0000 A32E5520E47711E2A9E300 02A5D5C51B Temperature in tenths of degree Celsius 001A aracteristic Format format 0x0E 1 unit 0x272F n sp 0x00 format sint16 unit temperature 2 4 n Temperature 0x0000 celsius 020 480 48811 2840800 001 02 505 518 0 000000 Pressure in hundredths of millibar 29 0010 2904 Characteristic Format fformat 0x0F exp 5 unit 0x2780 n sp 0x00 format sint24 unit pressure bar descr 0x0000 01C50B60E48C11E2A07300 31 Humidity 0 0000 Humidity in tenths of RH 0020 2904 Characteristic Format fformat 0x06 1 unit 0x2700 n_sp 0x00 dnitcuniiess descr 0x00001 Supported platforms The BlueNRG sensor profile demo is supported only on the BlueNRG development pl
25. EVENT ACI ATT READ MULTIPLE RESP EVENT ATT READ BY GROUP TYPE RESP EVENT WRITE RESP EVENT WRITE RESP EVENT EXEC WRITE RESP EVENT ACI GATT INDICATION EVENT NOTIFICATION EVENT GATT PROC COMPLETE EVENT 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 HCI DISCONNECTION CO MPLETE EVENT ENCRYPTION CHAN GE EVENT 32 70 DoclD025464 Rev 5 4 1686 GUI software description Table 11 WAIT EVENT event codes with related event parameter types continued Event event code Event parameter type value parameter type READ REMOTE VER SION INFORMATION COM PLETE EVENT HCI COMMAND COMPLE TE EVENT HCI COMMAND STATUS EVENT HARDWARE ERROR EVENT HCI NUMBER OF COMPL ETED PACKETS EVENT HCI DATA BUFFER OVER FLOW EVENT HCI ENCRYPTION KEY R EFRESH COMPLETE EVE NT 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 elif evt event code HCI VENDOR EVENT User specific code Example 2 Wait a
26. I provides an RF test using the BLE Direct Test Modes commands that allows users 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 the transmitter e The Frequency of the transmitter Length of data to transmit in each packet Packet payload format as defined in the Bluetooth Low Energy specification Direct Test Mode section By clicking on the Start Transmitter button test reference packets will be sent at a fixed interval RECEIVER section This section permits to set the following items e The Frequency of the receiver By clicking on the Receiver Test button test reference packets will be received at a fixed interval DoclD025464 Rev 5 37 70 GUI software description UM1686 38 70 Figure 16 GUI RF Test TRANSMITTER and RECEIVER sections 57 BlueNRG GUI v1 9 0 bas File Tools Settings Help BlueNRG HW v3 0 Port COMBS ST Dk Eosen BlueNRG FW v6 4 MM MM Motherboard FW v1 8 ACI Commands ACIUtites Scripts Beacon RF Test Test Sent Received Packets Packet Details TRANSMITTER RECEIVER V High Power 7 8 y RX Frequency 2402 MHz Channel 0 7 TXFrequency 2402 MHz Channel 0 x Start
27. Push buttons and joystick 11 2 1 6 JTAG conneclor oii eek e Re RR Rr RR 11 2 1 7 LEDS aa lade to qut Neha UR act 11 2 1 8 Daughterboard interface 11 2 2 BlueNRG daughterboard 12 2 2 1 Current measurements 13 2 2 2 Hardware setup 13 2 2 3 STM32L preprogrammed application 14 2 3 STEVAL IDBO03V1 USB dongle 14 2 3 1 Microcontroller and connections 14 2 3 2 SWD interface 2 2 16 2 3 3 HE CONNECTION iunii e 17 2 3 4 Push D ttons ub eem and Rae 18 2 3 5 User LEDS va user aee e ce ele de UR RR cedo do Me ee 18 2 3 6 Hardware setup 18 2 3 7 STM32L preprogrammed application 18 3 GUI software description 19 3 1 Requirements 19 3 2 The BlueNRG graphical user interface 19 3 2 1 GUI main window cee eas 20 3 2 2 TOOlS ie e RUE DUNG UR REA RE METUO S Red 22 2 70 DoclD025464 Rev 5 Ly 0 1686 Contents 3 2 3 GUI ACI utilities window I 25 3
28. S crystal 10 uH SMPS inductor Force SMPS Off LS source 32 768 kHz crystal 4 7 uH SMPS inductor Configuration Data Stack Mode Mode 2 Large DB 1 connection _ v HS startup time Slave SCA 10012 ppm Master SCA 100 ppm LS Crystal Period 0x190000 LS Crystal Freq 0 28 5 2 Cold Table Reg Addr Test modes _ User mode D LS crystal measure HS startup time measure Warning use Read button to read IFR content gt 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 Mode 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 only master 8 connections small GATT database on during sleep 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 DoclD025464 Rev 5 23 7
29. U2 pin 1 9 DB_SDN_RST RST 10 3V3 U2 pin 1 Table 3 Connections between BlueNRG board and motherboard on right connector Pin J5 motherboard J4 daughterboard 1 GND GND 2 GND GND 3 DB_CSN CSN 4 DB 103 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 daughterboard remove the jumper from U2 and insert an ammeter between pins 1 and 2 of the connector Since power consumption of the BlueNRG during most operation time is very low an accurate instrument in the range of few microamps may be required 2 2 2 Hardware setup Plug the BlueNRG daughterboard into J4 and J5 connectors as in Figure 1 Ensure the jumper configuration on the daughterboard is as in Figure 1 Connect the motherboard to the PC with an USB cable through connector Verify the PWR LED lights is on qe c Ly DoclD025464 Rev 5 13 70 Hardware description UM1686 2 2 3 2 3 2 3 1 14 70 STM32L preprogrammed application The STM32L STEVAL IDBOO2V1 motherboard is preprogrammed with the sensor demo application when the kits components are assembled refer to Section 5 for the application description STEVAL IDB003V1 USB dongle The BlueNRG USB dongle allows users to easily add BLE functionalities to their PC by plugging it into a USB port The USB dongle can b
30. Updated Figure 7 11 12 13 and 14 and caption of Figure 1 Updated Table 6 Table 7 Table 8 and Table 9 11 Mar 2015 4 Updated Section 3 2 2 and Section 3 2 3 Added Table 10 Table 11 and Table 14 Added Section 5 4 and Section 8 Added Figure 26 27 28 29 30 31 32 33 and 34 24 Apr 2014 2 Updated Figure 7 Figure 11 Figure 12 Figure 13 Figure 14 Figure 15 Figure 16 Figure 17 and Figure 18 Updated Section 3 2 4 GUI Scripts window Updated Table 10 Added Section 3 2 6 GUI RF Test window 09 Dec 2015 5 Ly DoclD025464 Rev 5 69 70 UM1686 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 sha
31. ad 0x00 Pseudo Random bit sequence 9 Packet Transmitted 0 2 Packet Received 0 Start Transmitter Packet Error Rate PER Start Tone Clear List 7 Update V Autoscroll Send Sent Received Packets Packet Details N Time Type E Parameter Value Literal Info 5 HUI CUIMELE EVEIN I 09 19 20 279 TRANSMITTER TEST 7 09 19 20 289 COMMAND COMPLETE EVENT 1 09 19 22 688 COMMAND COMPLETE EVENT 09 19 22 688 LE TX TEST PACKET NUMBER 09 19 22 698 COMMAND COMPLETE EVENT 025464 5 39 70 GUI software description UM1686 Figure 18 GUI RF Test PER test RX device rasan po File Tools Settings Help me BlueNRG HW v3 0 ACI Commands ACLUutiiies Scipts Beacon RFTest Test TRANSMITTER RECEIVER V High Power 7 x RX Frequency 2402 MHz Channel 0 m Frequency _ 2402 MHz Channel 0 Packet Received Start Receiver 3817 Length of Data 0x25 z PER Packet Payload 0x00 Pseudo Random bit sequences Packet Transmitted 3817 Packet Transmitted Packet Received 3817 Start Transmitter 0 9 Packet Error Rate 0 0 Start Tone Clear List V Update Autoscroll Sent Received Packets Pac
32. ar handle Define advertising data The BLE Beacon application advertises the following manufacturing data Table 14 BlueNRG Beacon advertising manufacturing data Data field Description Notes Company identifier code SIG company identifier 2 Beacon ID Fixed value Location UUID Beacons UUID Used to UIS specitic beacons 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 2 s complement of the Tx power NW tar you are from device SIG company identifiers are available at https www bluetooth org en us specification assigned numbers company identifiers DoclD025464 Rev 5 Ly UM1686 BlueNRG 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 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
33. ard 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 3 JTAG connector A JTAG connector on the board H in Figure 3 allows the programming and debugging of the STM32L microcontroller on board using an in circuit debugger and programmer such as the ST LINK V2 LEDs Five LEDs are available in Figure 3 001 green 012 orange DL3 red DL4 blue DL5 yellow 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 3 Table 1 shows which pins of the microcontroller are connected to the daughterboard Some of the lines are connected also to a row of test points M a The 5 321 is preprogrammed with 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 DK SW package firmware folder DoclD025464 Rev 5 11 70 Hardware description UM1686 2 2 12 70 BlueNRG daughterboard The BlueNRG daughterboard Figure 4 included in the development kit is a small circuit board to be connected to the main board It contains the BlueNRG network processor in a QFN32 package a
34. atform STEVAL IDBOO2V1 BlueNRG 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 GUI The correct pre compiled firmware can be found inside firmware folder 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 DoclD025464 Rev 5 4 1686 BlueNRG sensor profile demo Figure 21 BlueNRG app Locked SIM 12 12 1 Back Accel Temp RSSI Back TER Temp RSSI 91 Naw EEE Ly Y CD Ly Z O m Scan Scan Scan 5 3 BlueNRG sensor profile demo connection with central device This section describes how to interact with a central device while BlueNRG is acting as a peripheral The central device can be another BlueNRG acting as a master or any other Bluetooth smart or smart ready device First BlueNRG must be set up In order to do this a series of ACI command need to be sent to th
35. be one of the following values Table 11 WAIT EVENT event codes with related event parameter types event code HCI LE META EVENT Event parameter type Event parameter type value HCI LE CONNECTION COMPLETE EVENT HCI LE ADVERTISING REPORT EVENT Subevent Code LE CONNECTION UPDATE COMPLETE EVENT LE READ REMOTE USED FEATURES COMPLETE EVENT HCI LE LONG TERM KEY REQUEST EVENT 3 025464 5 31 70 GUI software description UM1686 Table 11 WAIT EVENT event codes with related event parameter types continued event code HCI VENDOR EVENT Event parameter type Ecode Event parameter type value ACI BLUE INITIALIZED EVENT ACI GAP LIMITED DISCOVERABLE EVENT ACI GAP PAIRING COMPLETE EVENT GAP PASS KEY REQ EVENT ACI GAP AUTHORIZATION REQ EVENT GAP SLAVE SECURITY INITIATED EVENT GAP BOND LOST EVENT ACI GAP DEVICE FOUND EVENT GAP PROC COMPLETE EVENT ACI L2CAP CONNECTION UPDATE RESP EVENT ACI L2CAP PROC TIMEOUT EVENT ACI L2CAP CONNECTION UPDATE REQ EVENT ACI GATT ATTRIBUTE MODIFIED EVENT GATT PROC TIMEOUT EVENT EXCHANGE MTU RESP EVENT FIND INFO RESP EVENT ACI ATT FIND BY TYPE VALUE RESP EVENT ACI ATT READ BY TYPE RESP EVENT ACI ATT READ RESP EVENT ACI ATT READ BLOB RESP
36. e 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 BTLE controller as well as other events The left table sent received packets holds a history of all packets see Figure 9 The right one packet details shows all the details of the selected packet as is done in the command packet table Figure 9 Figure 9 Packet history and details Sent Received Packets Packet Details N Time Type Parameter Value Literal 0 16 55 49 818 GATT INIT COMMAND COMPLETE EVENT 11 16 55 49 828 COMMAND COMPLETE EVENT 2 16 55 55 058 GAP INIT 16 55 55 068 2 2 229 GAP INIT Success Double clicking on row the sent received packets table shows the raw packet Figure 10 Raw packet dump Gi Raw Packet 0 01 0 00 0 20 0 19 0 00 0 40 0 00 0 40 0 00 0 00 0 00 0 00 0 00 0 00 0 00 0 00 0 00 0 06 0 00 0 80 0 0 0 00 0 00 0 80 0 0 00 0 00 0 1 Some events displayed in yellow cells can provide other information packets sent towards the BTLE controller are displayed in gray cells while received packets are shown inside wh
37. e 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 sensor demo central profile role This application implements a basic version of the BlueNRG Sensor Profile Central role which emulates the BlueNRG Sensor Demo applications available for smartphones iOS and Android It configures a BlueNRG device as a BlueNRG 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 development platform configured as a BlueNRG Sensor device Peripheral role This application uses a new set of APIs that allow the performance of the following operations on a BlueNRG Master Central device Master Configuration Functions Master Device Discovery Functions Master Device Connection Functions Master Discovery Services amp Characteristics 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 CentralNibrary The master library APIs are documented in doxygen format within the SW package The BlueNRG Sensor Demo Central role is supported
38. e processor 5 3 1 Initialization BlueNRG 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 amp service handle amp dev name char handle amp appearance char handle Where Role PERIPHERAL ROLE See ACI documentation for more information on these commands and on those that follow as well Peripheral role must be specified inside the GAP INIT command 5 3 2 Add service and characteristics BlueNRG 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 0 001 0x01 0x06 amp Service Handle Where Service UUID 0 01 Service UUID 1620xA001 Service 0 01 Max Attributes 0 06 Ly DoclD025464 Rev 5 45 70 BlueNRG sensor profile demo UM1686 5 3 3 5 3 4 5 3 5 46 70 The command will return the service handle on variable Service Handle e g 0x0010 A characteristic must now be added to this service This service is identified by the service handle add char Service Handle 0x01 002 10 0x1A 0x00 0x01 0x07 0x01 Handle Where Cha
39. e used as a simple interface between the BlueNRG and a GUI application on the PC The on board STM32L microcontroller can also be programmed so the board can be used to develop applications that use the BlueNRG 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 e BlueNRG network coprocessor e 51 321151 06 48 pin microcontroller e USB connector for power supply and I O e One row of pins with SWD interface antenna e Two user buttons SW1 SW2 e Two LEDs 02 D3 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 EEPROM RTC timers USART 12 SPI ADC 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 each microcontroller pin DoclD025464 Rev 5 Ly UM1686 Hardware description Table 4 MCU pin description versus board function Board function Pin name Pn num LEDs Bl
40. ection creation as a 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 DoclD025464 Rev 5 Ly UM1686 BlueNRG chat demo application Figure 22 BLE chat client example Figure 23 BLE chat server example 8 COM76 115200baud Tera Term VT I EG Eile Edit Setup Control Window Help f 7 88 COM78 115200baud Tera Term VT 2 File Edit Setup Control Window Help 4 025464 5 53 70 BlueNRG Beacon demonstration application UM1686 7 7 1 7 2 7 2 1 7 2 2 Note 54 70 BlueNRG Beacon demonstration application The software development kit contains another example which shows how to configure a BlueNRG device to advertise specific manufacturing data and allow another BLE device to know if it is in the range of the BlueNRG beacon device Supported platforms The BlueNRG Beacon demo is supported by the BlueNRG development platform STEVAL IDBO02V1 and the BlueNRG USB dongle STEVAL IDBOOS3V 1 BLE Beacon application setup This section describes how to configure a BlueNRG device for acting as a beacon device Initialization The BlueNRG stack must be correctly initialized as follows aci gatt init aci gap init GAP PERIPHERAL ROLE amp service handle amp dev name char handle amp appearance ch
41. emo 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 development platform STEVAL IDBOO2V1 Power up the board Press and hold USER button Reset the board using RESET button keep USER button pressed while resetting The orange LED DL2 will start to blink Release USER button A Use BlueNRG GUI to Flash the device with new firmware Tools gt Flash motherboard FW 2 BlueNRG USB Dongle order code STEVAL IDBO03V1 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 Flash Motherboard FW The BlueNRG graphical user interface This section describes the main functions of BlueNRG GUI application You can run this utility by clicking on the BlueNRG GUI icon on the Desktop or under Start gt STMicroelectronics BlueNRG DK X X X BlueNRG GUI DoclD025464 Rev 5 19 70 GUI software description UM1686 3 2 1 20 70 GUI main window Figure
42. es 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 chat demo server amp client roles is supported on the BlueNRG development platform STEVAL IDBOO2V1 and on the BlueNRG USB dongle STEVAL IDBOOSV 1 BlueNRG 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 First BlueNRG must be set up on both devices In order to do this a series of ACI commands need to be sent to the processor DoclD025464 Rev 5 Ly UM1686 BlueNRG chat demo application 6 2 1 6 2 2 6 2 3 Ini
43. evice 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 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 DoclD025464 Rev 5 Ly UM1686 Bl
44. following command on BLE Chat Server role device aci gatt add char chatServHandle UUID TYPE 128 charUuidRX 20 CHAR PROP PROP WRITE WITHOUT RESP ATTR PERMISSION NONE GATT SERVER 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 Set security requirements BlueNRG exposes a command that the application can use to specify its security requirements If a characteristic has security restrictions a pairing procedure must be initiated by the central in order to access that characteristic On BLE chat demo a fixed pin 123456 is used as follows DoclD025464 Rev 5 51 70 BlueNRG chat demo application UM1686 6 2 4 6 2 5 52 70 aci gap set auth requirement MITM PROTECTION REQUIRED OOB AUTH DATA AB SENT NULL 7 16 USE FIXED PIN FOR PAIRING 123456 BONDING Enter connectable mode On BLE chat server role device uses GAP ACI commands to enter into general discoverable mode aci 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 Bluetooth core specification version 4 0 Vol 3 Pa
45. ftware description Stop PER test 1 Inthe BlueNRG GUI related to TX BlueNRG device Qoto the RF Test window TRANSMITTER section Click on Stop Transmitter button The number of transmitted packets is displayed in the Packet Transmitted field 2 Inthe BlueNRG GUI related to Rx BlueNRG device Go to the RF Test window RECEIVER section Click on the Stop Receiver button The number of received packets is displayed in the Packet Received field Get PER Packet Error Rate value 1 Inthe BlueNRG GUI related to BlueNRG device Qoto the RF Test window RECEIVER section Inthe PER section insert the number of transmitted packet from TX device into the Packet Transmitted field read this value from TRANSMITTER section in the BlueNRG GUI related to TX device The PER packet error rate value is shown in the Packet Error Rate field Figure 17 GUI RF Test PER test TX device 4 57 BlueNRG GUI 1 90 7 _ a 12 File Tools Settings Help I BlueNRG HW v3 0 Port 85 ST DK HW Reset BlueNRG FW v6 4 FW v1 8 ACI Commands ACI Utilities Scripts Beacon RF Test Test TRANSMITTER RECEIVER V HighPower 7 48dBm RX Frequency 2402 Channel 0 TX Frequency 242 MHz Channel 0 7 __ Start Receiver Length of Data 0 25 C PER Packet Paylo
46. haracteristic is defined the user can edit its parameters and or delete it Once a service and its characteristics have been defined click OK to add them 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 DoclD025464 Rev 5 4 UM1686 GUI software description Table 7 GUI ACI utilities window available central operations Operation Scanning Associated actions 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 Notes Connection Allows to connect to a peer device by Searching for devices in Advertising Select the device to which to connect Select the connection parameters Peer address and type Scan Interval and Window Connection Interval min amp max Latency Supe
47. he daughterboard Get version The Get version tool is used to retrieve the version of the BlueNRG GUI firmware VCOM on the STM23L and hardware and firmware version from the BlueNRG 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 FW 6 4 for BlueNRG device 2 Go to Settings gt select Set Baud Rate and choose the value default is 115200 b Two precautions must be taken for any firmware 1 change memory regions in linker script vector table and Flash must start at 0 08003000 2 Change the vector table offset NVIC_SetVectorTable 24 70 0025464 Rev 5 Ly UM1686 GUI software description 3 2 3 GUI ACI utilities window The BlueNRG GUI ACI utilities window provides several tabs to allow testing of some BlueNRG application scenarios Figure 12 BlueNRG GUI ACI utilities window 9 11 13 09 17 00 920 COMMAND COMPLETE EVENT 09 17 00 920 COMMAND COMPLETE EVENT 09 17 00 930 COMMAND COMPLETE EVENT m Le File Tools Settings Help m BlueNRG HW v3 0 Port COMBS ST DK
48. ite 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 DoclD025464 Rev 5 21 70 GUI software description UM1686 3 2 2 22 70 1 History it saves the current list of sent commands and received events on a CSV file 2 Load History it loads a list of sent commands and received events previously stored on a CSV file 3 Save as Python Script it allows to store the current list of sent commands 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 GUI Beacon window Tools The BlueNRG GUI has some functions that can be accessed through the tools menu These tools are described in this section BlueNRG updater This tool can be used to update the firmware inside the BlueNRG by using its internal bootloader VCOM firmware must be present on the STM32L and COM port must be open in order to use this function 1 Goto Tools gt BlueNGR u
49. ket Details Parameter Value Literal Info 09 19 25 668 COMMAND COMPLETE EVENT 40 70 DoclD025464 Rev 5 Ly UM1686 Programming with BlueNRG network processor 4 4 1 4 2 Programming with BlueNRG network processor The BlueNRG 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 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 SPI interface The development kit software includes sample code that shows how to configure BlueNRG and send commands or parsing events The source library is called simple BlueNRG 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 BlueNRG Documentation on the ACI is provided in a separate document Figure 19 Profile framework structure Proximity FindMe HOGP Basic profile framework Requirements In order to communicate with BlueNRG network processor very few resources are needed by the main processor These are li
50. ll void any warranty granted by ST for 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 4 70 70 DoclD025464 Rev 5
51. n LE META EVENT evt WAIT EVENT HCI LE META EVENT Using evt get param Subevent it s possible to identify the specific HCI LE META EVENT parameter type value evtCode evt get param Subevent Code val Check if received event is LE CONNECTION COMPLETE EVENT if evtCode 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 Ly DoclD025464 Rev 5 33 70 GUI software description UM1686 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 event parameter type value evtCode evt get param Ecode val if evtCode NOTIFICATION EVENT conn handle evt get param Connection Handle val Example 4 Wait the Ecode GATT PROC COMPLETE EVENT VENDOR 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 ACI GATT PHOC COMPLETE EVENT event occurs 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
52. n SMA antenna connector discrete passive components for RF matching and balun and small number of additional components required by the BlueNRG for proper operation see the schematic diagram in Figure 24 Figure 4 BlueNRG daughterboard The main features of the BlueNRG daughterboard are BlueNRG 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 Balun matching network 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 to disable the DC DC converter In this case the following changes must be performed on the daughterboard see Figure 24 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 4 The following tables show the connections between the daughterboard and the main board DoclD025464 Rev 5 Ly 1686 Hardware description Table 2 Connections between BlueNRG board and motherboard on left connector Pin J4 motherboard J3 daughterboard 1 DB NC 2 3V3 3 DB_PIN3 NC 4 NC NC 5 GND GND 6 DB_PIN2 ns 7 GND GND 8 3V3
53. n the test point row 2 1 2 Power The board can be powered either by the mini USB connector CN1 A in Figure 3 or by 2 AAA batteries To power the board through USB bus jumper JP1 must be in position 1 2 as in Figure 3 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 on 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 10 70 DoclD025464 Rev 5 Ly UM1686 Hardware description 2 1 3 Sensors Two sensors are available on the motherboard LISSDH an ultra low power high performance three axis linear accelerometer D in Figure 3 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 12 interface E in Figure 3 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 3 16 pins of the microcontroller are connected to this expansion slot Table 1 Push buttons and joystick For user interaction the bo
54. ng the following folder structure Drivers It contains all the STM32L1xx Cube library framework files Middlewares ST STM32_BlueNRG SimpleBlueNRG_HCI Contains the code that is used to send ACI commands to the BlueNRG network processor It contains also definitions of BlueNRG events platform Contains all the platform dependent files only 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 will use the Bluetooth technology with the BlueNRG Project files for embedded workbench are also available DoclD025464 Rev 5 Ly UM1686 BlueNRG sensor profile demo 5 BlueNRG 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 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 Figure 20 shows the whole GATT database including the GATT and GAP services that are automatically added by the stack One of the acceleration service s charac
55. nsor 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 DoclD025464 Rev 5 49 70 BlueNRG chat demo application UM1686 6 6 1 6 2 50 70 BlueNRG chat demo application The software development kit contains another example which implements a simple 2 way communication between two BlueNRG devices It shows a simple point to point wireless communication using the BlueNRG 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 has data to be sent it will send notifications which will contain the value of the TX characteristic characteristic this is a writable characteristic When the client has data to 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 expos
56. of LED 2 e bit 2 is the status of LED e bit 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 device configured as a BLE Remote control another BLE device a BlueNRG 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 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 BLE Remote Control is supported on the BlueNRG development platform STEVAL IDB002V1 on the BlueNRG USB dongle STEVAL IDBOO3V1 DoclD025464 Rev 5 Ly UM1686 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 device to acting as a rem
57. olPointUuid the EVT BLUE GATT ATTRIBUTE MODIFIED event is raised on the Event CB callback and the selected LED LEDs are turned on or off DoclD025464 Rev 5 Ly UM1686 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 DoclD025464 Rev 5 59 70 UM1686 Available board schematics Available board schematics 10 Figure 24 STEVAL IDB002V1 BlueNRG daughterboard 15813 15313 2090 4001 1 YSX 2090 zo 69 Sivan NGVXRV Ldavxnv davxnv 1102808 1105505 M X ZOO uoo 2090 nl 2070 700 6 2090 2070 3001 D X 2090 00 Mex 819 LIVIA 2090 001 L 509 2070 1001 VIX 900 2070 dsl EE 509 2080 dsl 29 davxnv 1002505 1917 SWAP 070 lt 55 509 22245353 EES 3565 121812 VWS 29 ere er 909 coro aar zoro 65 20 5 4 2 zjedunr zn 909 2090 0 lt oro 909 zov 481 80 229 SOW 145 DUDS 2
58. oller When a COM port is opened the following information are displayed BlueNRG HW version BlueNRG FW version STM32L motherboard GUI firmware VCOM version commands The Commands tab contains a list of all the available HCI 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 8 Figure 8 Command packet table INIT Command Packet ADD SERVICE INCLUDE SERVICE GATT ADD CHAR ACI GATT ADD CHAR DESC GATT UPDATE CHAR VALUE GATT DEL CHAR GATT DEL SERVICE Parameter Value Literal Info ACLGATT DEL INCLUDE SERVICE SET EVENT MASK EXCHANGE CONFIG DoclD025464 Rev 5 Ly UM1686 GUI software description 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 in 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 field Only the yellow cells of this table can be modified by the user Th
59. on script built using the available set of BlueNRG ACI commands and the related events For a list of supported and ACI script commands and related parameters refer to the commands available in the BlueNRG GUI ACI Commands window DoclD025464 Rev 5 UM1686 GUI software description 3 Figure 13 BlueNRG GUI Scripts window r i BlueNRG GUI v1 9 0 1 aram File Tools Settings Help Port 85 ST ACI Commands Scripts Engine Load Script File Gites ACLutiities Scripts Beacon RFTest Files x86 STMicroelectronics BlueNRG DK 1 9 0 Application scripts BLE_Beacon BLE_Beacon py N Time Run Script Clear List 7 Update V Autoscroll Sent Received Packets Packet Details Parameter E USL HUI CUMIMANU CUMPLEIE EVENT 10 09 17 31 711 ACLHAL SET TX POWER LEVEL 11 09 17 31 721 COMMAND COMPLETE EVENT 12 09 17 31 732 ACI SET DISCOVERABLE 13 09 17 31 732 COMMAND COMPLETE EVENT 14 09 17 31 742 ACI GAP DELETE AD TYPE 15 09 17 31 742 COMMAND COMPLETE EVENT 16 09 17 31 742 ACI GAP UPDATE ADV DATA 09 17 31 752 COMMAND COMPLETE EVENT BlueNRG HW v3 0 BlueNRG FW v6 4 Motherboard FW v1 8 Literal Info Moreover the script engine supports other utility commands Table 9 GUI Scripts window utility commands Command name Pa
60. ote control device Initialization The BlueNRG s stack must be correctly initialized before establishing a connection with another Bluetooth LE device This is done with two commands aci gatt init aci gap init GAP PERIPHERAL ROLE 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 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 development platform STEVAL IDB002V1 the temperature sensor value is set within the adv data variable On the BlueNRG USB dongle STEVAL IDBOOS3V1 a random value is set within the adv data variable no temperature sensor is available on this platform Add service and characteristics The BLE Remote Control service is added using the following command aci gatt add serv UUID TYPE 128 service uuid PRIMARY SERVICE 7 amp RCServHandle Where service uuid is the private se
61. pdater 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 internal Flash BlueNRG IFR To preserve BlueNRG 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 IFR tool can read and modify this portion of BlueNRG s Flash This tool is available in BlueNRG GUI Tools BlueNRG IFR item The BlueNRG 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 GUI according to the specified values e C view displays the C language structure related to the IFR configuration data region matching the View Edit and Memory view DoclD025464 Rev 5 Ly UM1686 GUI software description Figure 11 BlueNRG GUI IFR tool View Edit view BlueNRG IFR 3 View Edit Memory View C View Crystal selection Power Management H
62. r UUID 0 01 Char UUID 16 0 002 Char Value 10 Char_Properties 0x1A Security_Permissions 0x00 GATT 0 01 Enc Key Size 0x07 Is_Variable 0x01 With this command a variable length characteristic has been added with read write and notify properties The characteristic handle is also returned Char Handle Set security requirements BlueNRG exposes a command that the application can use to specify its security requirements If 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 Char UUID 0 01 Char UUID 1620xA002 Char Value Length 10 Char_Properties 0x1A Security_Permissions 0x00 GATT 0 01 Enc Key 0 07 Is_Variable 0x01 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 local 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 Lengthz0
63. rameters Description HW BOOTLOADER None Hardware bootloader activation HW RESET None HW reset Opens a message window and shows the input String to be 2323 displayed parameter Script is blocked until user presses OK button ERROR User message Raises an exception with a user defined debug message Allows user to enter a specific char as input Ione such as the C get_char API GET_FILE None Allows the selection of a specific file as input GET_NAME Nene Returns the device name within an advertising packet Converts the array of bytes to an integer value Example GET_VALUE Array of bytes X 0x33 0x22 GET_VALUE X 0x2233 025464 Rev 5 29 70 GUI software description UM1686 30 70 Table 9 GUI Scripts window utility commands continued Command name GET LIST Parameters Integer Number of bytes Description Converts the integer value to an array of bytes Example X 0x2233 GET LIST X 2 0x33 0x22 Returns 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 Non Allows to enter a pass key value used for the security pass key method Print utility displays information on GUI PRINT String Sent Received Packets RESET None SW reset SLEEP time It sleeps for time in milliseconds SET MODE Mode Set s
64. rd disk space available e Adobe Acrobat Reader 6 0 or later 1 4 BlueNRG 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 version is required for building the BlueNRG_DK_x x x demonstration applications 6 70 DoclD025464 Rev 5 Ly UM1686 Hardware description 2 2 1 Hardware description The following sections describe the components of the kits STEVAL IDB002V1 motherboard The motherboard included in the development kit allows testing of the functionality of the BlueNRG processor The board can be used as a simple interface between the BlueNRG and a GUI application on the PC The STM32L microcontroller on the board can also be programmed so the board can be used to develop applications using the BlueNRG 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 e JT
65. red to have some knowledge of the Python language Python 2 7 6 and a good understanding of the BlueNRG ACI commands and related events GUI Beacon window The BlueNRG GUI Beacon window provides some tabs allowing configuration of a BlueNRG device as a BLE Beacon device which transmits advertising packets with specific manufacturer data Figure 14 BlueNRG GUI Beacon window TT 7 BlueNRG GUI v1 9 0 _ File Tools Settings Port 0 85 STD Reset ACI Commands ACIUtiities Scripts Beacon RF Test BlueNRG HW v3 0 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 73F 5 48C4 A 12F 17D 1AD07A961 0000 0000 56 Set Beacon Clear List 7 Update V Autoscroll sena Sent Received Packets Packet Details N Time LUMPLEIE EVENT 10 0917 56763 ACLGAP INIT 11 0917 56 773 COMMAND COMPLETE EVENT 42 09 17 56 773 GAP SET DISCOVERABLE 13 09 17 56 782 COMMAND COMPLETE EVENT 114 091756782 ACIGAP DELETE AD 15 0917 56 782 COMMAND COMPLETE EVENT 116 09175692 ACLGAP UPDATE DATA 09 17 56 792 COMMAND COMPLETE EVENT Value Literal Info
66. rt 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 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 HANDLE 1 len tHalUint8 jemd j Where connection handle is the handle returned on conn
67. rvice 128 bit UUID allocated for the BLE remote service edOef62e 9b0d 1164 89d3 123b93f75cba The command returns the service handle in RCServHandle The BLE Remote Control characteristic is added using the following command sif ENABLE SECURITY DoclD025464 Rev 5 57 70 BLE remote control demo application UM1686 8 2 4 58 70 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 WhRITE ATTR PERMISSION AUTHEN READI ATTR PERMISSION AUTHEN WRITE NOTIFY ATTRIBUTE WRITE 16 1 amp controlPointHandle else ret aci gatt add char RCServHandle UUID TYPE 128 controlPointUuid 1 CHAR PROP READ CHAR PROP 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 edOefb1a 9b0d 1164 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 device or any SMART READY device the controlPointUuid characteristic is used to control the BLE Remote Control platform LED Each time write operation is done on contr
68. rvision timeout Connection event length min amp max The addresses of the detected advertising devices are displayed Update Connections Allows to update the connection parameters of available connections by Selecting the specific connection to be updated Set the new connection parameters Connection interval min amp max Latency Supervision timeout Connection event length min amp max DoclD025464 Rev 5 27 70 GUI software description UM1686 3 2 4 28 70 Table 8 GUI ACI utilities window available peripheral operations Operation Advertising Associated actions 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 Local name and type complete or short 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 Notes Update Advertising Data It allows to update the advertising data It allows to set the scan response data It allows to update the location UUID major and minor number defined on the Beacon window GUI Scripts window The GUI Scripts window allows the user to load and run a Pyth
69. sted below SPlinterface 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 On the STM32L Cortex M3 the memory footprint for the code interfacing the BlueNRG requires few kilobytes of Flash and RAM typically 2 4 KB of Flash and 0 8 1 5 KB of RAM So a complete simple application like the BlueNRG sensor demo could require just 15 KB of Flash and 2 KB of RAM If using the complete BlueNRG profile framework the memory footprint is around 9 KB of code and 3 KB of data for just the ACI interface and the profile framework functions The memory required for the profiles can vary depending on the complexity of the profile itself For example code for HID over GATT host is around 6 KB while for heart rate monitor is around 2 3 KB Software directory structure The Projects folder contains some sample code that can be used on the application processor to control the BlueNRG Platform dependent code is also provided for STM32L1 platforms The example project provided in the package will run is on the development kit DoclD025464 Rev 5 41 70 Programming with BlueNRG network processor UM1686 42 70 The files are organized usi
70. tack mode 1 2 3 SET PUBLIC ADDRESS Public address Set public address optional SENSORDEMO GET TE Allows to obtain the temperature value from the MPERATURE None ACI ATT READ RESP EVENT event only for the SensorDemo Central script Allows to obtain the acceleration values x y z ene from the NOTIFICATION EVENT event only for the SensorDemo Central script TIME Returns the time as a floating point number expressed in seconds since the epoch in UTC The following pseudo code describes how to initialize a BlueNRG device as a peripheral using a simple Python script Reset BlueNRG HW RESET Init GATT ACI GATT INIT Init GAP as central device ACI 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 timeout None continueOnEvtMiss False param checks command DoclD025464 Rev 5 4 UM1686 GUI software description Table 10 WAIT EVENT macro command Command Description Parameters Return name Waits for an event with event_code None default An event with its parameters E ae 22 to None if a timeout occurs and the timeout None default input parameter continueOnEvtMiss event_code If no tto Tr event code is indicated WAIT EVENT macro command contin
71. teps 1 Connect a BlueNRG platform to a PC USB port 2 Launchan instance of the BlueNRG GUI 3 Openrelated COM port 4 Goto RF Test window and in the TRANSMITTER section Setthe BLE channel using the TX Frequency combo box Set TX power in the related combo box Click on the Start Tone button To stop a tone on a specific RF BLE channel perform these steps 1 Goto RF Test window and in the TRANSMITTER section Click on the Stop Tone button the Stop button is available only when a tone is started DoclD025464 Rev 5 Ly UM1686 GUI software description Figure 15 GUI RF test Start a tone 27 BlueNRG GUI v1 9 0 rnm File Tools Settings Help BlueNRG HW v3 0 Port 85 ST Di Hw Reset BlueNRG FW v6 4 Ess Motherboard FW v1 8 Commands act Ubites Beacon RF Test Test TRANSMITTER RECEIVER PER mum Stop Tone _ 7 Update V Autoscroll sentReceived Packets Packet Details Parameter Value Literal Info 15 START 1 091820614 RESET Parameter Total Length 0 01 2 091820624 COMMAND COMPLETE EVENT Chann 000 BLE u 3 091820634 ACI BLUE INITIALIZED EVENT 4 09 18 20 723 ACI HAL_SET_TX_POWER_LEVEL 5 091820733 COMMAND COMPLETE EVENT 6 7 Direct Test Mode DTM tests The BlueNRG GU
72. teristics 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 expansion board with LPS25H pressure sensor and HTS221 humidity sensor can be connected to the motherboard through the expansion connector F in Figure 3 If the expansion board is not detected only temperature from STLM75 will be used DoclD025464 Rev 5 43 70
73. tialization BlueNRG s stack must be correctly initialized before establishing a connection with another Bluetooth LE device This is done with two commands e BLE Chat Server role aci gap init GAP PERIPHERAL ROLE amp service handle amp dev name char handle amp appearance char handle e BLE Chat Client role aci gap init GAP CENTRAL ROLE amp service handle amp dev name char handle amp appearance char handle Peripheral 8 central BLE roles must be specified inside the GAP INIT command See ACI documentation for more information on these commands and on those that follow 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 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
74. tions 49 5 4 6 Read the sensor peripheral temperature sensor characteristic 49 6 BlueNRG chat demo application 50 6 1 Supported platforms uod dca wie wok eek CR ob Fe c Ace 50 6 2 BlueNRG chat demo application peripheral amp central devices 50 6 2 1 Initialization RR RR lt lt ER Re 51 6 2 2 Add service and characteristics 51 6 2 3 Set security requirements 51 6 2 4 Enter connectable mode 52 6 2 5 Connection with central device 52 7 BlueNRG Beacon demonstration application 54 7 1 Supported platforms C CAE RU 54 Ky DoclD025464 Rev 5 3 70 Contents UM1686 7 2 BLE Beacon application setup 54 7 2 1 Initializatloni me xe on Rd Y dee ROG Babe VN d 54 7 2 2 Define advertising data 54 7 2 3 Entering non connectable mode 55 8 BLE remote control demo application 56 8 1 Supported platforms 5 ERR Epp SEE 56 8 2 BLE remote control application 27 8 2 1 initialization 57 8 2 2 Define advertising data 57
75. ueNRG Buttons USB 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 5 15 16 7 17 18 Led 02 19 Led 03 2 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 DoclD025464 Rev 5 15 70 Hardware description UM1686 2 3 2 16 70 Table 4 MCU pin description versus board function continued Board function Pin name LEDs BlueNRG Buttons USB SWD PA12 33 USB DP 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 the STM32L microcontroller on the board using an in circuit debugger and programmer like the ST LINK V2 In Figure 5the connection scheme illustrating how to connect the ST LINK V2 with the board pins is shown Figure 5 SWD connection scheme with ST LINK V2 19 171513119 7 5 3 1 OOOMO0000G 20 181614 1210 8 6 4 2 DoclD025464 Rev 5 Ly UM1686 Hardware description 2 3 3 The signals available on
76. ueNRG 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 acceleration 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 Se
77. ueOnEvtMiss False An HClTimeoutError error exception waits for any event Optional filtering parameters allow definition of additional filters on event fields default is raised when a timeout occurs param checks optional filtering parameters evt get param parameter name va l is used for getting the specific event The WAIT EVENT macro command waits for an event with Event Code parameter equal to event code 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 greater than zero is set and continueOnEvtMiss is False and no event occurs before the timeout an HClTimeoutError error occurs 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 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 anevent e None if a timeout occurs and the input parameter continueOnEvtMiss is set to True An HCITimeoutError error exception is raised when a timeout occurs The event code parameter can
78. x00 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 0 Vol 3 Part C Ch 11 Connection with central device Once BlueNRGi 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 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 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 DoclD025464 Rev 5 Ly UM1686 BlueNRG sensor profile demo 5 4 5 4 1 BlueNRG has added two standard services GATT Service 0x1801 and GAP service 0x1800 Try to read the characteristic from the 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 can send notifications of the characteristic that has been previously added with UUID 0 002 after notifications have been enabled This be done using th

Download Pdf Manuals

image

Related Search

Related Contents

Insignia 29400403A User's Manual  Model RH520  ETA License Manager User`s Manual  Chapter 7 - Reporting  El POWERHEART® AED G3 Trainer  SDI-12 USB Adapter User Manual  当社製品紹介 - 環境報告書プラザ  ft tresynol _23-03-12  TLF Feuillet bleu 1779 _ 13 février 2012[...]  Le guide des restaurants en Roman Païs  

Copyright © All rights reserved.
Failed to retrieve file