Basic BLE PTM Project
Table of Contents
Introduction
The Basic BLE PTM
project is based on the Basic BLE example and implements a simple Bluetooth low-energy multi-role device with Production Test Mode (PTM).
The PTM allows a BLE application in a "single-chip" configuration to temporarily expose the host control interface (HCI) test commands over the serial interface when triggered externally to do so (e.g. holding a GPIO pin low during power up). This test mode allows the device to be connected to a Bluetooth RF Tester in order to run Direct Test Mode (DTM) commands on a production line using the final release firmware, while leaving the UART GPIO pins available for the application to use at all other times.
Note: By default, the Basic BLE PTM
project is configured to always enter PTM.
Developers can change this behavior by conditionally calling PTM_start()
(within app_main.c
).
Hardware Prerequisites
The default Basic BLE PTM
project board configuration uses the
device's LaunchPad development kit.
Software Prerequisites
For information on what versions of Code Composer Studio and IAR Embedded Workbench to use, see the Release Notes. In addition, please refer to the User's Guide for information on importing this project into your IDE workspace and build/run.
Usage
Configuration
The PTM is enabled in this Basic BLE PTM
project.
The default settings when enabling PTM is shown in the figure below.
The following UART settings are used by default.
UART Param | Default Values |
---|---|
Baud Rate | 115200 |
Data length | 8 bits |
Parity | None |
Stop bits | 1 bit |
Flow Control | None |
Steps to change the PTM setting:
- Open the SysConfig file by double-clicking on the ble_basic.syscfg file.
- Under the BLE tab, access the Advanced Settings.
- Check the PTM box, which should already be checked for this project.
Once the PTM box is checked, the PTM will be enabled, and the maximum number of ICall Enabled tasks will increase to 4. - If you want to enable the NPI packet flow control, you can do this in the NPI panel.
The UART baud rate can be changed by adding the predefined symbol NPI_UART_BR
set to the baudrate expected.
For example, to set the UART baudrate to 230400, the following predefined should be added NPI_UART_BR=230400
.
Running Tests
As mentioned before, the Production Test Mode (PTM) enables an interface to input HCI commands to the device. Such commands can be sent by most of the Bluetooth testers or using the BTool available in the tools folder of the SDK.
Please reference How to Do RF Radio Test With Your Bluetooth Product for detailed steps to perform Tx, Rx, RSSI, Packet Error Rate (PER) and other tests with various PHYs and transmit powers.
The following sections introduce the commands supported while being in PTM.
Continuous Wave (Non-signaling)
Command | Parameters | Comments |
---|---|---|
HCI_Reset | None | To reset the device |
HCIExt_EndModemTestCmd | None | To terminate a modem test |
HCIExt_ModemTestTxCmd | Modulation, channel | For the 1M PHY only |
HCIExt_ModemTestRxCmd | Channel | For the 1M PHY only |
HCIExt_EnhancedModemTestTxCmd | Modulation, PHY, channel | |
HCIExt_EnhancedModemTestRxCmd | Channel, PHY | |
HCIExt_SetTxPowerDbmCmd | dBm, fraction (not used) | To set TxPower for modem tests (CC23xx) |
HCIExt_SetTxPowerCmd | dBm | To set TxPower for modem tests (CC26xx) |
Direct Test Mode - DTM (Signaling)
Command | Parameters | Comments |
---|---|---|
HCI_Reset | None | To reset the device |
HCI_LE_TestEnd | None | To terminate a DTM test |
HCI_LE_TransmitterTest | Channel, data length, data | For the 1M PHY only |
HCI_LE_ReceiverTest | Channel | For the 1M PHY only |
HCI_LE_EnhancedTransmitterTest | Channel, data length, payload, PHY | Payload to be selected from DTM standard |
HCI_LE_EnhancedReceiverTest | Channel, PHY, modulation index | |
HCIExt_SetMaxDtmTxPowerDbmCmd | dBm, fraction (not used) | To set TxPower for DTM tests (CC23xx) |
HCIExt_SetMaxDtmTxPowerCmd | dBm | To set TxPower for DTM tests (CC26xx) |