AN14163

Bluetooth Direct Test Mode (DTM)
Rev. 2.0 — 4 July 2024

Application note

Document information
Information

Content

Keywords

Bluetooth Low-Energy (BLE), Direct Test Mode (DTM), Device Under Test (DUT)

Abstract

Explains how to perform DTM tests using HCI commands.

AN14163

NXP Semiconductors

Bluetooth Direct Test Mode (DTM)

1 About this document
Direct Test Mode (DTM) is used to control the Device Under Test (DUT) and provide a report back to the Tester.
With this mode, the operation of the radio at the physical level, such as Transmission power and receiversensitivity, Frequency offset and drift, Modulation characteristics, Packet error rate can be tested. More details
on DTM are described in the Bluetooth Core Specification, Volume 6, Part F [1].
This document explains how to perform DTM tests using HCI commands.

1.1 Supported devices
This feature is supported by the following devices:• AW611 [2]• AW690 [3]• IW416 [4]• IW611 [5]• IW612 [6]• IW620 [7]• 88Q9098/88Q9098S [8]• 88W8887 [9]• 88W8897P [10]• 88W8977 [11]• 88W8987 [12]• 88W8997 [13]• 88W9098[14]Note: In the following sections, the supported devices may be referred to as “Wireless SoC”.

1.2 Notation conventions
This document employs the following notation conventions:• Commands and examples of command outputs are shown in paragraphs with grey background color
This is an example of command• Terms related to commands use a monospace font:– parameter– option– command name• File names, directory names and paths are shown in italics:– <file name>.<extension>– <directory>– path/to/directory/and/file

AN14163

Application note

All information provided in this document is subject to legal disclaimers.

Rev. 2.0 — 4 July 2024

© 2024 NXP B.V. All rights reserved.

Document feedback
2 / 19

AN14163

NXP Semiconductors

Bluetooth Direct Test Mode (DTM)

2 Setup
The following hardware is required to perform DTM tests:• Laptop• Bluetooth RF Tester• NXP DUT
• RS232 cable/RF cable
Figure 1 shows the general setup structure for DTM testing.

Bluetooth RF Tester

RF cable

DUT

UART

LaptopFigure 1. DTM setup

AN14163

Application note

All information provided in this document is subject to legal disclaimers.

Rev. 2.0 — 4 July 2024

© 2024 NXP B.V. All rights reserved.

Document feedback
3 / 19

AN14163

NXP Semiconductors

Bluetooth Direct Test Mode (DTM)

3 Commands
In order to perform DTM, HCI commands are used. The commands are:
• HCI_LE_Transmitter_Test• HCI_LE_Receiver_Test• HCI_LE_Test_End

AN14163

Application note

All information provided in this document is subject to legal disclaimers.

Rev. 2.0 — 4 July 2024

© 2024 NXP B.V. All rights reserved.

Document feedback
4 / 19

AN14163

NXP Semiconductors

Bluetooth Direct Test Mode (DTM)

3.1 HCI_LE_Transmitter_Test
This command is used to start a test where the DUT generates test reference packets at a fixed interval.
Syntax:hcitool -i hci0 cmd 08 <OCF> <TX_Channel> <Test_Data_Length> <Packet_Payload><PHY>
Table 1 and Table 2 provide information about the command and return parameters.
Table 1. HCI_LE_Transmitter_Test command
Parameter

Description

OGF

0x08

OCF

0x001E = v1 [v4.2 and above]
0x0034 = v2 [v5.0 and above]

TX_Channel

TX channel
1 octetN = (F-2402) / 2
Range (N) = 0x00 to 0x27
Frequency Range (F) = 2402 MHz to 2480 MHz

Test_Data_Length

Length in bytes of payload data in each packet
1 octetRange = 0x00 to 0xFF

Packet_Payload

contents of the Payload of the test reference packets
1 octet0x00 = PRBS9 sequence '11111111100000111101…' (in transmission order)

