Update procedure and configuration in DTM firmware for X-NUCLEO-BNRG2A1 - Application note Update procedure and configuration in DTM firmware for X-NUCLEO-BNRG2A1

Update procedure for the DTM firmware in X-NUCLEO-BNRG2A1 Bluetooth Low Energy (BLE) evaluation and development board system and different hardware settings to be configured to port DTM firmware of BlueNRG-2 SDK for X-NUCLEO-BNRG2A1 for any custom applications.

STMICROELECTRONICS

Update procedure and configuration in DTM firmware for X-NUCLEO-BNRG2A1 - Application note


File Info : application/pdf, 15 Pages, 4.83MB

PDF preview unavailable. Download the PDF instead.

an5651-update-procedure-and-configuration-in-dtm-firmware-for-xnucleobnrg2a1-stmicroelectronics
AN5651
Application note
Update procedure and configuration in DTM firmware for X-NUCLEO-BNRG2A1

Introduction
This document describes how to update the DTM firmware in the X-NUCLEO-BNRG2A1 expansion board and different hardware settings to be configured to port the BlueNRG-2 SDK DTM firmware for X-NUCLEO-BNRG2A1 to any custom application.
The X-NUCLEO-BNRG2A1 is a Bluetooth® Low Energy (BLE) evaluation and development board system designed around BlueNRG-M2SP Bluetooth® Low Energy module based on the BlueNRG-2 processor.
The processor communicates with the STM32 microcontroller, hosted on the STM32 Nucleo development board, through the SPI link available on the Arduino UNO R3 connectors.
Figure 1. X-NUCLEO-BNRG2A1 expansion board components
1. Arduino UNO R3 connectors 2. Arduino UNO R3 connectors 3. M95640-RMC6TG 4. BlueNRG-M2SP

1

2

3

4

AN5651 - Rev 1 - March 2021 For further information contact your local STMicroelectronics sales office.

www.st.com

AN5651
System requirements

1

System requirements

1.1

Hardware requirements

The table below lists the boards to be used to upgrade the DTM firmware on the BlueNRG-M2SP.

Boards X-NUCLEO-BNRG2A1 NUCLEO-L476RG

Table 1. Hardware requirements Description
Evaluation platform based on the BlueNRG-M2SP module for STM32 Nucleo STM32 Nucleo-64 development board with STM32L476RG MCU

To program the X-NUCLEO-BNRG2A1, its 5-pin SWD connector (J12) has to be connected to the NUCLEOL476RG via ST-LINK and a mini-USB cable is required to connect the development board to your laptop/PC.

Figure 2. X-NUCLEO-BNRG2A1 and NUCLEO-L476RG connection via ST-LINK programming cable

Important: Connect the STM32 Nucleo development board debug connector first five pins only and leave pin 6 unconnected.

AN5651 - Rev 1

page 2/15

AN5651
PC/laptop requirements

1.2

PC/laptop requirements

The minimum requirements to set up the software environment are:

· a PC/laptop with Intel or AMD processor running one of the following Microsoft operating systems: Windows XP or Vista/Windows 7/Windows 10

· 2 USB ports

· At least 128 MB of RAM

· 40 MB of hard disk space

· BlueNRG-1ST-LINK Utility to update the firmware through SWD connector

AN5651 - Rev 1

page 3/15

AN5651
DTM firmware update procedure

2

DTM firmware update procedure

2.1

Direct update on the X-NUCLEO-BNRG2A1 expansion board

Step 1. Remove CN2 jumper from the NUCLEO-L476RG development board.

Figure 3. NUCLEO-L476RG development board CN2 pin (highlighted in purple)

Step 2. Connect the board via ST-LINK using the programming cable or wires.

AN5651 - Rev 1

page 4/15

AN5651
Direct update on the X-NUCLEO-BNRG2A1 expansion board

Step 3.

Add a jumper to X-NUCLEO-BNRG2A1 J15 to wake up the device when in sleep mode.
This jumper is connected to the BlueNRG-2 DIO7 pin and must be shorted for boot pin high. DIO7 can be used for bootloader activation.

Figure 4. X-NUCLEO-BNRG2A1 expansion board J15 pin (highlighted in light blue)

Step 4. Download the latest DTM image from the BlueNRG-M2SP web page, selecting the Documentation tab and then Utilities at the page bottom.
Figure 5. BlueNRG-1 ST-LINK Utility

AN5651 - Rev 1

page 5/15

AN5651
Update through BlueNRG GUI
Step 5. Open BlueNRG-1 ST-LINK Utility tool and connect to the target. Figure 6. BlueNRG-1 ST-LINK Utility - target connection

