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

stuck in softdevice_handler_init

Hello,

I was working on a nRF51422 and made a project using the example ble_app_uart_c. It works fine on the DK, but now I want to make it work on a board that has one nRF51822. I can program it, but when it runs it get stuck on the function SOFTDEVICE_HANDLER_INIT(&clock_lf_cfg, NULL); that is inside ble_stack_init().

Can anyone help me to debug it, or have any idea why it is stuck on that function?

Using SD130 v2, SDK11 and nRF51822.

Thanks, Jorge

EDIT1: Saw in on post of old SDK that the problem could be because I was initializing the UART before the BLE. Changed the order of the initialization but still gets stuck on the same function.

EDIT2: I got this on the call stack. I'm still stuck on there, the program doesn't get out from the SOFTDEVICE_HANDLER_INIT funtion. but now is not giving me the error that gave before...

Debug image

EDIT3: This are the two images I get, before and after the stop

before

before_stop

and after

after_stop

Parents
  • The 32 MHz crystal needs to be divided by two to get the require 16 MHz source. Do do that you can either set NRF_CLOCK->XTALFREQ = 32MHZ ( nrf51 RM - chpt 13) on startup. Alternatively, set UICR.XTALFREQ which sets the reset value.

  • A new question would probably have made the thread more clear. In any case, the low power LF clock and HF clock are two separate clock sources, and both required to run any BLE example.

    It's only possible to configure the LF source in softdevice_handler_init(), and the internal RC oscillator is recommended if there is no LF crystal connected.

    The softdevice will be stuck in an endless loop (softdevice_handler_init) waiting for the ext. LF crystal to start if selected but not present.

    What's the error code returned from softdevice_enable()?

Reply
  • A new question would probably have made the thread more clear. In any case, the low power LF clock and HF clock are two separate clock sources, and both required to run any BLE example.

    It's only possible to configure the LF source in softdevice_handler_init(), and the internal RC oscillator is recommended if there is no LF crystal connected.

    The softdevice will be stuck in an endless loop (softdevice_handler_init) waiting for the ext. LF crystal to start if selected but not present.

    What's the error code returned from softdevice_enable()?

Children
No Data
Related