PHY
PHY requested(Applicable if OCF = 0x0034) 1 octet
0x01 = Transmitter set to use the LE 1M PHY
0x02 = Transmitter set to use the LE 2M PHY
0x03 = Transmitter set to use the LE Coded PHY with S=8 data coding
0x04 = Transmitter set to use the LE Coded PHY with S=2 data coding

Table 2. Return Parameters
Parameter

Description

StatusStatus1 octet0x00 = success,
0x1 to 0xFF = error

EventsCommand complete event returned.

AN14163

Application note

All information provided in this document is subject to legal disclaimers.

Rev. 2.0 — 4 July 2024

© 2024 NXP B.V. All rights reserved.

Document feedback
5 / 19

AN14163

NXP Semiconductors

Bluetooth Direct Test Mode (DTM)

3.2 HCI_LE_Receiver_Test
This command is used to start a test where the DUT receives test reference packets at a fixed interval. The
tester generates the test reference packets. There are two versions of this command with differing parameters.
Syntax:hcitool -i hci0 cmd 08 <OCF> <RX_Channel> <PHY> <Modulation_Index>
Table 3 and Table 4 provide information about the command and return parameters.
Table 3. HCI_LE_Receiver_Test command
Parameter

Description

OGF

0x08

OCF

0x001D = v1 [v4.2 and above]
0x0033 = v2 [v5.0 and above]

RX_Channel

RX channel
1 octetN = (F-2402) / 2
Range (N) = 0x00 to 0x27
Frequency Range (F) = 2402 MHz to 2480 MHz

PHY(Applicable if OCF = 0x0033)

PHY requested
1 octet0x01 = Transmitter set to use the LE 1M PHY
0x02 = Transmitter set to use the LE 2M PHY
0x03 = Receiver set to use the LE Coded PHY

Modulation_Index(Applicable if OCF = 0x0033)

Specifies whether the Controller should assume the receiver has a stable
modulation index
1 octet0x00 = Assume transmitter will have a standard modulation index
0x01 = Assume transmitter will have a stable modulation index

Table 4. Return Parameters
Parameter

Description

StatusStatus1 octet0x00 = success
0x1 – 0xFF = error

EventsCommand complete event returned.

AN14163

Application note

All information provided in this document is subject to legal disclaimers.

Rev. 2.0 — 4 July 2024

© 2024 NXP B.V. All rights reserved.

Document feedback
6 / 19

AN14163

NXP Semiconductors

Bluetooth Direct Test Mode (DTM)

3.3 HCI_LE_Test_End
This command is used to stop a DTM test.
Syntax:hcitool -i hci0 cmd 08 1F
Table 5 and Table 6 provide information about the command and return parameters.
Table 5. HCI_LE_Test_End command
Parameter

Description

OGF

0x08

OCF

0x001F

Table 6. Return Parameters
Parameter

Description

StatusStatus1 octet0x00 = success
0x001 to 0xFF = error

Num_Packets

0xXXXX – Number of packets received
2 octets

EventsCommand complete event returned.

AN14163

Application note

All information provided in this document is subject to legal disclaimers.

Rev. 2.0 — 4 July 2024

© 2024 NXP B.V. All rights reserved.

Document feedback
7 / 19

AN14163

NXP Semiconductors

Bluetooth Direct Test Mode (DTM)

4 Examples
This section provides DTM tests examples.

AN14163

Application note

All information provided in this document is subject to legal disclaimers.

Rev. 2.0 — 4 July 2024

© 2024 NXP B.V. All rights reserved.

Document feedback
8 / 19

AN14163

NXP Semiconductors

Bluetooth Direct Test Mode (DTM)

