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
  • Hello,

    I'm not sure if the Ezairo 7150SL module has a external LF crystal like the DK does. If not you need to change to the internal RC oscillator:

    nrf_clock_lf_cfg_t clock_lf_cfg =  { .source = NRF_CLOCK_LF_SRC_RC,
                                         .rc_ctiv = 4, // Check temperature every 4 * 250ms
                                         .rc_temp_ctiv = 1, // Only calibrate if temperature has changed.
                                       };
    
    // Initialize the SoftDevice handler module.	
    SOFTDEVICE_HANDLER_INIT(&clock_lf_cfg, NULL);
    

    EDIT- how to find source of assert

    First you should turn off compiler optimization to get the expected results during debugging. Also add 'DEBUG' so the program enters the app_error_save_and_stop() function on assert.

    image description

    Then you can read the error info from the call stack when it has reached the endless while loop. In this case it was '1', which corresponds with NRF_ERROR_SVC_HANDLER_MISSING, see nrf51_error.h. ( download image for larger view)

    image description

  • sorry for my ignorance, but how do I do that? do I add that variable to the watch list? because it appear the information "cannot evaluate". I'm using the debug from Keil to try and debug this errors.

Reply Children
No Data
Related