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

NRF_ERROR_BUSY from sd_ble_gattc_primary_services_discover

Hi,

I'm experimenting with incorporating "ATT_MTU Throughput" Example into our project.

I'm using nRF52832 as the peripheral and a SDK52 as the central.

The central succeeds in connecting to the peripheral, successfully discovers the AMT service at the peer, and exchanges physical parameters. Then it gets stuck.

[00000000] <info> app: Preparing the test.
[00000000] <info> app: Starting advertising.
[00000000] <info> app: Starting scan.
[00001037] <info> app: Device "Nordic_ATT_MTU" found, sending a connection request.
[00002266] <info> app: Connected as a central.
[00002268] <info> app: Discovering GATT database...
[00002326] <info> app: ATT MTU exchange completed. MTU set to 247 bytes.
[00003057] <info> app: Data length updated to 251 bytes.
[00002143] <info> app: PHY update accepted. PHY set to 2 Mbps.
[00002209] <info> app: AMT service discovered at peer.

This is as far as it goes without error checking. With error checking, I get an NRF_ERROR_BUSY error originating from sd_ble_gattc_primary_services_discover() during ble_db_discovery_start() during a BLE_GAP_EVT_CONNECTED event.

p_db_discovery->discovery_in_progress is false during the event.

My suspicion is bad configuration on my part. Would appreciate some help.

Thanks

Parents
  • Hi,

    I'm experimenting with incorporating "ATT_MTU Throughput" Example into our project

    So this is not the default ble_app_att_mtu_throughput example. But you are adding this example into another example ?

    Are you running this modified ble_app_att_mtu_throughput for both the central and peripheral?

    From the log, the AMT service is discovered, you should have gotten the event NRF_BLE_AMT_C_EVT_DISCOVERY_COMPLETE, and notification should get enabled with nrf_ble_amtc_notif_enable().

    Snippet:

    static void amtc_evt_handler(nrf_ble_amtc_t * p_amt_c, nrf_ble_amtc_evt_t * p_evt)
    {
        ret_code_t err_code;
    
        switch (p_evt->evt_type)
        {
            case NRF_BLE_AMT_C_EVT_DISCOVERY_COMPLETE:
            {
                NRF_LOG_INFO("AMT service discovered at peer.");
    
                err_code = nrf_ble_amtc_handles_assign(p_amt_c,
                                                       p_evt->conn_handle,
                                                       &p_evt->params.peer_db);
                APP_ERROR_CHECK(err_code);
    
                // Enable notifications.
                err_code = nrf_ble_amtc_notif_enable(p_amt_c);
                APP_ERROR_CHECK(err_code);
            } break;

    What does nrf_ble_amtc_notif_enable() return in your case?

  • I was using the pre-compiled hex file for the DK52 and a modified version for the nRF52832 (since it doesn't have LEDs and buttons).

    It's possible I caused an issue with the flow of the test, since I've now added on the nRF52832 side a timer that re-initiates the service discovery 3 second after a BLE_GAP_EVT_CONNECTED event , and it seems to work fine now.

    I'll close the ticket, thanks for the help.

Reply Children
No Data
Related