<?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>Bluetooth master-slave start scan failed</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/97431/bluetooth-master-slave-start-scan-failed</link><description>I have written a master-slave program based on NCS 2.2.0 and use nRF52840 board. 
 Firstly, I turned on two broadcast frames and set the scan timeout to 0. This successfully enabled scanning. Here is my configuration. 
 
 But when I set the scan timeout</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 13 Mar 2023 13:37:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/97431/bluetooth-master-slave-start-scan-failed" /><item><title>RE: Bluetooth master-slave start scan failed</title><link>https://devzone.nordicsemi.com/thread/414933?ContentTypeID=1</link><pubDate>Mon, 13 Mar 2023 13:37:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b8e91aec-c08e-43b1-9d57-1b85884ae5ab</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Andreas is out of office, so I will look into this ticket.&lt;/p&gt;
&lt;p&gt;Is this something that I would be able to reproduce on the nRF52840 DK?&amp;nbsp;&lt;/p&gt;
[quote user="Magdalena"]2. Use Nordic Controller:&amp;nbsp;Failed to start advertiser[/quote]
&lt;p&gt;What value does the advertising start function return?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth master-slave start scan failed</title><link>https://devzone.nordicsemi.com/thread/413988?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2023 01:54:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2afc5508-8ef9-4099-ac11-a30235159c15</guid><dc:creator>Harvey Zheng</dc:creator><description>[quote user="AHaug"]Scan timeout = 2&lt;br /&gt;CONFIG_BT_EXT_ADV_MAX_ADV_SET=2&lt;br /&gt;CONFIG_BT_MAX_CONN=3[/quote]
&lt;p&gt;I have tested it in two situations and it does not work.&lt;/p&gt;
&lt;p&gt;1. Use Zephyr Controller:&amp;nbsp;Scanning failed to start&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1678239735164v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;2. Use Nordic Controller:&amp;nbsp;Failed to start advertiser&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1678239851417v3.png" alt=" " /&gt;&lt;/p&gt;
[quote user="AHaug"]It looks like that there could be an implied dependency that increases BT_MAX_CONN to 3 if BT_EXT_ADV_MAX_ADV_SET is set to 3 which might be why the scanning starts with the last configuration.[/quote]
&lt;p&gt;When CONFIG_BT_EXT_ADV_MAX_ADV_SET=3, after compilation, CONFIG_BT_MAX_CONN is not increased to 3&lt;/p&gt;
[quote user="AHaug"]Having both Central and peripheral support = 2 connections. If you add scanning this will require BT_MAX_CONN = 3 to run.[/quote]
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;Scan timeout = 0
CONFIG_BT_EXT_ADV_MAX_ADV_SET=2
CONFIG_BT_MAX_CONN=2&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;What I can&amp;#39;t understand is that the above configuration works fine when the scan timeout is 0.&amp;nbsp;According to you, doesn&amp;#39;t it need to set CONFIG_BT_EXT_ADV_MAX_ADV_SET or CONFIG_BT_MAX_CONN to 3?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth master-slave start scan failed</title><link>https://devzone.nordicsemi.com/thread/413987?ContentTypeID=1</link><pubDate>Tue, 07 Mar 2023 14:08:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb0b30f5-acc7-42a3-95b8-f0ba88865314</guid><dc:creator>AHaug</dc:creator><description>[quote user="AHaug"]It looks like that there could be an implied dependency that increases BT_MAX_CONN to 3 if BT_EXT_ADV_MAX_ADV_SET is set to 3 which might be why the scanning starts with the last configuration.[/quote]
&lt;p&gt;It looks like this is correct.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;From what I have seen in other similar cases and discussion, the fix is to either increase the CONFIG_BT_MAX_CONN=3 or disable BT_CENTRAL, which should give&amp;nbsp;you two advertising sets and one scan. When you set the number of slave connections to 2, you will need to disable the central role support or to increase the maximum allowed BT_CONN. Having both Central and peripheral support = 2 connections. If you add scanning this will require BT_MAX_CONN = 3 to run.&lt;br /&gt;&lt;br /&gt;Could you try with the following configuration and report back to me what you see?&lt;/p&gt;
&lt;p&gt;Scan timeout = 2&lt;br /&gt;CONFIG_BT_EXT_ADV_MAX_ADV_SET=2&lt;br /&gt;CONFIG_BT_MAX_CONN=3&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth master-slave start scan failed</title><link>https://devzone.nordicsemi.com/thread/413986?ContentTypeID=1</link><pubDate>Tue, 07 Mar 2023 00:59:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:58092c40-c46c-4a32-9057-e77796be3ea0</guid><dc:creator>Harvey Zheng</dc:creator><description>&lt;p&gt;1. These configurations can run:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;Scan timeout = 0
CONFIG_BT_EXT_ADV_MAX_ADV_SET=2
CONFIG_BT_MAX_CONN=2&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;2.&amp;nbsp;These configurations cannot run:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;Scan timeout = 2
CONFIG_BT_EXT_ADV_MAX_ADV_SET=2
CONFIG_BT_MAX_CONN=2&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;3.&amp;nbsp;&lt;span&gt;These configurations can run:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;Scan timeout = 2
CONFIG_BT_EXT_ADV_MAX_ADV_SET=3
CONFIG_BT_MAX_CONN=2&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth master-slave start scan failed</title><link>https://devzone.nordicsemi.com/thread/413985?ContentTypeID=1</link><pubDate>Tue, 07 Mar 2023 00:54:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ec7df26-5bbd-46f3-8d9b-f8704b7d427a</guid><dc:creator>Harvey Zheng</dc:creator><description>[quote user="AHaug"]&lt;p&gt;Just to clarify:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Scan timeout = 0&lt;br /&gt;CONFIG_BT_EXT_ADV_MAX_ADV_SET=2&lt;br /&gt;CONFIG_BT_MAX_CONN=2&lt;/li&gt;
&lt;li&gt;Scan timeout = 2&lt;br /&gt;CONFIG_BT_EXT_ADV_MAX_ADV_SET=2&lt;br /&gt;CONFIG_BT_MAX_CONN=2&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These configurations does not work?&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Scan timeout = 2&lt;br /&gt;CONFIG_BT_EXT_ADV_MAX_ADV_SET=3&lt;br /&gt;CONFIG_BT_MAX_CONN=2&lt;/li&gt;&lt;/ul&gt;[/quote]
&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Yes,&amp;nbsp;my samp do run like this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth master-slave start scan failed</title><link>https://devzone.nordicsemi.com/thread/413984?ContentTypeID=1</link><pubDate>Mon, 06 Mar 2023 14:14:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a9d41f7-7567-4746-a12d-ff805b74d0ac</guid><dc:creator>AHaug</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;Just to clarify:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Scan timeout = 0&lt;br /&gt;CONFIG_BT_EXT_ADV_MAX_ADV_SET=2&lt;br /&gt;CONFIG_BT_MAX_CONN=2&lt;/li&gt;
&lt;li&gt;Scan timeout = 2&lt;br /&gt;CONFIG_BT_EXT_ADV_MAX_ADV_SET=2&lt;br /&gt;CONFIG_BT_MAX_CONN=2&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These configurations does not work?&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Scan timeout = 2&lt;br /&gt;CONFIG_BT_EXT_ADV_MAX_ADV_SET=3&lt;br /&gt;CONFIG_BT_MAX_CONN=2&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This configuration does work?&lt;/p&gt;
&lt;p&gt;It looks like that there could be an implied dependency that increases BT_MAX_CONN to 3 if BT_EXT_ADV_MAX_ADV_SET is set to 3 which might be why the scanning starts with the last configuration.&lt;/p&gt;
&lt;p&gt;Let me know about the clarification question above, and I&amp;#39;ll have a closer look&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Andreas&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>