<?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>Softdevice is not advertising after switching from DM (device manager) to PM (peer manager)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/54235/softdevice-is-not-advertising-after-switching-from-dm-device-manager-to-pm-peer-manager</link><description>Hi, 
 SDK: nRF5_SDK_00.11.00 ; S132 SoftDevice v2.0.0 
 I am working now to migrate my application from DM to PM (in order to better handle pairing&amp;amp;bonding). 
 Sometimes the application will not start advertising, I start to advertise using: 
 
 
 
 </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 12 Nov 2019 12:29:46 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/54235/softdevice-is-not-advertising-after-switching-from-dm-device-manager-to-pm-peer-manager" /><item><title>RE: Softdevice is not advertising after switching from DM (device manager) to PM (peer manager)</title><link>https://devzone.nordicsemi.com/thread/219654?ContentTypeID=1</link><pubDate>Tue, 12 Nov 2019 12:29:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c9e06b57-7372-446f-bfa3-fb005736d6fb</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hi Erez,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Very glad to hear! Let me know if you meet any further issues &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice is not advertising after switching from DM (device manager) to PM (peer manager)</title><link>https://devzone.nordicsemi.com/thread/219641?ContentTypeID=1</link><pubDate>Tue, 12 Nov 2019 11:49:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a45bea96-582d-415c-ab18-8e569fc60d26</guid><dc:creator>eshaul</dc:creator><description>&lt;p&gt;&lt;span&gt;Hi&amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;Oslash;yvin&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;As you nicely caught, I was missing a call&amp;nbsp;in the&amp;nbsp;&lt;/span&gt;&lt;strong&gt;sys_evt_dispatch&lt;/strong&gt; to the&amp;nbsp;&lt;strong&gt;fs_sys_event_handler&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;it seemed to be solved the issue.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I will run further tests to be sure.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you very much&amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;Oslash;yvin&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 Shaul&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice is not advertising after switching from DM (device manager) to PM (peer manager)</title><link>https://devzone.nordicsemi.com/thread/219621?ContentTypeID=1</link><pubDate>Tue, 12 Nov 2019 09:30:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d41fec29-4c53-461a-940f-3781aa0dde6c</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;The reset issue you are describing could indicate an issue with Fstorage. You will need to call:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;// Forward Softdevice events to the fstorage module
