This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

DTM and clock source

I made a product with nrf51822AC(based on SDK6.1&softdevice7.3), now we want to do BQB testing and I am working on our board's DTM code. I have tried example "\Nordic\nrf51822\Board\nrf6310\s110\ble_dtm" and changed pin configuration base on my board. There is a 32.768k crystal on my board act as external clock, so I do this modification: SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_RC_250_PPM_TEMP_8000MS_CALIBRATION, false);

This clock source configuration work well on my original firmware. But in dtm code, I found that the thread is blocked in function "ser_app_hal_hw_init " in Ser_app_hal_nrf51.c:` nrf_gpio_cfg_output(CONN_CHIP_RESET_PIN_NO);

NRF_CLOCK->LFCLKSRC            = (CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos);
NRF_CLOCK->EVENTS_LFCLKSTARTED = 0;
NRF_CLOCK->TASKS_LFCLKSTART    = 1;

while (NRF_CLOCK->EVENTS_LFCLKSTARTED == 0)      //*Blocked in this loop
{
    //No implementation needed.
}

NRF_CLOCK->EVENTS_LFCLKSTARTED = 0;

return NRF_SUCCESS;`

And I have tried to do this modification:

NRF_CLOCK->LFCLKSRC = (CLOCK_LFCLKSRC_SRC_Synth<< CLOCK_LFCLKSRC_SRC_Pos)

The thread can jump out this loop, but it will be blocked in ser_sd_rsp_wait() ;

Please tell me how resolve this problem. Thanks Frank

Related