4.1 LE transmitter test
This example shows how to test LE TX.
Step 1 – Set up the test environment.
Step 2 – Load the drivers and firmware onto the DUT.
Step 3 – Check if the Bluetooth interface is UP RUNNING on DUT.
hciconfig -a
Example output:
hci0: Type: Primary Bus: UARTBD Address: 88:88:88:88:88:88 ACL MTU: 1021:7 SCO MTU: 120:6
UP RUNNING
RX bytes:1513 acl:0 sco:0 events:92 errors:0
TX bytes:1282 acl:0 sco:0 commands:92 errors:0
In the following steps, the Bluetooth interface, hci0 is used.
Step 4 – Connect DUT to spectrum analyzer
Step 5 – Configure spectrum analyzer
Step 6 – Start the LE transmit test with appropriate parameters.
Syntax:hcitool -i hci0 cmd 08 <OCF> <TX_Channel> <Test_Data_Length> <Packet_Payload><PHY>
Example command:• OGF = 08
• OCF = 34
• TX_Channel = 00 // 2402 MHz• Test_Data_Length = FF
• Packet_Payload = 00 // PRBS9 sequence• PHY = 02 // LE 2M PHY
hcitool -i hci0 cmd 08 34 00 ff 00 02
Example output:< HCI Command: ogf 0x08, ocf 0x0034, plen 4
00 FF 00 02> HCI Event: 0x0e plen 4
01 34 20 00

AN14163

Application note

All information provided in this document is subject to legal disclaimers.

Rev. 2.0 — 4 July 2024

© 2024 NXP B.V. All rights reserved.

Document feedback
9 / 19

AN14163

NXP Semiconductors

Bluetooth Direct Test Mode (DTM)

Step 7 – Stop the test.
hcitool -i hci0 cmd 08 1F
Example output:< HCI Command: ogf 0x08, ocf 0x001f, plen 0> HCI Event: 0x0e plen 6
01 1F 20 00 00 00

AN14163

Application note

All information provided in this document is subject to legal disclaimers.

Rev. 2.0 — 4 July 2024

© 2024 NXP B.V. All rights reserved.

Document feedback
10 / 19

AN14163

NXP Semiconductors

Bluetooth Direct Test Mode (DTM)

4.2 LE Receiver test
This example shows how to test LE RX.
Step 1 – Set up the test environment.
Step 2 – Load the drivers and firmware onto the DUT.
Step 3 – Check if the Bluetooth interface is UP RUNNING on DUT.
hciconfig -a
Example output:
hci0: Type: Primary Bus: UARTBD Address: 88:88:88:88:88:88 ACL MTU: 1021:7 SCO MTU: 120:6
UP RUNNING
RX bytes:1513 acl:0 sco:0 events:92 errors:0
TX bytes:1282 acl:0 sco:0 commands:92 errors:0
In the following steps, the Bluetooth interface, hci0 is used.
Step 4 – Connect DUT to spectrum analyzer
Step 5 – Configure spectrum analyzer
Step 6 – Start LE receive the appropriate HCI_LE_Reciever_test command.
Syntax:hcitool -i hci0 cmd 08 <OCF> <RX_Channel> <PHY> <Modulation_Index>
Example command:• OGF = 08
• OCF = 33
• RX_Channel = 00 // 2402 MHz• PHY = 02 // LE 2M PHY• Modulation_Index = 00 // Standard modulation
hcitool -i hci0 cmd 08 33 00 02 00
Example output:< HCI Command: ogf 0x08, ocf 0x0033, plen 300 02 00
> HCI Event: 0x0e plen 4
01 33 20 00
Step 7 – Stop LE test.
hcitool -i hci0 cmd 08 1F
Example output:< HCI Command: ogf 0x08, ocf 0x001f, plen 0> HCI Event: 0x0e plen 6
01 1F 20 00 00 00
AN14163

Application note

All information provided in this document is subject to legal disclaimers.

Rev. 2.0 — 4 July 2024

© 2024 NXP B.V. All rights reserved.

Document feedback
11 / 19

AN14163

NXP Semiconductors

Bluetooth Direct Test Mode (DTM)

5 Acronyms and abbreviations
Table 7. Acronyms
AcronymDescription

DTM

Direct test mode

DUT

Device under testLE

Low Energy

BT

Bluetooth

TX

Transmit

RX

Receive

HCI

Host Controller Interface

AN14163

Application note