fs_sys_event_handler(sys_evt);
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Have a look at the ble_app_gls example and the following function:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;void ble_advertising_on_sys_evt(uint32_t sys_evt)
{
    uint32_t err_code = NRF_SUCCESS;
    switch (sys_evt)
    {

        case NRF_EVT_FLASH_OPERATION_SUCCESS:
        // Fall through.

 

        //When a flash operation finishes, advertising no longer needs to be pending.
        case NRF_EVT_FLASH_OPERATION_ERROR:
            if (m_advertising_start_pending)
            {
                m_advertising_start_pending = false;
                err_code = ble_advertising_start(m_adv_mode_current);
                if ((err_code != NRF_SUCCESS) &amp;amp;&amp;amp; (m_error_handler != NULL))
                {
                    m_error_handler(err_code);
                }
            }
            break;

 

        default:
            // No implementation needed.
            break;
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;If you have this in your project, please check that the&amp;nbsp;&lt;em&gt;m_advertising_start_pending&amp;nbsp;&lt;/em&gt;flag is cleared. This can be the cause of why your code is hanging in an advertisement.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;My best advice is to upgrade your SDK, as v11.0 is very outdated.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Another thing to check, not related to your issue, since you have an old version is &lt;a href="https://infocenter.nordicsemi.com/topic/errata_nRF52832_EngC/ERR/nRF52832/EngineeringC/latest/anomaly_832_108.html"&gt;ERRATA 108&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice is not advertising after switching from DM (device manager) to PM (peer manager)</title><link>https://devzone.nordicsemi.com/thread/219586?ContentTypeID=1</link><pubDate>Tue, 12 Nov 2019 07:10:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7be9907e-5411-42cd-b639-8b28b3026c9f</guid><dc:creator>eshaul</dc:creator><description>&lt;p&gt;&lt;span&gt;Hi&amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;Oslash;yvin&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;strong&gt;AUGU_LOG_PRINTF_WRN&lt;/strong&gt; is verified, and so as the other envelop functions.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regarding the scenario, I will explain some more:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;1. App+Softdevice is flashed to the board&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;2. The app starts to run, after a few seconds, it&amp;#39;s time for the application to start advertising.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;3. I call&amp;nbsp;&lt;strong&gt;augu_ble_start_advertising&amp;nbsp;&amp;nbsp;&lt;/strong&gt;to start the advertisement&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;4. Nothing happens (no advertising, no error and no adv. events)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;5. I reset the board using&amp;nbsp;&lt;strong&gt;nrfjprog --reset -f nrf52 &lt;/strong&gt;and follow up again until advertising actually happens, this usually requires 2-4 resets cycles&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;6. From this point on, the board successfully advertise further on.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I have noticed another thread:&amp;nbsp;&lt;/span&gt;&lt;span&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/28455/soft-device-somtimes-don-t-want-to-start-advertising/112425?focus=true"&gt;link to the thread&lt;/a&gt;&amp;nbsp;but there it happened because of the freertos.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regarding the debugging, Yes I have tried to debug and follow up the code and i couldn&amp;#39;t see any abnormal behavior, the application actually doesn&amp;#39;t hang (it&amp;#39;s just not performing the adv. request)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;My feeling is that it&amp;#39;s related to the PM &amp;amp; softdevice somehow.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I would like to continue and investigate to reach to a proper solution and I will be happy to share more explanation/code if that will be required.&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: Softdevice is not advertising after switching from DM (device manager) to PM (peer manager)</title><link>https://devzone.nordicsemi.com/thread/219505?ContentTypeID=1</link><pubDate>Mon, 11 Nov 2019 14:18:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22484d85-7900-4935-ad18-0e613d08b76c</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;As these functions (e.g.&amp;nbsp;AUGU_LOG_PRINTF_WRN) are not Nordic, have you verified that they work?&lt;/p&gt;
&lt;p&gt;What do you mean with 2-4 resets? Do you mean manually pressing reset 2-4 times? What kind of board are you running?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Have you tried debugging your code using any type of IDE, i.e. step through code to see where it hangs? Try using break-points to see if it reaches correct functions.&lt;/p&gt;
&lt;p&gt;Did you read&amp;nbsp;this &lt;a href="https://devzone.nordicsemi.com/nordic/short-range-guides/b/software-development-kit/posts/migrating-to-peer-manager"&gt;blog post on migration to peer manager&lt;/a&gt;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice is not advertising after switching from DM (device manager) to PM (peer manager)</title><link>https://devzone.nordicsemi.com/thread/219495?ContentTypeID=1</link><pubDate>Mon, 11 Nov 2019 13:45:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7bfaf730-c7d7-46f2-8f0d-e4e6133fcf20</guid><dc:creator>eshaul</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;&amp;Oslash;yvin&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;As you can see at my&amp;nbsp;&lt;strong&gt;augu_ble_start_advertising&amp;nbsp;&lt;/strong&gt;function,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I check for error codes and print them, this function also returns the err_code, that I check after the function returns.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;There are no errors return in the cases were the adv. is not happening, the only indication I can see besides the actual lack of adv. is the lack of adv. events as I explained in my original message.&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;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;err_code = augu_ble_start_advertising();
APP_ERROR_CHECK(err_code);&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice is not advertising after switching from DM (device manager) to PM (peer manager)</title><link>https://devzone.nordicsemi.com/thread/219490?ContentTypeID=1</link><pubDate>Mon, 11 Nov 2019 13:36:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a872cd44-aaf8-487f-a546-dd1efcf460ab</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hello Erez,&lt;/p&gt;
&lt;p&gt;Can you please provide more debugging information? Have a look at this &lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/an-introduction-to-error-handling-in-nrf5-projects"&gt;introduction on error handling&lt;/a&gt;. Also, see the documentation on&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v11.0.0/lib_error.html"&gt;error module&lt;/a&gt;&amp;nbsp;and &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v11.0.0/lib_trace.html?cp=5_5_11_3_6"&gt;debug logger&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>