Step 6.

From the package downloaded at 4., select the DTM image to be uploaded onto the X-NUCLEOBNRG2A1 and click [Start].
By default, the DTM image for the BlueNRG-M2SP is:
en.BlueNRGM2SA_M2SP_DTM_Stack_v2_1c\BlueNRGM2SA_M2SP_DTM_Stack_v2.1c\BLUENRGM2SP_32MHz_RO_SMPS_off\SPI\BLUENRG-M2SP_DTM_SPI.hex as shown in the following figure (you can find it in the BlueNRG-M2 web page by selecting the Documentation tab and then Utilities at the page bottom, as detailed in step 4).

Figure 7. BlueNRG-2 DTM image

Step 7. Add the jumper back on CN2 and remove it from J15.

2.2

Update through BlueNRG GUI

Step 1. Download the X-CUBE-BLE2 package from www.st.com.

Step 2. Load the VCOM binary on the NUCLEO-L476RG (the binary path is: X-CUBEBLE2\Projects\STM32L476RG-Nucleo\Applications\Virtual_COM_Port\Binary).

Step 3. Open BlueNRG GUI

AN5651 - Rev 1

page 6/15

AN5651
Update through IFRStack_Updater application
Step 4. From [Tools]>[Settings], set baud rate to 115000 and open the COM port. Figure 8. BlueNRG GUI v4.0.0

The following message appears: Figure 9. Old DTM firmware detected

Step 5.

Ignore the pop-up and, in [Tools]>[Stack Updater] menu, select
en.BlueNRGM2SA_M2SP_DTM_Stack_v2_1c\BlueNRGM2SA_M2SP_DTM_Stack_v2.1c\BLUENRGM2SP_32MHz_RO_SMPS_off\SPI\BLUENRG-M2SP_DTM_SPI_for_updater.bin and click [Update].

2.3

Update through IFRStack_Updater application

Step 1. Download the X-CUBE-BLE2 package from www.st.com.

Step 2.

Load the YMODEM_Stack_Updater_L476RG.bin binary on the NUCLEOL476RG (the binary path is: X-CUBE-BLE2\Projects\STM32L476RGNucleo\Applications\IFRStack_Updater\Binary).

Step 3.

Launch a serial terminal (e.g., Tera Term) and open a connection setting the parameters as follows: ­ Speed: 115200 ­ Data: 8-bit ­ Parity: None ­ Stop bits: 1 ­ Flow control: none ­ New-line: Receive=AUTO ­ Transmit=CR

AN5651 - Rev 1

page 7/15

AN5651
Emulating the BlueNRG-2N device with the X-NUCLEO-BNR2A1 expansion board

Step 4.

In [File]>[Transfer]>[YMODEM]>[Send], select en.BlueNRGM2SA_M2SP_DTM_Stack_v2_1c\BlueNRGM2SA_M2SP_DTM_Stack_v2.1c\BLUENRGM2SP_32MHz_RO_SMPS_off\SPI\BLUENRG-M2SP_DTM_SPI_for_updater.bin

Figure 10. YMODEM selection in Tera Term

At the end of the file transfer, the fast-blinking LD2 LED (T = 0.5 secs) on the NUCLEO-L476RG indicates that the updating process has successfully terminated (the slowly blinking LD2 LED (T = 3 secs) indicates that the updating process has failed).

2.4

Emulating the BlueNRG-2N device with the X-NUCLEO-BNR2A1 expansion

board

The BlueNRG-2N device is an ultra-low power (ULP) network coprocessor solution for Bluetooth® low energy applications and can be emulated on the X-NUCLEO-BNRG2A1 as described hereafter.

Step 1. Download and unpack the STSW-BNRG2N-V320, which contains the BlueNRG-2N image (BlueNRG_2N_FW_V3_2_0.bin).

Figure 11. BlueNRG-2N image

Step 2. Follow steps 1 to 4 of Section 2.1 to flash the BlueNRG-2N firmware image to emulate the BlueNRG-2N device.

AN5651 - Rev 1

page 8/15

AN5651
Custom DTM image generation for applications on X-NUCLEO-BNRG2A1

3

Custom DTM image generation for applications on X-NUCLEO-

BNRG2A1

DTM firmware available in the STSW-BLUENRG1-DK (BlueNRG-1_2DK 3.2.1 \Firmware\BLE_Examples\DTM\BlueNRG-2) is a starting point for the generation of an image based on applications.
The pre-processor in the DTM SPI example has to be configured for the BlueNRG-M2SP module.

Table 2. Pre-processor symbol value for BlueNRG-M2SP mounted on X-NUCLEO-BNRG2A1