All information provided in this document is subject to legal disclaimers.

Rev. 2.0 — 4 July 2024

© 2024 NXP B.V. All rights reserved.

Document feedback
12 / 19

AN14163

NXP Semiconductors

Bluetooth Direct Test Mode (DTM)

6 References
[1]
[2]
[3]
[4]
[5]
[6]
[7]
[8]
[9]
[10]
[11]
[12]
[13]
[14]

Specification - Bluetooth Core 5.3 specification (link)
Webpage - AW611: 2.4/5 GHz Dual-Band 1x1 Wi-Fi® 6 (802.11ax) + Bluetooth® 5.2 Automotive Solution(link)
Webpage - AW690: Wi-Fi® 6 1x1 Concurrent Dual Wi-Fi (CDW) and Bluetooth® 5.3 Combo SoC (link)
Webpage - IW416: 2.4/5 GHz Dual-Band 1x1 Wi-Fi® 4 (802.11n) + Bluetooth® 5.2 Solution (link)
Webpage - IW611: 2.4/5 GHz Dual-Band 1x1 Wi-Fi® 6 (802.11ax) + Bluetooth® 5.2 Solution (link)
Webpage - IW612: 2.4/5 GHz Dual-Band 1x1 Wi-Fi® 6 (802.11ax) + Bluetooth® 5.2 + 802.15.4 Tri-radio
Solution (link)
Webpage - IW620: 2.4/5 GHz Dual-Band 2x2 Wi-Fi® 6 (802.11ax) + Bluetooth® 5.1 Solution (link)
Webpage - 88Q9098/88Q9098S: 2.4/5 GHz Dual-Band 2x2 Wi-Fi® 6 (802.11ax) + Bluetooth® 5.3
Automotive Solution (link)
Webpage - 88W8887: 1x1 Dual-band Wi-Fi® 5 (802.11ac) and Bluetooth®5.2 Combo Solution (link)
Webpage - 88W8897P: (Automotive): 2.4/5 GHz Dual-Band 2x2 Wi-Fi® 5 (802.11ac) + Bluetooth® 5
Solution (link)
Webpage - 88W8977: 2.4/5 GHz Dual-Band 1x1 Wi-Fi® 4 (802.11n) + Bluetooth® 5.2 Solution (link)
Webpage - 88W8987: 2.4/5 GHz Dual-Band 1x1 Wi-Fi® 5 (802.11ac) + Bluetooth® 5.2 Solution (link)
Webpage - 88W8997: 2.4/5 GHz Dual-Band 2x2 Wi-Fi® 5 (802.11ac) + Bluetooth® 5.3 Solution (link)
Webpage - 88W9098: 2.4/5 GHz Dual-Band 2x2 Wi-Fi® 6 (802.11ax) + Bluetooth® 5.3 (link)

AN14163

Application note

All information provided in this document is subject to legal disclaimers.

Rev. 2.0 — 4 July 2024

© 2024 NXP B.V. All rights reserved.

Document feedback
13 / 19

AN14163

NXP Semiconductors

Bluetooth Direct Test Mode (DTM)

7 Note about the source code in the document
The example code shown in this document has the following copyright and BSD-3-Clause license:
Copyright 2024 NXP Redistribution and use in source and binary forms, with or without modification, arepermitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and thefollowing disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and thefollowing disclaimer in the documentation and/or other materials must be provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or
promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIESOF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENTSHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITEDTO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCHDAMAGE.

AN14163

Application note

All information provided in this document is subject to legal disclaimers.

Rev. 2.0 — 4 July 2024

© 2024 NXP B.V. All rights reserved.

Document feedback
14 / 19

AN14163

NXP Semiconductors

Bluetooth Direct Test Mode (DTM)

8 Revision history
Table 8. Revision history
Document ID

Release date

Description

AN14163 v.2

04 July 2024

Security status changed to public.
• Section 1.1 "Supported devices": updated.

AN14163 v.1

19 April 2024

• Initial version

AN14163

Application note

All information provided in this document is subject to legal disclaimers.

