<?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>sd_ble_gap_adv_stop() never returns.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/12961/sd_ble_gap_adv_stop-never-returns</link><description>Hi,
I&amp;#39;m using the S110 v8.0 on a nrf51422 together with our own scheduler with a few lines left from SDK v8.1. 
 I&amp;#39;m sending out advertising containing some extra data and it works well. I can update the data in the advertising message on the fly, but</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 23 May 2016 10:25:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/12961/sd_ble_gap_adv_stop-never-returns" /><item><title>RE: sd_ble_gap_adv_stop() never returns.</title><link>https://devzone.nordicsemi.com/thread/49391?ContentTypeID=1</link><pubDate>Mon, 23 May 2016 10:25:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:53de903e-cae1-4635-b6b2-55c4969e1571</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@dav lion: please, open a new case, and please provide a test code that can reproduce the issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ble_gap_adv_stop() never returns.</title><link>https://devzone.nordicsemi.com/thread/49390?ContentTypeID=1</link><pubDate>Fri, 20 May 2016 22:25:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d1185bea-8380-4b0f-a5a4-78b50e9dbc82</guid><dc:creator>dav lion</dc:creator><description>&lt;p&gt;I am having similar problems calling sd_ble_gap_adv_stop.   I can call it from main(), but neither from a scheduler callback nor from a ble_event handler.    sdk11, softdevice130&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ble_gap_adv_stop() never returns.</title><link>https://devzone.nordicsemi.com/thread/49388?ContentTypeID=1</link><pubDate>Tue, 05 Apr 2016 15:18:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e7d78143-70c9-4aee-9a1f-b769927cf496</guid><dc:creator>Carles</dc:creator><description>&lt;p&gt;@AndersE we need more info then, I just can&amp;#39;t explain it. Can you try removing all synchronization primitives from your scheduler, or calling sd_ble_gap_adv_stop() directly from main() without the scheduler?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ble_gap_adv_stop() never returns.</title><link>https://devzone.nordicsemi.com/thread/49387?ContentTypeID=1</link><pubDate>Tue, 05 Apr 2016 15:14:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83a9eb72-c5d9-498f-8d60-6802a8bfb4b7</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hmm, I&amp;#39;m out of idea, can you reproduce the issue on our nRF5 DK ? If you have some simple code that can replicate the issue, you can send us and we can test it here.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ble_gap_adv_stop() never returns.</title><link>https://devzone.nordicsemi.com/thread/49389?ContentTypeID=1</link><pubDate>Tue, 05 Apr 2016 13:22:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:033fd2c9-0b74-4fd2-89c7-e30059401f82</guid><dc:creator>AndersE</dc:creator><description>&lt;p&gt;@Hung Bui: There is no difference in the behavior using sd_nvic_critical_region_enter() or __disable_interrupt(). The SD is still not returning when called to stop advertising.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ble_gap_adv_stop() never returns.</title><link>https://devzone.nordicsemi.com/thread/49376?ContentTypeID=1</link><pubDate>Tue, 05 Apr 2016 08:11:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c7ebad50-00a5-4d31-9357-b3e9703652c5</guid><dc:creator>AndersE</dc:creator><description>&lt;p&gt;@Hung Bui I&amp;#39;m changing the calls to use the critical_region function in nrf_soc.h but it was a bit trickier than I expected so I didn&amp;#39;t have the time to finish it yesterday. I have a break point after the call to the SD and in never arrives there, so I make a manual break after a few minutes and the PC is moving around address 0x12ca8 WFE. Which I believe is the scheduler in the SD.  I&amp;#39;ll update here as soon as I get the code from nrf_soc.h in place.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ble_gap_adv_stop() never returns.</title><link>https://devzone.nordicsemi.com/thread/49375?ContentTypeID=1</link><pubDate>Tue, 05 Apr 2016 07:56:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8226d90-54b5-4042-b08c-33dbe9d7806c</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@AndersE: Do you have update on the case?
