<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Error when loading whitelist on a central + peripheral when connected peripheral shutdowns</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/76045/error-when-loading-whitelist-on-a-central-peripheral-when-connected-peripheral-shutdowns</link><description>Hello, I have a 52832 using SDK16.0.0, that acts as an advertising peripheral (anyone can connect to it), and as a central, connected with 1-1 bond to a peripheral (a 52811). I have implemented this 1-1 bond using whitelist and peer_managers on both sides</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 28 Jun 2021 08:07:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/76045/error-when-loading-whitelist-on-a-central-peripheral-when-connected-peripheral-shutdowns" /><item><title>RE: Error when loading whitelist on a central + peripheral when connected peripheral shutdowns</title><link>https://devzone.nordicsemi.com/thread/317398?ContentTypeID=1</link><pubDate>Mon, 28 Jun 2021 08:07:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16e7a927-4bee-46a9-af97-1601c3ad3c32</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Quentin,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So when you advertise as &amp;quot;connectable advertising&amp;quot;, other central device can send a connect request and establish a new connection.&amp;nbsp;&lt;br /&gt;When you advertise as &amp;quot;non-connectable advertising&amp;quot; , your device is non-connectable, meaning other central won&amp;#39;t send you a connect request and won&amp;#39;t establish a new connection.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;From my understanding, in your case, at the beginning you advertise as connectable and you has a connection as a peripheral to another central, correct ?&amp;nbsp;&lt;br /&gt;At the same time you scan to connect to other peripheral and you also advertise (without the need of establishing a new connection). Is it correct ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If it&amp;#39;s the case, you would need to do non-connectable advertising. The ble_advertising actually doesn&amp;#39;t support this. So you would need to call&amp;nbsp;sd_ble_gap_adv_set_configure(), sd_ble_gap_adv_start() directly.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;You can have a look at this example from Awneil:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/47391/sdk-15-3-0-restart-non-connectable-advertising-after-timeout/187695#187695"&gt;devzone.nordicsemi.com/.../187695&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error when loading whitelist on a central + peripheral when connected peripheral shutdowns</title><link>https://devzone.nordicsemi.com/thread/317279?ContentTypeID=1</link><pubDate>Fri, 25 Jun 2021 14:54:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8c609ee3-db59-437e-b932-a6354cb78d66</guid><dc:creator>QuentinFarizon</dc:creator><description>&lt;p&gt;I really want only one peripheral to be connected.&lt;br /&gt;&lt;br /&gt;I&amp;#39;m not fluent in &amp;quot;connectable advertising&amp;quot; and &amp;quot;non connectable advertising&amp;quot;, sorry, not sure what you mean.&lt;br /&gt;&lt;br /&gt;I guess I should check on_whitelist_req if i&amp;#39;m already connected and not advertise in this case, but I don&amp;#39;t think there is a function for that.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error when loading whitelist on a central + peripheral when connected peripheral shutdowns</title><link>https://devzone.nordicsemi.com/thread/317278?ContentTypeID=1</link><pubDate>Fri, 25 Jun 2021 14:39:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a9fb3b56-4ee7-40d0-8749-449218e1ed48</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Quentin,&amp;nbsp;&lt;br /&gt;I assume you advertise as &amp;quot;connectable advertising&amp;quot; when you are in a connection as a peripheral ?&amp;nbsp;&lt;br /&gt;If it&amp;#39;s the case the softdevice would need to expect that there will be another connection&amp;nbsp;will be made. And you need to configure&amp;nbsp;&lt;span&gt;NRF_SDH_BLE_PERIPHERAL_LINK_COUNT&amp;nbsp; = 2&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;br /&gt;Is there any reason you need to advertise as connectable ? If you plan to have a new connection and you plan to only have one connection (as a peripheral) at a time, you may want to disconnect before advertise.&amp;nbsp;&lt;br /&gt;Otherwise please advertise as non-connectable.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error when loading whitelist on a central + peripheral when connected peripheral shutdowns</title><link>https://devzone.nordicsemi.com/thread/317270?ContentTypeID=1</link><pubDate>Fri, 25 Jun 2021 14:13:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:933d0946-8ae9-40ab-ac04-6c5c7cbd969a</guid><dc:creator>QuentinFarizon</dc:creator><description>&lt;p&gt;Sorry, I&amp;#39;m reading again your answers, and I made a mistake on one of my answers :&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;Is there any chance that the device is already in a connection as a peripheral when you starts advertising again&amp;nbsp; ?&lt;br /&gt;&lt;/span&gt;N̶o̶&amp;nbsp; Yes ! A phone is connected to it while I get the error.&lt;br /&gt;&lt;br /&gt;So I guess atht is my issue : I can&amp;#39;t advertise again when already connected as a peripheral (with a &lt;span&gt;NRF_SDH_BLE_PERIPHERAL_LINK_COUNT = 1).&lt;br /&gt;&lt;br /&gt;What do you recommend ? Still try advertising, and just catch the NRF_ERROR_CONN_COUNT silently ?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Quentin&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error when loading whitelist on a central + peripheral when connected peripheral shutdowns</title><link>https://devzone.nordicsemi.com/thread/316984?ContentTypeID=1</link><pubDate>Thu, 24 Jun 2021 12:28:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b6325a8d-83b7-4f8c-bd7a-d5d90713e735</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Quentin,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Could you&amp;nbsp;step in the code and check if the&amp;nbsp;&lt;span&gt;NRF_ERROR_CONN_COUNT&amp;nbsp;&amp;nbsp;is returned by&lt;/span&gt;&amp;nbsp;&lt;span&gt;sd_ble_gap_adv_start() when calling&amp;nbsp;ble_advertising_start() ?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If it&amp;#39;s returned by&amp;nbsp;sd_ble_gap_adv_start() you can&amp;#39;t really step any further as it&amp;#39;s a softdevice SVC call.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If you can modify our example to reproduce the issue then I can check here. Or please provide the simplified version of your application that we can run on a DK here. &lt;br /&gt;Without that it&amp;#39;s very hard to know what could be wrong.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error when loading whitelist on a central + peripheral when connected peripheral shutdowns</title><link>https://devzone.nordicsemi.com/thread/316943?ContentTypeID=1</link><pubDate>Thu, 24 Jun 2021 10:31:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e11091e5-0429-4595-acce-d1d09e438dc0</guid><dc:creator>QuentinFarizon</dc:creator><description>&lt;p&gt;I&amp;#39;ve tried with the same advertising_init than yours, the same on_whitelist_req, all my code pertaining to advertising/scanning is identical to yours, yet I still have the issue on my project, and not on yours.&lt;br /&gt;&lt;br /&gt;Here is the scenario for this issue :&lt;br /&gt;- peripheral advertises&lt;br /&gt;- central advertises&lt;br /&gt;- central starts scanning peripheral, a whitelist request is sent, we stop advertising, set the whitelist, start advertising again&lt;br /&gt;Expected =&amp;gt; no error, central bonds to peripheral and advertises correctly&lt;br /&gt;Error =&amp;gt; NRF_ERROR_COUNT when starting advertising after setting whitelist.&lt;br /&gt;&lt;br /&gt;If I just ignore the&amp;nbsp;&lt;span&gt;NRF_ERROR_COUNT&amp;nbsp;&lt;/span&gt;error, it works fine, bonds, and advertises correctly ! I&amp;#39;d still want to understand why I get this error.&lt;br /&gt;&lt;br /&gt;What am I missing ? Some configuration ?&lt;br /&gt;&lt;br /&gt;Where in NRF components can I debug where this NRF_ERRROR_COUNT is generated ? I don&amp;#39;t see where it is thrown.&lt;br /&gt;&lt;br /&gt;Thanks !&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error when loading whitelist on a central + peripheral when connected peripheral shutdowns</title><link>https://devzone.nordicsemi.com/thread/316916?ContentTypeID=1</link><pubDate>Thu, 24 Jun 2021 09:27:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c15126d-fe1f-4c56-bea0-21e969450a21</guid><dc:creator>QuentinFarizon</dc:creator><description>&lt;p&gt;Thank you for taking the time to provide this example !&lt;br /&gt;&lt;br /&gt;In your on_whitelist_req method,you do :&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    if (((addr_cnt == 0) &amp;amp;&amp;amp; (irk_cnt == 0)) ||
        (m_whitelist_disabled))
    {
        // Don&amp;#39;t use whitelist.
        err_code = nrf_ble_scan_params_set(&amp;amp;m_scan, NULL);
        APP_ERROR_CHECK(err_code);
    }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This disables the whitelist when no peer is bonded.&lt;br /&gt;&lt;br /&gt;But when a new peer is bonded (addr_cnt != 0), shouldn&amp;#39;t you do the opposite and make the scan use the the whitelist ?&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error when loading whitelist on a central + peripheral when connected peripheral shutdowns</title><link>https://devzone.nordicsemi.com/thread/315637?ContentTypeID=1</link><pubDate>Wed, 16 Jun 2021 13:24:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9352b672-ad87-446d-b6cb-37314b76f982</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Quentin,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Attached you can find the ble_app_hrs_c example that advertises.&amp;nbsp;&lt;br /&gt;In the example&amp;nbsp;the nRF52 will advertise, then start scanning. Doing that I did receive error&amp;nbsp;&lt;span&gt;12804&amp;nbsp; when adding whitelist as expected.&amp;nbsp;&lt;br /&gt;So I added the code to stop and start advertising again in&amp;nbsp;NRF_BLE_SCAN_EVT_WHITELIST_REQUEST event handler&amp;nbsp; as you posted.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt; However I didn&amp;#39;t have any error when doing that regardless if it&amp;#39;s the first time running or not, also regardless if it has any bond before.&amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Please try to test if you get any error. If it&amp;#39;s not exactly what you are doing in your application, please modify the example attached so that it can reproduce the issue you are seeing.&amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ble_5F00_app_5F00_hrs_5F00_c_5F00_advertise.zip"&gt;devzone.nordicsemi.com/.../ble_5F00_app_5F00_hrs_5F00_c_5F00_advertise.zip&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;SDK v16.0&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error when loading whitelist on a central + peripheral when connected peripheral shutdowns</title><link>https://devzone.nordicsemi.com/thread/315338?ContentTypeID=1</link><pubDate>Tue, 15 Jun 2021 09:56:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:239a1d4b-0984-4afd-996b-2939bfbff9c4</guid><dc:creator>QuentinFarizon</dc:creator><description>&lt;p&gt;I have provided all the code pertaining to advertising/scan&lt;br /&gt;&lt;br /&gt;You will be able to reproduce easily by making the HRS_C example advertise.&lt;br /&gt;&lt;br /&gt;I think this should be part of the standard examples, given how complicated this is to make it work and the number of related issues on this forum.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error when loading whitelist on a central + peripheral when connected peripheral shutdowns</title><link>https://devzone.nordicsemi.com/thread/315322?ContentTypeID=1</link><pubDate>Tue, 15 Jun 2021 08:58:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb513e55-df2c-4f28-82b4-818e85a4fcbe</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Quentin,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It&amp;#39;s quite strange that even with&amp;nbsp;&lt;span&gt;NRF_ERROR_CONN_COUNT&amp;nbsp; error the advertising still resume. Please try to debug and check if you only call&amp;nbsp;sd_ble_gap_adv_stop() without calling&amp;nbsp;ble_advertising_start() do you see the advertising stopped.&amp;nbsp;&lt;br /&gt;And then check again with&amp;nbsp;ble_advertising_start(). I don&amp;#39;t think the softdevice would do advertising if&amp;nbsp;sd_ble_gap_adv_start() return&amp;nbsp;NRF_ERROR_CONN_COUNT.&lt;br /&gt;Again, if possible please provide us the code so we can test here.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error when loading whitelist on a central + peripheral when connected peripheral shutdowns</title><link>https://devzone.nordicsemi.com/thread/315208?ContentTypeID=1</link><pubDate>Mon, 14 Jun 2021 15:22:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d2e9f556-8365-4cfb-a088-5b28c5a64978</guid><dc:creator>QuentinFarizon</dc:creator><description>&lt;p&gt;&amp;gt;&amp;nbsp;&lt;span&gt;Is there any chance that the device is already in a connection as a peripheral when you starts advertising again&amp;nbsp; ?&lt;br /&gt;&lt;/span&gt;No&lt;br /&gt;&lt;br /&gt;&amp;gt;&amp;nbsp;&lt;span&gt;You mentioned that if you ignore the error when calling&amp;nbsp;&lt;/span&gt;&lt;span&gt;ble_advertising_start&amp;nbsp;() it works fine, but would it advertise ? Or you need to call&amp;nbsp;ble_advertising_start&amp;nbsp;() again to make it work ?&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;As I mentionned, I only get the error the first time, before bonding the peripheral. I do not need to advertise again, it advertises correctly (exactly as if the advertising stopping did not work).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error when loading whitelist on a central + peripheral when connected peripheral shutdowns</title><link>https://devzone.nordicsemi.com/thread/315204?ContentTypeID=1</link><pubDate>Mon, 14 Jun 2021 15:15:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f7cbd5eb-1794-4cb4-98cb-d7cbc6cffbac</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hei Quentin,&amp;nbsp;&lt;br /&gt;Is there any chance that the device is already in a connection as a peripheral when you starts advertising again&amp;nbsp; ?&lt;br /&gt;&amp;nbsp;You mentioned that if you ignore the error when calling&amp;nbsp;&lt;span&gt;ble_advertising_start&amp;nbsp;() it works fine, but would it advertise ? Or you need to call&amp;nbsp;ble_advertising_start&amp;nbsp;() again to make it work ?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error when loading whitelist on a central + peripheral when connected peripheral shutdowns</title><link>https://devzone.nordicsemi.com/thread/315177?ContentTypeID=1</link><pubDate>Mon, 14 Jun 2021 14:29:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb4bad80-7de6-4017-8628-daf20943e7ff</guid><dc:creator>QuentinFarizon</dc:creator><description>&lt;p&gt;My config is very simple :&lt;br /&gt;#define NRF_SDH_BLE_PERIPHERAL_LINK_COUNT 1&lt;br /&gt;#define NRF_SDH_BLE_CENTRAL_LINK_COUNT 1&lt;br /&gt;#define NRF_SDH_BLE_TOTAL_LINK_COUNT 2&lt;br /&gt;&lt;br /&gt;So here the error would occur if I&amp;#39;m trying to advertise two times ? But that is not the case, as I&amp;#39;m stopping advertising as you can see.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error when loading whitelist on a central + peripheral when connected peripheral shutdowns</title><link>https://devzone.nordicsemi.com/thread/315054?ContentTypeID=1</link><pubDate>Mon, 14 Jun 2021 09:15:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0f7a2141-ade0-4d5f-a9fd-d2c83fe4b4b7</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Quentin,&amp;nbsp;&lt;br /&gt;You have&amp;nbsp;&lt;span&gt;NRF_ERROR_CONN_COUNT&amp;nbsp; when you haven&amp;#39;t setup the correct link count in sdk_config.h.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;You have a potential of having up to 2 connections&amp;nbsp; (one as a peripheral and one as a central). So you need to configure that in sdk_config.h. Please check the following configuration:&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-&amp;nbsp;NRF_SDH_BLE_PERIPHERAL_LINK_COUNT&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-&amp;nbsp;NRF_SDH_BLE_CENTRAL_LINK_COUNT&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;- NRF_SDH_BLE_TOTAL_LINK_COUNT (this is the max concurrent connections)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error when loading whitelist on a central + peripheral when connected peripheral shutdowns</title><link>https://devzone.nordicsemi.com/thread/314961?ContentTypeID=1</link><pubDate>Fri, 11 Jun 2021 15:17:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2eaca923-77e2-4f00-99e8-4cd686b0c186</guid><dc:creator>QuentinFarizon</dc:creator><description>&lt;p&gt;Well, I retried, and in fact it&amp;#39;s not the same error.&lt;br /&gt;&lt;br /&gt;The first time&amp;nbsp;NRF_BLE_SCAN_EVT_WHITELIST_REQUEST is called,&amp;nbsp;ble_advertising_start throws with&amp;nbsp;NRF_ERROR_CONN_COUNT, as if it didn&amp;#39;t succeed stopping advertising (even though&amp;nbsp;sd_ble_gap_adv_stop did not throw, checked by APP_ERROR_CHECK).&lt;br /&gt;&lt;br /&gt;If I ignore errors on&amp;nbsp;ble_advertising_start (like the avove snippet) everythong works fine ! When the peripheral shutdowns, central starts scanning with whitelist, and advertises correctly.&lt;br /&gt;&lt;br /&gt;Do you know why I get the&amp;nbsp;&lt;span&gt;NRF_ERROR_CONN_COUNT the first time ?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error when loading whitelist on a central + peripheral when connected peripheral shutdowns</title><link>https://devzone.nordicsemi.com/thread/314863?ContentTypeID=1</link><pubDate>Fri, 11 Jun 2021 09:09:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4f726200-efbc-4469-99a7-8df6e34c333a</guid><dc:creator>QuentinFarizon</dc:creator><description>&lt;p&gt;&amp;gt;&amp;nbsp;&lt;span&gt;My suggestion is to test scanning with whitelist without advertising just to check if you see the same error.&amp;nbsp;&lt;br /&gt;&lt;/span&gt;I did try, by calling :&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;
