DT0069 Design tip Enabling the Bluetth Lw Energy Direct Test Mde (DTM) with BlueNRG-MS By Salv Bnina Main cmpnents BlueNRG-MS Upgradable Bluetth Lw Energy netwrk prcessr SPBTLE-RF Very lw pwer mdule fr Bluetth Smart v4.1 BlueNRG-1 Bluetth lw energy wireless system-n-chip Purpse and benefits The BlueNRG-MS is a very lw pwer Bluetth Lw Energy (BLE) single-mde netwrk prcessr, cmpliant with Bluetth Cre Specificatinv4.1. The entire BLE stack runs n the embedded Crtex M0 cre. The devices interfaces with an external hst micrcntrller using the SPI transprt layer and a set f APIs cmpsed f standard Hst Cntrller Interface (HCI) cmmands and vendr-specific Applicatin Cmmand Interface (ACI) cmmands. Amng the set f HCI cmmands is a subset f cmmands used in rder t enable Direct Test Mde (DTM) as described in the Lw Energy Cntrller Vlume in the Bluetth Specificatin Cre v4.1. DTM is used t cntrl the Device Under Test (DUT) and prvides a reprt back t the Tester. Accrding t the Specificatin, DTM shall be set up using ne f tw alternate methds: 1. ver HCI 2. thrugh a 2-wire UART interface BlueNRG-MS implements the first methd, ver HCI. The purpse f this dcument is t detail hw t setup DTM wrking with the BlueNRG-MS device. Nte that the cntent f this dcument applies t the SPBTLE-RF mdule and BlueNRG-1 devices. Descriptin BlueNRG-MS supprts the DTM as per Bluetth Cre Specificatin v4.1 [Vl. 6, Part F]. August 2016 DT0069 Rev 1 1/6
The HCI test cmmands, which are fully cmpliant with the specificatins, are the fllwing: HCI_LE_Transmitter_Test HCI_LE_Receiver_Test HCI_LE_Test_End Fr reference, the functin prttypes are listed belw: int hci_le_receiver_test(uint8_t frequency); int hci_le_transmitter_test(uint8_t frequency, uint8_t length, uint8_t paylad); int hci_le_test_end(uint16_t *num_pkts); These cmmands can be fund within the HCI interface driver files hci.c and hci.h in the device Sftware Develpment Kit (SDK) available nline at. The number f the received test packets is a return value f the functin HCI_LE_Test_End. Additinally the fllwing functins are available in the files bluenrg_hal_aci.c and bluenrg_hal_aci.h: tblestatus aci_hal_le_tx_test_packet_number(uint32_t *number_f_packets); This cmmand prvides the number f the transmitted test packets during a DTM test. tblestatus aci_hal_set_tx_pwer_level(uint8_t en_high_pwer, uint8_t pa_level); This cmmand is used t set the TX utput pwer. The ACI cmmand set Reference Manual (UM1865) cntains a cmplete descriptin n the TX pwer levels values. tblestatus aci_hal_tne_start(uint8_t rf_channel); This cmmand is used t generate a Cntinuus Wavefrm (CW) frm the BlueNRG-MS radi. tblestatus aci_hal_tne_stp(vid); This cmmand is used t terminate the CW emissin. The cmmand sequence belw is a typical flw fr enabling CW transmissin frm the BlueNRG-MS radi: hci_reset aci_hal_set_tx_pwer_level aci_hal_tne_start aci_hal_tne_stp August 2016 DT0069 Rev 1 2/6
Using the BlueNRG evaluatin kits fr DTM tests Fr the BlueNRG-MS device, the evaluatin kits are named STEVAL-IDB005V1 and STEVAL-IDB006V1. While using these kits, the fllwing prcedure can be fllwed t enable DTM test mde: Dwnlad frm the BlueNRG GUI sftware and pen it n the PC. The Device Firmware Update (DFU) applicatin is preladed in the STM32L1 Flash with a sample applicatin. The DFU applicatin must be started t lad the VCOM firmware t run the DTM tests. Using the GUI, lad the VCOM firmware nt the evaluatin bard s STM32L1, verwriting the sample applicatin. T d this: If wrking with STEVAL-IDB006V1, then press and hld the SW1 buttn and plug the USB Dngle n a PC USB prt, then release the buttn. The bard nw is in DFU mde. Wait fr the success message indicating the DFU driver is installed prperly. If wrking with STEVAL-IDB005V1, cnnect the bard t the PC USB prt. Then press and hld at the same time bth the Reset and Push Buttn n the bard. Then keeping the Push buttn pressed, release the Reset buttn after at least 2 secnds. The DL2 amber LED will start blinking. The bard nw is in DFU mde. Wait fr the success message indicating the DFU driver is installed prperly. In the BlueNRG GUI, g t Tls -> Flash Mtherbard FW then click OK in the pp-up windw and select frm the file explrer the file BlueNRG_VCOM_1_8.hex. This file is lcated in the flder \Firmware\STM32L1_prebuilt_images f the BlueNRG GUI installatin path. After the VCOM firmware has been prgrammed n the bard, the bard will be assigned t a COM prt in the PC. In the GUI, in the drp-dwn menu next t the Prt label, a COM prt labelled (ST DK) will be visible. Select this COM prt and then click n the Open buttn. At this pint, the GUI is capable f sending cmmands t and receiving respnse and events frm the BlueNRG-MS device. Select the RF Test tab in the GUI (see Figure 1). Set the RF parameters as desired. In the TRANSMITTER sectin, the Start Transmitter buttn will start the DTM transmitter test while the Start Tne buttn will start the CW test. In the RECEIVER sectin, the Start Receiver buttn will start the DTM receiver test. Nte that nly ne DTM transmitter test, DTM receiver test, r CW test can be perfrmed n the bard at a time. Nte: the VCOM firmware is prvided in the BlueNRG SDK bth in binary frm precmpiled fr the STM32L micrcntrller and in surce frm. The surce cde is available in the BlueNRG DK (dwnladable at ) in a reference prject fr IAR Embedded Wrkbench Integrated Develpment Envirnment (IDE). The prject name is VirtualCOMPrt.eww and it is lcated in the flder August 2016 DT0069 Rev 1 3/6
\Prjects\Prjects_STD_Library\Virtual_COM_Prt\EWARM. Refer t the IAR wrkspace named USB. Figure 1: BlueNRG GUI v2.1.0 - RF Test Tab August 2016 DT0069 Rev 1 4/6
Supprt material Related design supprt material STEVAL-IDB005V1 Bluetth lw energy bard based n the BlueNRG-MS netwrk prcessr STEVAL-IDB006V1 - BlueNRG-MS based Bluetth Smart USB Dcumentatin DS10691: Upgradable Bluetth Lw Energy netwrk prcessr DS11045: SPBTLE-RF Very lw pwer mdule fr Bluetth Smart v4.1 DS11481: Bluetth lw energy wireless system-n-chip UM1870: BlueNRG-MS develpment kits UM1865: BlueNRG-MS Bluetth LE stack applicatin cmmand interface (ACI) PM0237: BlueNRG, BlueNRG-MS stacks prgramming guidelines Revisin histry Date Versin Changes 26-Aug-2016 1 Initial release August 2016 DT0069 Rev 1 5/6
IMPORTANT NOTICE PLEASE READ CAREFULLY STMicrelectrnics NV and its subsidiaries ( ST ) reserve the right t make changes, crrectins, enhancements, mdificatins, and imprvements t ST prducts and/r t this dcument at any time withut ntice. Purchasers shuld btain the latest relevant infrmatin n ST prducts befre placing rders. ST prducts are sld pursuant t ST s terms and cnditins f sale in place at the time f rder acknwledgement. Purchasers are slely respnsible fr the chice, selectin, and use f ST prducts and ST assumes n liability fr applicatin assistance r the design f Purchasers prducts. N license, express r implied, t any intellectual prperty right is granted by ST herein. Resale f ST prducts with prvisins different frm the infrmatin set frth herein shall vid any warranty granted by ST fr such prduct. ST and the ST lg are trademarks f ST. All ther prduct r service names are the prperty f their respective wners. Infrmatin in this dcument supersedes and replaces infrmatin previusly supplied in any prir versins f this dcument. 2016 STMicrelectrnics All rights reserved August 2016 DT0069 Rev 1 6/6