I guess you have done, but just in case, when you are debugging you should set the optimization level to 0 and when you are debugging you should not step through the softdevice API but better add the breakpoint after the call. This is because after CPU stopped for a breakpoint, the softdevice wouldn&amp;#39;t be able to continue functional due to timing error.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ble_gap_adv_stop() never returns.</title><link>https://devzone.nordicsemi.com/thread/49381?ContentTypeID=1</link><pubDate>Mon, 04 Apr 2016 12:07:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:217510b6-f7c9-4401-8bee-f8185c098de1</guid><dc:creator>Carles</dc:creator><description>&lt;p&gt;Disabling interrupts can cause serious issues with the SoftDevice. You should instead use the critical_region functions in nrf_soc.h. Can you try removing the disabling of interrupts to see if adv_stop() still locks up?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ble_gap_adv_stop() never returns.</title><link>https://devzone.nordicsemi.com/thread/49380?ContentTypeID=1</link><pubDate>Mon, 04 Apr 2016 12:00:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:350e2ae0-2413-48cc-844b-b80197a849e7</guid><dc:creator>AndersE</dc:creator><description>&lt;p&gt;Yes, in the scheduler, when it is time for task switching. As all tasks are set up to be  &amp;quot;run to completion&amp;quot; it will not be scheduling until after the call returns.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ble_gap_adv_stop() never returns.</title><link>https://devzone.nordicsemi.com/thread/49385?ContentTypeID=1</link><pubDate>Mon, 04 Apr 2016 11:34:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bebeafbf-4447-48fb-b779-feb024ac00ee</guid><dc:creator>Carles</dc:creator><description>&lt;p&gt;Are you by any chance disabling interrupts somewhere in your code? __irq_disable() and family&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ble_gap_adv_stop() never returns.</title><link>https://devzone.nordicsemi.com/thread/49384?ContentTypeID=1</link><pubDate>Mon, 04 Apr 2016 11:32:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:80618b10-c072-4347-8ece-751e1f96474d</guid><dc:creator>AndersE</dc:creator><description>&lt;p&gt;I&amp;#39;m not using the macros, it is just: errCode = sd_ble_gap_adv_stop(); and it never comes back. If you by the SD assertion handler mean softdevice_assertion_handler(...) it is running and working but it never comes to that. The SD is doing something, but I can&amp;#39;t really figure out what by just looking at the assembly code in the debugger.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ble_gap_adv_stop() never returns.</title><link>https://devzone.nordicsemi.com/thread/49379?ContentTypeID=1</link><pubDate>Mon, 04 Apr 2016 11:10:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad3b9784-35c4-40a4-9b70-d61d16acb99a</guid><dc:creator>Carles</dc:creator><description>&lt;p&gt;When you say &amp;quot;function call&amp;quot; I assume SuperVisor Call (SVC) since that&amp;#39;s how we expose the SD API. Do you have a SD assertion handler set up? This could be the SD for some reason (that we can debug later) asserting and you not catching it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ble_gap_adv_stop() never returns.</title><link>https://devzone.nordicsemi.com/thread/49378?ContentTypeID=1</link><pubDate>Mon, 04 Apr 2016 11:08:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf70a6ca-8f44-499d-896a-e57cfd1bc739</guid><dc:creator>AndersE</dc:creator><description>&lt;p&gt;yes, as a function call.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ble_gap_adv_stop() never returns.</title><link>https://devzone.nordicsemi.com/thread/49377?ContentTypeID=1</link><pubDate>Mon, 04 Apr 2016 11:05:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66d10c3a-b6f2-4d38-af67-b558cd1227b1</guid><dc:creator>Carles</dc:creator><description>&lt;p&gt;So you&amp;#39;re saying that the call to adv_stop() is being made from Thread Mode (aka main()) ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ble_gap_adv_stop() never returns.</title><link>https://devzone.nordicsemi.com/thread/49383?ContentTypeID=1</link><pubDate>Mon, 04 Apr 2016 10:35:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e81a1d3-8ebb-4aa5-82c9-d13c3b3c1453</guid><dc:creator>Carles</dc:creator><description>&lt;p&gt;Can you edit your original post with the SD and SDK versions?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ble_gap_adv_stop() never returns.</title><link>https://devzone.nordicsemi.com/thread/49382?ContentTypeID=1</link><pubDate>Mon, 04 Apr 2016 10:24:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e3c551bb-1a1f-47d3-8dca-88b4f5643dca</guid><dc:creator>AndersE</dc:creator><description>&lt;p&gt;I can trace the code running around inside the SoftDevice, so something is happening but not the right thing to get it to return. There are no interrupts involved at all in this call.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ble_gap_adv_stop() never returns.</title><link>https://devzone.nordicsemi.com/thread/49386?ContentTypeID=1</link><pubDate>Mon, 04 Apr 2016 08:32:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb7fefd1-4b12-4040-9412-4b93a9a19d05</guid><dc:creator>Carles</dc:creator><description>&lt;p&gt;could this be a hard fault? Are you perhaps calling the SD function from a higher priority than the SVC one? If you are calling it from APP_HIGH then this could be the issue&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>