Rev. 2.0 — 4 July 2024

© 2024 NXP B.V. All rights reserved.

Document feedback
15 / 19

AN14163

NXP Semiconductors

Bluetooth Direct Test Mode (DTM)

Legal information
Definitions
Draft — A draft status on a document indicates that the content is still
under internal review and subject to formal approval, which may resultin modifications or additions. NXP Semiconductors does not give any
representations or warranties as to the accuracy or completeness of
information included in a draft version of a document and shall have noliability for the consequences of use of such information.

Disclaimers
Limited warranty and liability — Information in this document is believed
to be accurate and reliable. However, NXP Semiconductors does not give
any representations or warranties, expressed or implied, as to the accuracy
or completeness of such information and shall have no liability for theconsequences of use of such information. NXP Semiconductors takes noresponsibility for the content in this document if provided by an information
source outside of NXP Semiconductors.
In no event shall NXP Semiconductors be liable for any indirect, incidental,
punitive, special or consequential damages (including - without limitation lost profits, lost savings, business interruption, costs related to the removalor replacement of any products or rework charges) whether or not suchdamages are based on tort (including negligence), warranty, breach ofcontract or any other legal theory.
Notwithstanding any damages that customer might incur for any reason
whatsoever, NXP Semiconductors’ aggregate and cumulative liability
towards customer for the products described herein shall be limited inaccordance with the Terms and conditions of commercial sale of NXP
Semiconductors.
Right to make changes — NXP Semiconductors reserves the right tomake changes to information published in this document, including without
limitation specifications and product descriptions, at any time and without
notice. This document supersedes and replaces all information supplied prior
to the publication hereof.
Applications — Applications that are described herein for any of theseproducts are for illustrative purposes only. NXP Semiconductors makes norepresentation or warranty that such applications will be suitable for the
specified use without further testing or modification.
Customers are responsible for the design and operation of theirapplications and products using NXP Semiconductors products, and NXP
Semiconductors accepts no liability for any assistance with applications or
customer product design. It is customer’s sole responsibility to determine
whether the NXP Semiconductors product is suitable and fit for thecustomer’s applications and products planned, as well as for the planned
application and use of customer’s third party customer(s). Customers should
provide appropriate design and operating safeguards to minimize the risks
associated with their applications and products.
NXP Semiconductors does not accept any liability related to any default,
damage, costs or problem which is based on any weakness or default
in the customer’s applications or products, or the application or use bycustomer’s third party customer(s). Customer is responsible for doing allnecessary testing for the customer’s applications and products using NXP
Semiconductors products in order to avoid a default of the applications
and the products or of the application or use by customer’s third party
customer(s). NXP does not accept any liability in this respect.

