The nRF51822-mKIT is a low cost ARM mbed enabled development board for Bluetooth® Smart designs with the nRF51822 SoC. The kit gives access to all GPIO pins via pin headers …

DTM mode

08 Jan 2015

Hi all, As we are nearing production testing, I'm trying to make a firmware with Direct-Test-Mode support on nRF51822. How do I use the dtm_* functions in mbed?

I've used the DTM project example from native Nordic SDK and put the main.c file contents into my mbed project. It compiles fine, but at linker stage I get undefined symbols (error L6218E) for the symbols: dtm_event_get, dtm_cmd, dtm_init and dtm_wait.

The ble_dtm.h file is present in the nRF51822 mbed library project, but I cannot find the ble_dtm.c file anywhere. I've tried copying the ble_dtm.c from native nordic sdk, but that results in several missing header files and undefined symbols during compilation stage.

Any help would be appreciated. Thanks.

09 Jan 2015

Hello Prashanth,

Thanks for trying to DTM. This could be valuable for other users. I would take ble_dtm.c from the nordic SDK. We're still updating to the latest SDK (v7.1), so if you've fetched your ble_dtm.c from the latest, then there might be inconsistencies in the headers. I expect to update to the latest SDK within a day or two (at the most).

I might be able to help you with the compilation errors if you share the error messages.

Would you consider extending BLE_API to include support for DTM?

We would be very interested in hearing about projects where mbed+BLE is used to make real products. Would you be willing to talk to us more about your work (in private if needed)?

10 Jan 2015

Hi Rohit,

Sure I'll be happy to contribute DTM support to BLE_API (when I get it to work!). For our existing products (not built on Nordic), we already have a proprietary GATT service and iPhone app to manually initiate regulatory testing mode. For the mbed-based project we also have 4 pads on the PCB to connect it to UART and run the tests through an automated tester. Either approach is fine with us.

I'd also love to discuss our experiences building the commercial product Vocca ( We've had ups and downs and have a lot of feedback to offer. We also have at least 2 more mbed-based products in the pipeline for 1st half 2015.

As you suggest I will continue with my current approach of copying the ble_dtm.c file from nordic SDK. I will get back to you on Monday when I'm back in office. Enjoy the weekend.

14 Jan 2015

(no longer relevant, please see below post)

14 Jan 2015

Hi all,

I am happy to say that I've got DTM working on mKit (as far as nRF Go Studio is concerned). It uses the serial port to receive DTM commands and to send back its response. Note I don't have a spectrum analyser so I can't (yet) verify that the chip is transmitting what it should, but there's no reason it shouldn't.

I've uploaded the standalone DTM program here:

By default, it uses the mbed default USB serial port for communication. This can be changed be redefining the pins at the top of main.cpp. Note this is 100% Nordic code, I made only minor modifications to get it compiling. Feel free to use this for your own projects.

My next step would be wrap the DTM functionality in a BLE_API -based service so DTM can be initiated through BLE link. This is low priority though as UART mode seems to be most requested by test labs using automated testing equipment.

15 Jan 2015

Excellent news! Looking forward to your solution to enable DTM through BLE_API. Would love to have that available for other users.

01 Dec 2015

Hi, I came across your discussion about enabling DTM on nRF51822, but i have similar board nRF51422. But certainly same question. I am quite a beginner to DK and its interfaces. I am stuck to enable DTM using UART interface of the board. I am using levelshifter to connect via PC eventually via CBT to the UART interface of the board. I used the code from nordic as well as uplaoded by Prashant Vaibhav, but still the board do not react to UART commands. Can you help me figure out what could be an issue, from your experience with the DK. Perhaps you have any connection diagram to for me? Thanks.