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

SVCALL resets nRF51

Device: NRF51-DK

I'm using GDB+OpenOCD to step thru code and it appears that the nrf51 resets itself after calling:

SVCALL(SD_BLE_GAP_ADV_START, uint32_t, sd_ble_gap_adv_start(ble_gap_adv_params_t const *p_adv_params));

in file: ble_gap.h

I used nrfjprog to program the soft device and code.

I'm using the example code:

sdk/examples/ble_peripheral/ble_app_uart

Any ideas why ?

thanks,

  • Can you provide the code where you set up the advertisement? The failure to start may be due to bad parameters. Also, the return code will be helpful.

  • I'm using the example code without edits.

    The code resets/crashes here: err_code = sd_ble_gap_adv_start(&adv_params); Which is a soft device call

    if (m_adv_mode_current != BLE_ADV_MODE_IDLE)
    {
    err_code = sd_ble_gap_adv_start(&adv_params); if(err_code != NRF_SUCCESS) {
    return err_code; }
    }

    1. What is the value of err_code?

    2. Can you post your complete advertising_init function?

  • p/x adv_params $2 = {type = 0x0, p_peer_addr = 0x0, fp = 0x0, p_whitelist = 0x0, interval = 0x40, timeout = 0xb4, channel_mask = {ch_37_off = 0x0, ch_38_off = 0x0, ch_39_off = 0x0}}

  • The function does not return, so there is no return value.

1 2 3