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

Can't start LFCLK when softdevice is not present

Hi.

I am trying to get the RTC started, and I've followed the rtc example in the NRF51_SDK.

But things go wrong when I call:

ret_code_t err_code = nrf_drv_clock_init(NULL);
APP_ERROR_CHECK(err_code);

I get the errer code: 2, meaning NRF_ERROR_SOFTDEVICE_NOT_ENABLED. And that is exactly right, the softdevice is not enabled, because I want to be able to debug for the moment?

(btw. will it ever be possible to debug while using the softdevice, it is getting pretty annoying, not to be able to debug :) )

Parents
  • Well if you look at the source code for nrf_drv_clock_init() you'd see it compiles differently whether the #define SOFTDEVICE_PRESENT is defined or not. So if you want to not have the softdevice-enabled code compiled, undefine that and it won't call the sd_* function which is returning the error.

    Please read the threads about why debugging is not compatible with the softdevice, there's many of them, it's a hard technical limitation of how the processor debug works. You actually can debug before you start advertising, but once the radio is going and bluetooth has timing requirements, then you can't break, well you can break, you can't resume again.

    however see the blog post on Monitor Mode debugging which is available on the nRF52, which does allow you to debug with the softdevice running (by using a different debugging mode not available on the Cortex M0 in the nRF51).

Reply
  • Well if you look at the source code for nrf_drv_clock_init() you'd see it compiles differently whether the #define SOFTDEVICE_PRESENT is defined or not. So if you want to not have the softdevice-enabled code compiled, undefine that and it won't call the sd_* function which is returning the error.

    Please read the threads about why debugging is not compatible with the softdevice, there's many of them, it's a hard technical limitation of how the processor debug works. You actually can debug before you start advertising, but once the radio is going and bluetooth has timing requirements, then you can't break, well you can break, you can't resume again.

    however see the blog post on Monitor Mode debugging which is available on the nRF52, which does allow you to debug with the softdevice running (by using a different debugging mode not available on the Cortex M0 in the nRF51).

Children
Related