case NRF_BLE_SCAN_EVT_WHITELIST_REQUEST:
    {
        NRF_LOG_INFO(&amp;quot;Whitelist request&amp;quot;);
        sd_ble_gap_adv_stop(m_advertising.adv_handle);
        on_whitelist_req();
        ble_advertising_start(&amp;amp;m_advertising, BLE_ADV_MODE_FAST);
    } break;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Same error.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error when loading whitelist on a central + peripheral when connected peripheral shutdowns</title><link>https://devzone.nordicsemi.com/thread/314382?ContentTypeID=1</link><pubDate>Wed, 09 Jun 2021 08:30:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:79c74d62-13e3-4ce2-8cc8-51572a2df838</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Quentin,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The key difference between the hrs_c and your application is that you do advertising and scanning at the same time.&amp;nbsp;&lt;br /&gt;When advertising there can be a whitelist used and when scanning whitelisting can also be used for scanning.&amp;nbsp;&lt;br /&gt;Only one whitelist can be used in the hardware, we don&amp;#39;t have 2 different whitelist system for advertising and scanning.&lt;/p&gt;
&lt;p&gt;It could be the reason why you receive&amp;nbsp;&lt;span&gt;BLE_ERROR_GAP_DEVICE_IDENTITIES_IN_USE when you start scanning ,it&amp;#39;s because&amp;nbsp;your advertising may already use a whitelist (?). You can find in both of the cases that I pointed to , the application does advertising + scanning at the same time.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;It&amp;#39;s hard for us to give you definite answer without knowing your application. We don&amp;#39;t get a full picture from your code snippets.&amp;nbsp; My suggestion is to test scanning with whitelist without advertising just to check if you see the same error.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;A good&amp;nbsp;way to narrow down the issue is to get your application as close as possible to a working example. You then can trace back on which feature that you disable may cause the issue.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error when loading whitelist on a central + peripheral when connected peripheral shutdowns</title><link>https://devzone.nordicsemi.com/thread/314274?ContentTypeID=1</link><pubDate>Tue, 08 Jun 2021 16:20:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:79aae2cc-af2b-47e6-8950-09a09a3fad15</guid><dc:creator>QuentinFarizon</dc:creator><description>&lt;p&gt;I had already read these issues and tried some of those solutions (like stopping advertising before on_whitelist_request), without success.&lt;br /&gt;Besides, if I&amp;#39;m not wrong, hrs_c calls&amp;nbsp;sd_ble_gap_device_identities_set without stopping advertising nor scanning.&lt;br /&gt;&lt;br /&gt;This is not clear to me what is the expected behaviour of the framework. Could you get some more definitive answers on what is working and what is not ?&lt;br /&gt;&lt;br /&gt;Why is the advertising in conflict with this whitelist at all ?&lt;br /&gt;&lt;br /&gt;&amp;gt;&amp;nbsp;&lt;span&gt;So if you already doing advertising (or scanning) you would need to stop that before you start scanning (or advertising)&lt;/span&gt;&lt;br /&gt;Sorry, this is really not clear&lt;br /&gt;&lt;br /&gt;&amp;gt;&amp;nbsp;&lt;em&gt;start advertising first before you start scanning&lt;/em&gt;&lt;br /&gt;This is not the case when I restart both peripheral and central, and it works fine. And it&amp;#39;s not the case of HRS_C&lt;br /&gt;&lt;br /&gt;&amp;gt;&amp;nbsp;&lt;em&gt;Or stop scanning, start advertising and start scanning again&lt;/em&gt;&lt;br /&gt;You mean stop advertising, then stop scanning, then start advertising, then start scanning again ?&lt;br /&gt;It looks very complicated&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error when loading whitelist on a central + peripheral when connected peripheral shutdowns</title><link>https://devzone.nordicsemi.com/thread/314270?ContentTypeID=1</link><pubDate>Tue, 08 Jun 2021 15:58:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f64039b-351d-4c0f-a247-7d45741e1ad5</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi again Quentin,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;- You can switch between.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;- &amp;quot;extended&amp;quot; mode is only for extended advertising (Bluetooth 5.0 feature where you can advertise longer, or advertise only the header and the content will be transmitted in data channel. If you don&amp;#39;t use extended advertising, you don&amp;#39;t need to turn this on)&lt;/p&gt;
&lt;p&gt;- I did a quick search and found some cases:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/32674/simultaneous-central-peripheral-with-whitelist-only-used-in-one-role"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/32674/simultaneous-central-peripheral-with-whitelist-only-used-in-one-role&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/46268/error-12804-multipheripheral-bonding-whitelist/182613#182613"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/46268/error-12804-multipheripheral-bonding-whitelist/182613#182613&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So if you already doing advertising (or scanning) you would need to stop that before you start scanning (or advertising). Here a quote from my answer in the other case:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Sorry for the late response. I got the information from our staff. Quoted here:&amp;nbsp;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;You can not call sd_ble_gap_device_identities_set if the scanner is running.&amp;nbsp;Even though you set use_whitelist=0 when stating the scanner, it will still use the identity list to resolve addresses.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;nbsp;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;It seems that you would need to do the trick to start advertising first before you start scanning. Or stop scanning, start advertising and start scanning again.&amp;nbsp;In my opinion,&amp;nbsp; scanning with whitelist = 0 shouldn&amp;#39;t use identity list.&amp;nbsp;&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error when loading whitelist on a central + peripheral when connected peripheral shutdowns</title><link>https://devzone.nordicsemi.com/thread/314263?ContentTypeID=1</link><pubDate>Tue, 08 Jun 2021 15:14:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:11482b55-c9d8-4bf6-8cf6-57bce20da126</guid><dc:creator>QuentinFarizon</dc:creator><description>&lt;p&gt;I have already debugged and logged in hrs/hrs_c, whitelist_load is called at the same time as mine.&lt;br /&gt;Unfortunately I won&amp;#39;t be able to provide my project...&lt;br /&gt;&lt;br /&gt;Could you check at least these questions ?&lt;br /&gt;- Should I always be in&amp;nbsp;BLE_GAP_SCAN_FP_WHITELIST or should I switch between&amp;nbsp;BLE_GAP_SCAN_FP_WHITELIST and&amp;nbsp;BLE_GAP_SCAN_FP_ACCEPT_ALL ?&lt;br /&gt;- Should my scan parameters be in &amp;quot;extended&amp;quot; mode ?&lt;br /&gt;- What are the possible suspects that could be calling&amp;nbsp;&lt;span&gt;pm_device_identities_list_set without my knowledge ? The advertising ?&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error when loading whitelist on a central + peripheral when connected peripheral shutdowns</title><link>https://devzone.nordicsemi.com/thread/314258?ContentTypeID=1</link><pubDate>Tue, 08 Jun 2021 14:54:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2b01e1e-4ce6-447e-99c0-4a69ec8c0486</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;I&amp;#39;m not sure what could be wrong, if you can reproduce the issue with a minimum example so we can reproduce here it would be nice.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You mentioned that it works fine with the hrs_c and hrs. Have you tried to compare and try to match we have in hrs_c with your application, just so we can trace back what cause the issue ?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error when loading whitelist on a central + peripheral when connected peripheral shutdowns</title><link>https://devzone.nordicsemi.com/thread/314243?ContentTypeID=1</link><pubDate>Tue, 08 Jun 2021 13:54:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2aa27f98-239a-4eac-aad2-5219d61d5e96</guid><dc:creator>QuentinFarizon</dc:creator><description>&lt;p&gt;&amp;gt;&amp;nbsp;&lt;span&gt;Please double check if you use&amp;nbsp;filter_policy BLE_GAP_SCAN_FP_WHITELIST in the ble_gap_scan_params_t when you call&amp;nbsp;nrf_ble_scan_params_set()&lt;br /&gt;&lt;/span&gt;As you can see above, I am setting&amp;nbsp;&lt;span&gt;BLE_GAP_SCAN_FP_WHITELIST only if a peer is present. Is it not the correct thing to do ?&lt;br /&gt;&lt;br /&gt;&amp;gt;&amp;nbsp;check if&amp;nbsp;pm_device_identities_list_set() was called twice&lt;br /&gt;I have done that, and added logs, it is not called twice.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error when loading whitelist on a central + peripheral when connected peripheral shutdowns</title><link>https://devzone.nordicsemi.com/thread/314240?ContentTypeID=1</link><pubDate>Tue, 08 Jun 2021 13:48:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1dfa9305-8fc0-47f3-80c3-29c4d2c788c7</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Please double check if you use&amp;nbsp;filter_policy BLE_GAP_SCAN_FP_WHITELIST in the ble_gap_scan_params_t when you call&amp;nbsp;nrf_ble_scan_params_set()&lt;/p&gt;
&lt;p&gt;I would suggest to step into the code and check if&amp;nbsp;&lt;span&gt;pm_device_identities_list_set() was called twice ?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I don&amp;#39;t think using filter with whitelist would cause any problem.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error when loading whitelist on a central + peripheral when connected peripheral shutdowns</title><link>https://devzone.nordicsemi.com/thread/314156?ContentTypeID=1</link><pubDate>Tue, 08 Jun 2021 09:56:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fadb87a0-7a08-4419-89d9-a3b16cb53390</guid><dc:creator>QuentinFarizon</dc:creator><description>&lt;p&gt;Sorry, also the scan initialization :&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;
static void scan_init(void)
{
    ret_code_t err_code;
    nrf_ble_scan_init_t init_scan;

    memset(&amp;amp;init_scan, 0, sizeof(init_scan));

    init_scan.p_scan_param     = &amp;amp;m_scan_param;
    init_scan.connect_if_match = true;
    init_scan.conn_cfg_tag     = APP_BLE_CONN_CFG_TAG;

    err_code = nrf_ble_scan_init(&amp;amp;m_scan, &amp;amp;init_scan, scan_evt_handler);
    APP_ERROR_CHECK(err_code);

    err_code = nrf_ble_scan_filter_set(&amp;amp;m_scan,
                                       SCAN_NAME_FILTER,
                                       &amp;quot;Bala&amp;quot;);
    APP_ERROR_CHECK(err_code);

    err_code = nrf_ble_scan_filters_enable(&amp;amp;m_scan,
                                           NRF_BLE_SCAN_NAME_FILTER,
                                           true);
    APP_ERROR_CHECK(err_code);
}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I wish to scan initially all devices with name &amp;quot;Bala&amp;quot;, connect when found one, pair to it, add it to whitelist, and from then only scanning this one.&lt;br /&gt;&lt;br /&gt;Maybe I should unset filters when scanning with whitelist ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error when loading whitelist on a central + peripheral when connected peripheral shutdowns</title><link>https://devzone.nordicsemi.com/thread/314145?ContentTypeID=1</link><pubDate>Tue, 08 Jun 2021 09:40:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:95f63b5d-ffe4-4ce7-9cc1-669bbb8c7694</guid><dc:creator>QuentinFarizon</dc:creator><description>&lt;p&gt;I have also taken inspiration in example rscs_c, where you can find :&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;m_scan_param.filter_policy = BLE_GAP_SCAN_FP_WHITELIST;
err_code = nrf_ble_scan_params_set(&amp;amp;m_scan, &amp;amp;m_scan_param);&lt;/pre&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;Here is additional code from my project :&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;
/**&amp;lt; Scan parameters requested for scanning and connection. */
static ble_gap_scan_params_t m_scan_param =
{
    .active        = 0x01,
    .interval      = NRF_BLE_SCAN_SCAN_INTERVAL,
    .window        = NRF_BLE_SCAN_SCAN_WINDOW,
    .filter_policy  = BLE_GAP_SCAN_FP_WHITELIST,
    .timeout       = SCAN_DURATION,
    .scan_phys     = BLE_GAP_PHY_1MBPS
    //.extended      = 1 // should it be set ? 
};

static void scan_start(void)
{
    ret_code_t err_code;

    // If there is any pending write to flash, defer scanning until it completes.
    if (nrf_fstorage_is_busy(NULL))
    {
        m_memory_access_in_progress = true;
        return;
    }

    scale_scan_blink_start();

    m_scan_param.filter_policy = BLE_GAP_SCAN_FP_WHITELIST;

    err_code = nrf_ble_scan_params_set(&amp;amp;m_scan, &amp;amp;m_scan_param);
    APP_ERROR_CHECK(err_code);

    err_code = nrf_ble_scan_start(&amp;amp;m_scan);
    APP_ERROR_CHECK(err_code);
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>