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

Program hangs in sd_softdevice_enable

Hello,

I'm trying to start softdevice on a custom board with nRF51822 chip and S110 device. The code hangs in SOFTDEVICE_HANDLER_INIT. It seems that EVENTS_LFCLKSTARTED is never set.

Here's the used part of the code:

// Start 32 MHz crystal oscillator NRF_CLOCK->XTALFREQ = 0; NRF_CLOCK->EVENTS_HFCLKSTARTED = 0; NRF_CLOCK->TASKS_HFCLKSTART = 1; // Wait for the external oscillator to start up while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0) {} SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_RC_250_PPM_4000MS_CALIBRATION, false);

The problem is there also without debugger. What could be wrong?

Best regards, Cyril.

Parents
  • This sounds very strange. Normally, there shouldn't be any problems like this when using the RC oscillator. Have you checked to see if sd_ble_softdevice_enable() returns any error code? That's easiest done by following the procedure described here, regarding app_error_handler(). Also, if you run your project with a debugger, let it run freely from reset, and then halt it after some time, where does it hang (on which address?)? Could you perhaps get a screenshot of this situation?

    Have you had your schematics and layout reviewed? If not, I suggest that you create a regular support case, making sure to upload schematics and Gerber (or Altium) files so that we can verify that the hardware is ok.

Reply
  • This sounds very strange. Normally, there shouldn't be any problems like this when using the RC oscillator. Have you checked to see if sd_ble_softdevice_enable() returns any error code? That's easiest done by following the procedure described here, regarding app_error_handler(). Also, if you run your project with a debugger, let it run freely from reset, and then halt it after some time, where does it hang (on which address?)? Could you perhaps get a screenshot of this situation?

    Have you had your schematics and layout reviewed? If not, I suggest that you create a regular support case, making sure to upload schematics and Gerber (or Altium) files so that we can verify that the hardware is ok.

Children
No Data
Related