where is the source code to enter dtm?

Hi,

    From https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/bluetooth/direct_test_mode/README.html, it writes "After programming the sample to your development kit, you can test it in three ways.....". It means after programming image to dk, I can test dtm directly.

    But I traced source code, I can't find where to enter dtm. The flow of code:

- dtm_init() :  clock_init() -> timer_init() -> gppi_init() -> radio_init()

- dtm_uart_wait_init()

- dtm_tr_get() : wait user input two bytes data

I don't know where is the step to enter dtm. Could you tell me what device do to enter dtm and where is the specific code?

Thank you.

    

Parents Reply
  • The dtm_init only prepares the hardware in a listening mode and the dtm_tr_get waits for the command from the tester (which you already know) then the received DTM command is processed in dtm_tr_process and then the command is sent to the BLE controller using the underlying transport (HCI or serial based on selected configs) in the function hci_cmd().

    If you go for example in dtm_hci.c file and look into hci_cmd->hci_reset->dtm_setup_reset-> radio_init 

    In the above sequence you can see that you application responding to the radio reset command and requesting this to the hci and in radio_init, the radio registers are actually reset to default.

Children
No Data
Related