Pre-processor symbol HS_SPEED_XTAL LS_SOURCE SMPS_INDUCTOR

BlueNRG-M2SP HS_SPEED_XTAL_32MHZ LS_SOURCE_INTERNAL_RO SMPS_INDUCTOR_NONE

The above pre-processor symbols will be configured in the project workspace as shown in the following figures.

Figure 12. Pre-processor symbols in IAR workspace of DTM SPI project

AN5651 - Rev 1

page 9/15

AN5651
Custom DTM image generation for applications on X-NUCLEO-BNRG2A1
Figure 13. Pre-processor symbols in Keil workspace of DTM SPI project

BlueNRG_Sleep API can be commented to generate X-NUCLEO-BNRG2A1 image to avoid the BlueNRG-2 device to go into sleep mode when not required.
Figure 14. BlueNRG_Sleep API commented in while loop of DTM SPI project

Other configurations, such as max. value for ATT MTU, can be changed by modifying the MAX_ATT_MTU macro in DTM_config.h (by default, set to 220 in the DTM firmware available in STSW-BLUENRG1-DK).

AN5651 - Rev 1

page 10/15

Revision history
Date 22-Mar-2021

AN5651

Table 3. Document revision history

Revision 1

Initial release.

Changes

AN5651 - Rev 1

page 11/15

AN5651
Contents
Contents
1 System requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.1 Hardware requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.2 PC/laptop requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 DTM firmware update procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 2.1 Direct update on the X-NUCLEO-BNRG2A1 expansion board . . . . . . . . . . . . . . . . . . . . . . . . . 4 2.2 Update through BlueNRG GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2.3 Update through IFRStack_Updater application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.4 Emulating the BlueNRG-2N device with the X-NUCLEO-BNR2A1 expansion board . . . . . . . 8
3 Custom DTM image generation for applications on X-NUCLEO-BNRG2A1 . . . . . . . . . . 9 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12 List of tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .13 List of figures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14

AN5651 - Rev 1

page 12/15

AN5651
List of tables

List of tables

Table 1. Table 2. Table 3.

Hardware requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Pre-processor symbol value for BlueNRG-M2SP mounted on X-NUCLEO-BNRG2A1. . . . . . . . . . . . . . . . . . . . . 9 Document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

AN5651 - Rev 1

page 13/15

AN5651
List of figures

List of figures

Figure 1. Figure 2. Figure 3. Figure 4. Figure 5. Figure 6. Figure 7. Figure 8. Figure 9. Figure 10. Figure 11. Figure 12. Figure 13. Figure 14.

X-NUCLEO-BNRG2A1 expansion board components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 X-NUCLEO-BNRG2A1 and NUCLEO-L476RG connection via ST-LINK programming cable . . . . . . . . . . . . . . . 2 NUCLEO-L476RG development board CN2 pin (highlighted in purple). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 X-NUCLEO-BNRG2A1 expansion board J15 pin (highlighted in light blue) . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 BlueNRG-1 ST-LINK Utility. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 BlueNRG-1 ST-LINK Utility - target connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 BlueNRG-2 DTM image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 BlueNRG GUI v4.0.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Old DTM firmware detected . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 YMODEM selection in Tera Term . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 BlueNRG-2N image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Pre-processor symbols in IAR workspace of DTM SPI project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Pre-processor symbols in Keil workspace of DTM SPI project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 BlueNRG_Sleep API commented in while loop of DTM SPI project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

AN5651 - Rev 1

page 14/15

AN5651
IMPORTANT NOTICE ­ PLEASE READ CAREFULLY STMicroelectronics NV and its subsidiaries ("ST") reserve the right to make changes, corrections, enhancements, modifications, and improvements to ST products and/or to this document at any time without notice. Purchasers should obtain the latest relevant information on ST products before placing orders. ST products are sold pursuant to ST's terms and conditions of sale in place at the time of order acknowledgement. Purchasers are solely responsible for the choice, selection, and use of ST products and ST assumes no liability for application assistance or the design of Purchasers' products. No license, express or implied, to any intellectual property right is granted by ST herein. Resale of ST products with provisions different from the information set forth herein shall void any warranty granted by ST for such product. ST and the ST logo are trademarks of ST. For additional information about ST trademarks, please refer to www.st.com/trademarks. 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.
© 2021 STMicroelectronics ­ All rights reserved

AN5651 - Rev 1

page 15/15


C2 v4.2.0220 build 670 - c2 rendition config : Techlit Active Antenna House PDF Output Library 7.0.1600; modified using iText 2.1.7 by 1T3XT