Page 2
Low-power RF ecosystem RF chipset Evaluation Kit and Development Tools RF modules Graphical UI SW development PROTOCOLS / SW IP iOS/Android SDK BLUENRG-MESH TRIPLE SDK MOTION SW VOICE SW BLE SDK libraries libraries Android SDK RF Power Simulator iOS SDK BlueNRG/Spirit NAVIGATOR GUI PC application...
Page 3
Covered in this Presentation Hardware Requirements Test Debugger connection Compilation and debug test Install SDK and tools with Keil Run BLE Chat Example Install Mobile apps Test BlueNRG-GUI Install Keil and License connectivity...
Page 4
Hardware Requirements BlueNRG-2 Target ST-Link V2 or ST Smart Phone with BLE Your windows 7/10 PC board with Nucleo Board 4.2 or higher with Setup with all required UART/VCOM required apps installed software and setups...
Page 6
BlueNRG-2 SDK • Standard SDK for BlueNRG-1 and BlueNRG-2 devices from ST • Contains basic tools like Navigator, Radio Init Wizard • Download and Install BlueNRG-2 SDK from link below(STSW-BLUENRG1-DK) https://www.st.com/content/st_com/en/products/embedded-software/evaluation-tool-software/stsw-bluenrg1-dk.html...
Page 7
• Example Projects Path • C:\Users\XXXXX\ST\BlueNRG-1_2 DK 3.X.X • Contains the example projects for BLE, prop radio and peripheral examples • Utility launch directory • C:\ProgramData\Microsoft\Windows\Start Menu\Programs\ST BlueNRG-1_2 DK 3.X.X • Shortcuts to Release folder, Navigator and Radio Init Wizard...
Page 12
BlueNRG-2 Navigator • We will use BlueNRG-2 Navigator to quickly run the example • This software is installed as part of STSW-BLUENRG1-DK • You would need a STEVAL-IDB008x board to use it • Supports direct flash write of example codes on STEVAL with...
Page 13
BlueNRG-2 Navigator: Hardware Setup Micro USB Cable STEVAL-IDB008Vx PC running BlueNRG-2 Navigator...
Page 14
Run BLE_Chat using Navigator • Open BlueNRG-2 Navigator • Navigate to BLE_Chat • BLE demo and test apps • BLE_Chat • Server • If drivers installed and board connected The Eval board pic will appear • Click on Flash and Run button...
Page 15
STSW-BlueNRG1-DK (4/7) • The board will be flashed with the BLE_Chat Server configuration compiled code • After flashing, serial terminal would automatically appear. • Push the reset button and messages from board should display...
Page 16
Connect BLE_Chat with Phone • Install a generic BLE service discovery tool like B-BLE or BLE Scanner on you phone • Enable Bluetooth and location on your phone and start the application • Click on “Scan” button • The devices available should appear •...
Page 17
• You would see three services • Generic Attribute (GATT 0x1800) • Generic Access (GAP 0x1801) • Custom Service (ST Chat Service) • Click on custom service • Then enable notifications by clicking on “N” Button. It would turn green...
Page 18
Exchange data from phone to UART • Click on “W” button • A window will appear • Type in text (ASCII) any data to be send to the UART • The click on “OK” Note: If size exceeds 20 bytes, BLE scanner automatically breaks data in 20 bytes and send across multiple packets This limit can be increased to 240 bytes per...
Page 19
• The data will be sent to phone and will be visible if “N” notification button is green Note: if size exceeds 20 bytes, BlueNRG-2 will automatically break the data in packets in 20 bytes and send to phone On the phone, only last packet will display as...
Page 21
Install Keil • Kindly refer below link for all details on ST version of Keil • https://www2.keil.com/stmicroelectronics-stm32/mdk • Download Keil MDK-ARM v5 from https://www.keil.com/demo/eval/arm.htm • Run the downloaded MDK5xx.exe installer. • Install to any path you like. If you have existing MDK-ARM installations that you want to keep,...
Page 22
Install Keil Device Function Packs 1. Open Keil window, Click on the Pack Installer button and open it 2. Select device and Click Install to download and install the Device Function packs for BlueNRG-1 and BlueNRG-2...
Page 23
Get Keil ST License • Follow instructions on the page link below to install the license after you install Keil • https://www2.keil.com/stmicroelectronics-stm32/mdk • Login with an account that has administration rights. • Right-click the µVision icon and select Run as Administrator... from the context menu.
Page 24
Activate Keil ST License • To activate the Software Product • enter the LIC in the field New License ID Code (LIC) of the dialog License Management (2) • click Add LIC (3) • Verify the license as visible in screenshot...
Page 25
Settings in Keil • After DFP and License are installed, open BLE Chat example project in Keil \\STSW-BLUETILE-DK 1.3.0\Project\BLE_Examples\BLE_Chat\MDK-ARM\BlueNRG-2 • Select ST-Link as debugger Select ST-Link as debugger (1) • Settings for ST-Link • Click on settings (2) • Check both the download options (3)
Page 27
• PM0257 BLE stack v2.x programming guidelines PDF • UM2406 The BlueNRG-X Flasher SW package PDF • DT0120 How to program and debug BlueNRG-1 and BlueNRG-2 devices PDF • UM2058 BlueNRG GUI SW package PDF • UM2109 BlueNRG-1 ST-LINK Utility software description PDF...
Page 29
Erase the BlueNRG-2 • Pull DIO7 High on BlueNRG-2 Target (Automatic in STEVAL) • Connect the target to PC using VCOM/UART • Open BlueNRG-X Flasher • Select the relevant com port (ST DK) • Press Ctrl + E and execute mass erase •...
Page 30
• Refer the picture for connector alignment • Now, power up the target and then connect ST-Link V2 • If red led is blinking: your STEVAL is in DFU mode, remove ST-LINK and then connect power. Afterwards connect ST-LINK SWCLK...
Page 31
• Try clicking on the Refresh button • Then, try re-plugging setup again with ST-Link only • If persists, update the driver of ST-LINK and firmware of ST-LINK V2 • Please check you are using BlueNRG-1 ST-Link utility and Not STM32 ST-LINK utility...
Page 32
Verify SWD Target • If your setup is fine, you should see similar in Target Information • If BlueNRG-2 is not visible, then you should match the settings as per snapshot • Once you see the Target voltage and Target, you should click on “OK”...
Page 33
Test Compile and debug run of BLE_Chat project on Keil...
Page 34
Compile BLE_Chat Project • Open BLE_Chat project in Keil Path: C:\Users\{USER NAME}\ST\BlueNRG-1_2 DK 3.2.1\Project\BLE_Examples\BLE_Chat\MDK-ARM\BlueNRG-2 The project file name is “BLE_Chat” with extension “.uvprojx” • Select the “Server” from drop down • Go to “Project” menu dropdown and click “Build Target”...
Page 35
Establish Debug Session • After build, go further only if you have tested the debugger connection • Ensure that the BlueNRG-1 ST-Link utility is not connected to target • Press F8 to program the device • Press Ctrl+F5 to start the debug session •...
Page 36
Verify Successful Debug Session Start • You will see a screen like one here if all works well • Now click on F5 to run the code • You can connect via phone following procedure explained with Navigator Usage...
Page 37
Help: In case of Build Error If you face issues with Building the Project then • Goto “File” → “License Management” • The installed license should be visible as • If you don’t see above license, then refer License Installation section •...
Page 38
Help: Verify Preprocessor Settings • There are different hardware available for BlueNRG-2 with combinations of • SMPS On/SMPS Off • External LF crystal/Internal RO • After opening project in Keil Go to Project → Options for Target → C/C++ (tab) •...
Page 39
• The DFP is installed • You have configured debugger settings in Keil as per instructions • Try reading the device vis BlueNRG-1 ST-LINK utility. If you see all FF starting at address 0x10040000 then you have either • You have not flashed the right code or used an OTA configuration...
Page 41
Install Mobile apps • Install ST BLE sensor mobile app (available for android and iOS) • Install BLE Scanner app (available for android and iOS)
Page 43
• Check switches SW2 and SW3 on bluetile host board are on USB connector side • Open BlueNRG-X Flasher • Select the relevant com port (ST DK) • Press Ctrl + E and execute mass erase • You should see the green light on the BlueTile LED...
Page 44
Flash DTM Code • Click on “Select Image file” button and navigate to \\STSW-BLUETILE-DK 1.3.0\Firmware\BLE_Examples\DTM • Select file DTM_UART.hex and click on “Open” • Switch to “Image File” tab • Verify that the file starts from address 0x10040000 • Now click on the “Flash” button upper section of Flasher •...
Page 45
Connect GUI and Verify Versions • Close Flasher and Start BlueNRG-GUI • Go to “Settings”→ “Set Baud Rate” and select “115200”. Then click “OK” • Select the relevant com port and click on open port button and see if the device and firmware versions are visible •...
Page 47
PCB design guidelines for the BlueNRG-1 device BlueNRG-1 AN4820 BlueNRG-1 and BlueNRG-2 low power modes BlueNRG-1, BlueNRG-2 AN4869 BlueNRG-1, BlueNRG-2 BLE OTA (over-the-air) firmware upgrade BlueNRG-1, BlueNRG-2 AN4872 BlueNRG-1 and BlueNRG-2 UART bootloader protocol BlueNRG-1, BlueNRG-2 AN5187 The BlueNRG-1, BlueNRG-2 improving robustness...
Page 48
How to mount the new balun BALF-NRG-02D3 without the top side marking BlueNRG-1, BlueNRG-2 DT0107 Slot allocation and multiple connection timing strategy for BlueNRG, BlueNRG-MS, BlueNRG-1 and BlueNRG-2 BlueNRG-MS, BlueNRG-1, BlueNRG-2 DT0108 How to program and debug BlueNRG-1 and BlueNRG-2 devices...
Page 49
BlueNRG-1, BlueNRG-2 DK SW package BlueNRG-1, BlueNRG-2 STSW-BNRG001 BlueNRG current consumption estimation tool BlueNRG-MS, BlueNRG-1, BlueNRG-2 STSW-BNRG1STLINK BlueNRG-1 ST-LINK utility for BlueNRG-1, BlueNRG-2 MCU BlueNRG-1, BlueNRG-2 STSW-BNRGUI BLUENRG family GUI BlueNRG-MS, BlueNRG-1, BlueNRG-2 STSW-BNRG_V1-DK BlueNRG-1 DK SW package for BLE stack family v1.x...
Page 50
STSW-BNRGFLASHER • BlueNRG-1,2 Flasher utility • Supports programming via SWD and UART interface • Supports flash to be read, mass erased, written and programmed • Can connect to multiple hardware simultaneously • Autobaud and forced baud rate supported • Supports .bin and .hex formats...
Page 51
BlueNRG-1, 2 flasher for production programming • BlueNRG-1,2 Flasher Launcher Utility can be launched through PC command window for integration under test environment • Supports programming of multiple targets at a time (up to 10) • Allows a MAC address to be stored on a specific Flash location selected by the user •...
Page 52
BlueNRG-1 Radio Init Wizard • This tool allows to setup the BlueNRG- 1/BlueNRG-2 initialization parameters and generate a configuration header file. • Part of STSW-BLUENRG1-DK • Allows to configure various parameters • Stack • Security • Services • Radio • OTA...
Page 53
BlueNRG-1 Radio Init Wizard • You can configure below parameters using the wizard • BLE Device Name and Stack version • Radio Packet configuration • Add service declaration for stack with number of services, respective characteristics and configure their properties •...
Page 54
BlueNRG Power Consumption Tool • Quick and accurate estimate of average current consumption and battery lifetime • Eddystone URL beacon as example, Adv Int 1000 ms (within Google recommended value), 31-byte Adv packet payload, 3 Adv channels http://www.st.com/content/st_com/en/products/embedded-software/wireless-connectivity-software/stsw-bnrg001.html...
Page 55
ST BLE Sensor App supporting FOTA1/2 Flash the OTA Service Manager Install the right version of the ST BLE Sensor Push CONNECT TO A on the STEVAL-IDB008 The BlueNRG App should be already installed DEVICE and then otherwise install it on your smartpone.
Page 56
ST BLE Sensor App supporting FOTA 2/2 Now the Yellow LED on the Select the file directly from the Cloud (Google Drive) or The file will be flashed OTA and you can see STEVAL-IDB008 is active and finally you can play with the...
Need help?
Do you have a question about the BlueNRG-2 and is the answer not in the manual?
Questions and answers