<?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>Soft device somtimes don&amp;#39;t want to start advertising</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/28455/soft-device-somtimes-don-t-want-to-start-advertising</link><description>I have an application based on ble_app_hrs_freertos from SDK14.
Sometimes the application will not start advertising. When this happens, it does not help to power-cycle device.
Sometimes it helps to reset the device with nRFgo Studio, simply to let</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 19 Nov 2019 07:47:53 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/28455/soft-device-somtimes-don-t-want-to-start-advertising" /><item><title>RE: Soft device somtimes don't want to start advertising</title><link>https://devzone.nordicsemi.com/thread/220717?ContentTypeID=1</link><pubDate>Tue, 19 Nov 2019 07:47:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:737ef118-275d-4e66-8275-dcac97dafba0</guid><dc:creator>eshaul</dc:creator><description>&lt;p&gt;Already done, and solved - thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Soft device somtimes don't want to start advertising</title><link>https://devzone.nordicsemi.com/thread/220711?ContentTypeID=1</link><pubDate>Tue, 19 Nov 2019 07:32:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca224ffc-ed70-415f-acf7-a23f9dd12890</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Is it the exact same environment you are using Erez? if not please open a&amp;nbsp; new case.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Soft device somtimes don't want to start advertising</title><link>https://devzone.nordicsemi.com/thread/219362?ContentTypeID=1</link><pubDate>Sun, 10 Nov 2019 08:18:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28a5c95b-009c-4c62-9263-a13136de947a</guid><dc:creator>eshaul</dc:creator><description>&lt;p&gt;Dear&amp;nbsp;&lt;a class="internal-link view-user-profile" href="https://devzone.nordicsemi.com/members/aryan"&gt;Susheel Nuguru&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;Can you suggest a solution?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;BR&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Erez.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Soft device somtimes don't want to start advertising</title><link>https://devzone.nordicsemi.com/thread/218808?ContentTypeID=1</link><pubDate>Wed, 06 Nov 2019 12:11:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:79e26239-bf75-4957-b9c1-04c1238054ce</guid><dc:creator>eshaul</dc:creator><description>&lt;p&gt;Dear&amp;nbsp;&lt;span class="user-name"&gt;&lt;a class="internal-link view-user-profile" href="https://devzone.nordicsemi.com/members/aryan"&gt;Susheel Nuguru&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I seem to suffer from the very same issue, I am using:&amp;nbsp;&lt;strong&gt;S132 SoftDevice v2.0.0&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;in my case also, after flashing the&amp;nbsp;&lt;span&gt;application will not start advertising (only after 2-4 reset cycles)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I am not using:&lt;strong&gt;&amp;nbsp;&lt;span&gt;ble_app_hrs_freertos from SDK14&amp;nbsp;&lt;/span&gt;&lt;/strong&gt;&lt;span&gt;or other FreeRTOS&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I am only exposed to the nRF5_SDK_00.11.00&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I am looking for a solution that I can implement on my application and not on the Softdevice.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;What can be done on the application level?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;BR&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Erez&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Soft device somtimes don't want to start advertising</title><link>https://devzone.nordicsemi.com/thread/112428?ContentTypeID=1</link><pubDate>Tue, 19 Dec 2017 18:48:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c2d49088-dfaa-46f5-b80c-cbe7b32454b9</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;yes, it should be fixed in latest SDK14.2&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Soft device somtimes don't want to start advertising</title><link>https://devzone.nordicsemi.com/thread/112427?ContentTypeID=1</link><pubDate>Tue, 19 Dec 2017 18:46:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb68d868-68f8-4ec5-b323-bc8f8bd0a0fd</guid><dc:creator>jmag999</dc:creator><description>&lt;p&gt;Has this been fixed in newer versions of the SDK?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Soft device somtimes don't want to start advertising</title><link>https://devzone.nordicsemi.com/thread/112426?ContentTypeID=1</link><pubDate>Mon, 16 Oct 2017 12:42:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:518998ec-b361-46ef-9c73-ecd7237510cf</guid><dc:creator>janR</dc:creator><description>&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;I tried tihs now, and it seems to work fine.&lt;/p&gt;
&lt;p&gt;The problem occurred mostly after first-time flashing of the nRF52.
Now, after the fix, It seems to start advertising immediately after application has started, as it should.&lt;/p&gt;
&lt;p&gt;Thanks for help, Jan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Soft device somtimes don't want to start advertising</title><link>https://devzone.nordicsemi.com/thread/112425?ContentTypeID=1</link><pubDate>Mon, 16 Oct 2017 08:22:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7313c5b7-5c8f-4b61-aac2-7231f8906c75</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Sorry for the late reply. I somehow missed this thread.&lt;/p&gt;
&lt;p&gt;I think this is related to a bug we found recently in nrf_sdh_freertos.c. After flashing softdevice and initializing peer manager it tries to format internal flash memory to be ready for usage and emits NRF_EVT_FLASH_OPERATION_SUCCESS event which then fires SD_EVT_IRQHandler. Then using FreeRTOS, a notification is sent to softdevice_task task from SD_EVT_IRQHandler, but if a task is not yet created during that moment this notification gets lost. After softdevice_task task is created by calling nrf_sdh_freertos_init(), softdevice_task blocks on ulTaskNotifyTake() and waits for other BLE stack events before calling nrf_sdh_evts_poll(). So in the example, where the order of calls is first peer_manager_init() and then nrf_sdh_freertos_init(), then flash system is busy, NRF_EVT_FLASH_OPERATION_SUCCESS gets lost, and as a result, delayed advertising doesn&amp;#39;t start.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;solution&lt;/strong&gt;&lt;br /&gt;
my suggestion is to switch the order of calls in softdevice_task() to firstly do a nrf_sdh_evts_poll() and only then block ulTaskNotifyTake(), so those first events in the queue could be properly read:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void softdevice_task(void * pvParameter)\{

    NRF_LOG_DEBUG(&amp;quot;Enter softdevice_task.&amp;quot;);

    if (m_task_hook != NULL) \{

        m_task_hook(pvParameter);

    }

    while (true) \{

        nrf_sdh_evts_poll();   // &amp;lt;&amp;lt;--- now called before locking on the binary semaphore

        (void) ulTaskNotifyTake(pdTRUE, portMAX_DELAY);

    }

}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>