Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

BUG: BLE_GAP_EVT_ADV_SET_TERMINATED is never raised

By setting either:

ble_gap_adv_params_t::duration

or 

ble_gap_adv_params_t::max_adv_evts

to a non-zero value should trigger the BLE_GAP_EVT_ADV_SET_TERMINATED event after specified time / events.

This results in a fatal crash on the connectivity board on my serialization project.

The setup is as follows:

  • SDK 15.0.0
  • SoftDevice S132 v6
  • FreeRTOS 10
  • Transport: SPI5W

The goal I am trying to achieve is to have rotating advertisement packets (similar to the Eddystone project).
The approach is as follows:

  • initialize advertising parameters
  • start advertising

    after some time
  • stop advertising
  • replace adv. parameters after a timeout event (based on timer)
  • start advertising

And repeat this process.

Currently; this fails after 4 attempts; since app_ble_gap_adv_set_register uses a maximum of 4 m_adv_sets.

Can you elaborate on this issue?

Kind Regards,

Justin Brederveld 

Parents
  • Dear Justin,

    I found the same problem today (sdk15-serialization-example-crashes), BLE_GAP_EVT_ADV_SET_TERMINATED is missing in ble_event_enc.c

    #ifndef S112
            case BLE_GAP_EVT_ADV_REPORT:
                ret_val = ble_gap_evt_adv_report_enc(p_event, event_len, p_buf, p_buf_len);
                break;
    #endif //!S112
            case BLE_GAP_EVT_SCAN_REQ_REPORT:
                ret_val = ble_gap_evt_scan_req_report_enc(p_event, event_len, p_buf, p_buf_len);
                break;
    				
    		case BLE_GAP_EVT_ADV_SET_TERMINATED:
    			ret_val = ble_gap_evt_adv_set_terminated_enc(p_event, event_len, p_buf, p_buf_len);
    			break;
    			
    			

    And possibly also in your ble_event.c

    #ifndef S112
            case BLE_GAP_EVT_ADV_REPORT:
                ret_val = ble_gap_evt_adv_report_enc(p_event, event_len, p_buf, p_buf_len);
                break;
    #endif //!S112
            case BLE_GAP_EVT_SCAN_REQ_REPORT:
                ret_val = ble_gap_evt_scan_req_report_enc(p_event, event_len, p_buf, p_buf_len);
                break;
    				
    		case BLE_GAP_EVT_ADV_SET_TERMINATED:
    		ret_val = ble_gap_evt_adv_set_terminated_enc(p_event, event_len, p_buf, p_buf_len);
    		break;

    Kind Regards,

    Erwin

Reply
  • Dear Justin,

    I found the same problem today (sdk15-serialization-example-crashes), BLE_GAP_EVT_ADV_SET_TERMINATED is missing in ble_event_enc.c

    #ifndef S112
            case BLE_GAP_EVT_ADV_REPORT:
                ret_val = ble_gap_evt_adv_report_enc(p_event, event_len, p_buf, p_buf_len);
                break;
    #endif //!S112
            case BLE_GAP_EVT_SCAN_REQ_REPORT:
                ret_val = ble_gap_evt_scan_req_report_enc(p_event, event_len, p_buf, p_buf_len);
                break;
    				
    		case BLE_GAP_EVT_ADV_SET_TERMINATED:
    			ret_val = ble_gap_evt_adv_set_terminated_enc(p_event, event_len, p_buf, p_buf_len);
    			break;
    			
    			

    And possibly also in your ble_event.c

    #ifndef S112
            case BLE_GAP_EVT_ADV_REPORT:
                ret_val = ble_gap_evt_adv_report_enc(p_event, event_len, p_buf, p_buf_len);
                break;
    #endif //!S112
            case BLE_GAP_EVT_SCAN_REQ_REPORT:
                ret_val = ble_gap_evt_scan_req_report_enc(p_event, event_len, p_buf, p_buf_len);
                break;
    				
    		case BLE_GAP_EVT_ADV_SET_TERMINATED:
    		ret_val = ble_gap_evt_adv_set_terminated_enc(p_event, event_len, p_buf, p_buf_len);
    		break;

    Kind Regards,

    Erwin

Children
No Data
Related