Bluetooth® Low-Energy (BLE) RF PHY tests can be done by using the Direct Test Mode (DTM).
This document will help as a guide to perform the test using a device from the KW family.
Direct Test Mode (DTM) is used to control the Device Under Test (DUT) and provides a report with the results from the tests performed by the Tester.
There are two ways to perform those tests:
The packet format from the DTM is different from the HCI commands.
For further information of the commands and this type of tests, please refer to the Bluetooth Core Specifications, Vol 6, Part F: Direct Test Mode
This guide will use the KW41Z as example, but the same changes must be applicable for the rest of the devices
You can choose from any example available while making sure that the pins chosen for DTM are not occupied or used.
The DTM pins behave as a UART interface; in order to enable them in our KW devices there is the need to follow the next steps
PORT_SetPinMux(PORTB, PIN1_IDX, kPORT_MuxAlt2); /* PORTB1 (pin 17) is configured as DTM_RX */
PORT_SetPinMux(PORTB, PIN2_IDX, kPORT_MuxAlt3); /* PORTB2 (pin 18) is configured as DTM_TX */
#define DTM_2WIRE_CONFIG 0x580
#define BTLE_RF_DTM_2WIRE_CONFIG (*(volatile uint16_t *) (BTLE_RF_BASE+DTM_2WIRE_CONFIG))
BTLE_RF_DTM_2WIRE_CONFIG = 0x0042; /*Configure DTM pins baud rate of 115200*/