<?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>Device unable advertise after disconnecting from host</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/104871/device-unable-advertise-after-disconnecting-from-host</link><description>I am trying to troubleshoot a problem wherein the nRF5340 stops advertising and won&amp;#39;t resume once a central has connected to it and disconnected. Occasionally, I am able to connect to the nRF5340, transfer some data, disconnect and have advertising resume</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 20 Oct 2023 19:41:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/104871/device-unable-advertise-after-disconnecting-from-host" /><item><title>RE: Device unable advertise after disconnecting from host</title><link>https://devzone.nordicsemi.com/thread/451565?ContentTypeID=1</link><pubDate>Fri, 20 Oct 2023 19:41:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ee4f65f6-8467-4928-b8c6-9be99f365e1f</guid><dc:creator>cscase</dc:creator><description>&lt;p&gt;Thank you, Vidar.&lt;/p&gt;
&lt;p&gt;Your response was very helpful and I think helped me get to a resolution.&lt;/p&gt;
&lt;p&gt;I believe the idea you presented in your item #1 may have hit close to the truth.&amp;nbsp; You said:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;&amp;quot;My idea with this is that there may be an internal state flag that is not cleared by the time advertising start is called making the stack&amp;nbsp;try to configure a new advertisement set.&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;This got me thinking and looking. I found that in addition to the callback I mentioned above, there was other code calling for advertising to restart following a disconnect event. Maybe these two pieces of code, both calling for advertising restart in&amp;nbsp;short succession, sometimes aligned in a way that created that bad state?&amp;nbsp; At any rate, once I had removed that other code, this problem SEEMS to have gone away. I&amp;#39;m going to do more extensive testing to verify, but&amp;nbsp;it certainly seems to be fixed.&lt;/p&gt;
&lt;p&gt;Thanks again! I&amp;#39;m very grateful for your help on this.&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device unable advertise after disconnecting from host</title><link>https://devzone.nordicsemi.com/thread/451531?ContentTypeID=1</link><pubDate>Fri, 20 Oct 2023 14:06:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4923eaeb-92f7-422d-86fb-f48bbe08d0bb</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi Scott,&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t have any good ideas as to why the advertiser fails to start other than that it sounds like it may be timing related.&amp;nbsp;Logging over RTT&amp;nbsp;could be an alternative to using UART for figuring out what the error code is. However, there is a chance that&amp;nbsp;RTT logging may mask the problem too&amp;nbsp;considering it&amp;#39;s using the same&amp;nbsp;logging infrastructure.&lt;/p&gt;
&lt;p&gt;To troubleshoot this,&amp;nbsp;I&amp;nbsp;recommend you try one of the following steps:&lt;/p&gt;
&lt;p&gt;1. Increase the max. number of advertisement sets supported in the hci_rpsmg sample (BT controller) running on the network core through the&amp;nbsp;CONFIG_BT_CTLR_ADV_SET symbol. It should be &amp;#39;1&amp;#39; by default. My idea with this is that there may be an internal state flag that is not cleared by the time advertising start is called making the stack&amp;nbsp;try to configure a new advertisement set.&lt;/p&gt;
&lt;p&gt;2. Increase the max. number of supported BLE connections in the app with&amp;nbsp;CONFIG_BT_MAX_CONN assuming the current limit is 1.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;3. Place a breakpoint that will be hit if&amp;nbsp;bt_le_ext_adv_start() returns with an error. Then use the debugger to check the error code.&lt;/p&gt;
&lt;p&gt;Kconfig settings to enable RTT logging&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_LOG=y
CONFIG_USE_SEGGER_RTT=y
CONFIG_LOG_BACKEND_RTT=y
CONFIG_LOG_BACKEND_UART=n&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I would also recommend upgrading to a more recent SDK version if possible. While I can&amp;#39;t guarantee it will resolve the specific issue you&amp;#39;re encountering, there have been numerous improvements and bug fixes since v1.7.0.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>