Terms and conditions of commercial sale — NXP Semiconductors
products are sold subject to the general terms and conditions of commercial
sale, as published at https://www.nxp.com/profile/terms, unless otherwise
agreed in a valid written individual agreement. In case an individual
agreement is concluded only the terms and conditions of the respective
agreement shall apply. NXP Semiconductors hereby expressly objects toapplying the customer’s general terms and conditions with regard to thepurchase of NXP Semiconductors products by customer.
Suitability for use in automotive applications — This NXP product has
been qualified for use in automotive applications. If this product is usedby customer in the development of, or for incorporation into, products orservices (a) used in safety critical applications or (b) in which failure could
lead to death, personal injury, or severe physical or environmental damage(such products and services hereinafter referred to as “Critical Applications”),
then customer makes the ultimate design decisions regarding its products
and is solely responsible for compliance with all legal, regulatory, safety,
and security related requirements concerning its products, regardless of
any information or support that may be provided by NXP. As such, customer
assumes all risk related to use of any products in Critical Applications and
NXP and its suppliers shall not be liable for any such use by customer.
Accordingly, customer will indemnify and hold NXP harmless from any
claims, liabilities, damages and associated costs and expenses (including
attorneys’ fees) that NXP may incur related to customer’s incorporation of
any product in a Critical Application.
Export control — This document as well as the item(s) described herein
may be subject to export control regulations. Export might require a priorauthorization from competent authorities.
Translations — A non-English (translated) version of a document, including
the legal information in that document, is for reference only. The English
version shall prevail in case of any discrepancy between the translated andEnglish versions.
Security — Customer understands that all NXP products may be subject tounidentified vulnerabilities or may support established security standards or
specifications with known limitations. Customer is responsible for the designand operation of its applications and products throughout their lifecycles
to reduce the effect of these vulnerabilities on customer’s applications
and products. Customer’s responsibility also extends to other open and/or
proprietary technologies supported by NXP products for use in customer’s
applications. NXP accepts no liability for any vulnerability. Customer should
regularly check security updates from NXP and follow up appropriately.
Customer shall select products with security features that best meet rules,
regulations, and standards of the intended application and make theultimate design decisions regarding its products and is solely responsible
for compliance with all legal, regulatory, and security related requirements
concerning its products, regardless of any information or support that may beprovided by NXP.
NXP has a Product Security Incident Response Team (PSIRT) (reachable
at PSIRT@nxp.com) that manages the investigation, reporting, and solution
release to security vulnerabilities of NXP products.
NXP B.V. — NXP B.V. is not an operating company and it does not distributeor sell products.

Trademarks
Notice: All referenced brands, product names, service names, andtrademarks are the property of their respective owners.
NXP — wordmark and logo are trademarks of NXP B.V.
Bluetooth — the Bluetooth wordmark and logos are registered trademarks
owned by Bluetooth SIG, Inc. and any use of such marks by NXP
Semiconductors is under license.

AN14163

Application note

All information provided in this document is subject to legal disclaimers.

Rev. 2.0 — 4 July 2024

© 2024 NXP B.V. All rights reserved.

Document feedback
16 / 19

AN14163

NXP Semiconductors

Bluetooth Direct Test Mode (DTM)

TablesTab. 1.
Tab. 2.
Tab. 3.
Tab. 4.

HCI_LE_Transmitter_Test command .................5
Return Parameters ............................................ 5
HCI_LE_Receiver_Test command .................... 6
Return Parameters ............................................ 6

AN14163

Application note

Tab. 5.
Tab. 6.
Tab. 7.
Tab. 8.

HCI_LE_Test_End command ............................ 7
Return Parameters ............................................ 7
Acronyms .........................................................12
Revision history ...............................................15

All information provided in this document is subject to legal disclaimers.

Rev. 2.0 — 4 July 2024

© 2024 NXP B.V. All rights reserved.

Document feedback
17 / 19

AN14163

NXP Semiconductors

Bluetooth Direct Test Mode (DTM)

FiguresFig. 1.

DTM setup .........................................................3

AN14163

Application note

All information provided in this document is subject to legal disclaimers.

Rev. 2.0 — 4 July 2024

© 2024 NXP B.V. All rights reserved.

Document feedback
18 / 19

AN14163

NXP Semiconductors

Bluetooth Direct Test Mode (DTM)

Contents
1
1.1
1.2
2
3
3.1
3.2
3.3
4
4.1
4.2
5
6
7
8

About this document .......................................2
Supported devices ............................................. 2
Notation conventions ......................................... 2
Setup ................................................................. 3
Commands ....................................................... 4
HCI_LE_Transmitter_Test ..................................5
HCI_LE_Receiver_Test ......................................6
HCI_LE_Test_End ............................................. 7
Examples .......................................................... 8
LE transmitter test ............................................. 9
LE Receiver test .............................................. 11
Acronyms and abbreviations ....................... 12
References ......................................................13
Note about the source code in the
document ........................................................14
Revision history .............................................15
Legal information ...........................................16

Please be aware that important notices concerning this document and the product(s)described herein, have been included in section 'Legal information'.

© 2024 NXP B.V.
For more information, please visit: https://www.nxp.com

All rights reserved.
Document feedback
Date of release: 4 July 2024
Document identifier: AN14163