This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

SDK12 - sd_ble_gap_connect returns NRF_ERROR_INVALID_PARAM when using whitelist

Dear developers,

We had a working application with SDK11 SD2.0.1 that we have migrated to SDK12 SD3.0.0. With SDK11 we could successfully bond to multiple peripherals and one central at the same time using a whitelist. However after migrating to SDK12 when we are scanning with a whitelist we always get NRF_ERROR_INVALID_PARAM when calling sd_ble_gap_connect when BLE_GAP_EVT_ADV_REPORT occurs.

I finally found that this is not only occurring in our application, but it is also the case for the RSCS central example if it is set to use the whitelist. This can be reproduced by connecting one RSCS peripheral example with the RSCS central example and then start the RSCS central using a whitelist. Enable logging with loglevel = 4 and set

static ble_scan_mode_t       m_scan_mode = BLE_WHITELIST_SCAN;              /**< Scan mode used by application. */

...

                   // Initiate connection.
                    #if (NRF_SD_BLE_API_VERSION == 2)
                        m_scan_param.selective = 0;
                    #endif
                    err_code = sd_ble_gap_connect(&p_gap_evt->params.adv_report.peer_addr,
                                                  &m_scan_param,
                                                  &m_connection_param);

                    m_whitelist_temporarily_disabled = false;

                    if (err_code != NRF_SUCCESS)
                    {
                        NRF_LOG_DEBUG("Connection Request Failed, reason %d\r\n", err_code);
                    }
                    break;

Output:

APP:INFO:Running Speed collector example
SDH:INFO:sd_ble_enable: RAM START at 0x20001fe8
APP:DEBUG:Starting scan white.
APP:DEBUG:Connection Request Failed, reason 7

I understand the example says it does not support pairing/bonding, however we need this to work, otherwise we need to rollback to SDK11 and SD2.0.1. What needs to be modified in the example to get this to work?

Best Regards, Erik

  • Are you using the Peer Manager? Are you setting the whitelist with sd_ble_gap_whitelist_set()?

  • @petter Yes I am using the Peer manager. Actually I am doing exactly the same as your RSCS example. An I have read the migration document for the SD as well. I am using pm_whitelist_set() which uses im_whitelist_set that in turn calls sd_ble_gap_whitelist_set. BR Erik

  • This was a bug that was fixed in the 12.2.0 release; the ble_gap_scan_params_t strucutre for s132 v.3.0.0 has a new member called "use_whitelist" which needs to be cleared before calling sd_ble_gap_connect().

                #if (NRF_SD_BLE_API_VERSION == 2)
                    m_scan_param.selective = 0;
                #endif
                #if (NRF_SD_BLE_API_VERSION == 3)
                    m_scan_param.use_whitelist = 0;
                #endif
    
Related