<?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>Call to nrf_sdh_enable_request fails in SDK v16.0.0 (works in SDK v15.3.0)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/70679/call-to-nrf_sdh_enable_request-fails-in-sdk-v16-0-0-works-in-sdk-v15-3-0</link><description>I am porting our firmware from SDK v15.3.0 to 16.0.0. I believe I have most of the changes in place as I am able to build the boot loader and get it to execute without any catastrophic errors. 
 However, when I try to port a basic advertisement project</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 25 Jan 2021 19:23:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/70679/call-to-nrf_sdh_enable_request-fails-in-sdk-v16-0-0-works-in-sdk-v15-3-0" /><item><title>RE: Call to nrf_sdh_enable_request fails in SDK v16.0.0 (works in SDK v15.3.0)</title><link>https://devzone.nordicsemi.com/thread/291135?ContentTypeID=1</link><pubDate>Mon, 25 Jan 2021 19:23:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:98afea03-1b13-47bb-b36f-8745bdc24de8</guid><dc:creator>RVM</dc:creator><description>&lt;p&gt;This problem disappears (and I am now able to build my project) if I remove the file &amp;#39;nrf_drv_power.c&amp;#39;.&lt;/p&gt;
&lt;p&gt;I will mark this as &amp;#39;answered&amp;#39;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Call to nrf_sdh_enable_request fails in SDK v16.0.0 (works in SDK v15.3.0)</title><link>https://devzone.nordicsemi.com/thread/290670?ContentTypeID=1</link><pubDate>Fri, 22 Jan 2021 09:00:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:736b4f08-618c-47c4-a23a-5d7a319da94e</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi RMV,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please be aware that most of our BLE examples don&amp;#39;t use the nrf_drv_power library. You can find that in all of our example inside ble_peripheral folder, we don&amp;#39;t use such library at all.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The reason you see a call to&amp;nbsp;&lt;span&gt;nrf_drv_power_on_sd_enable() was because you included the nrf_drv_power.c in your project. Inside the code this macro will be compiled:&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;NRF_SDH_STATE_OBSERVER(m_sd_observer, POWER_CONFIG_STATE_OBSERVER_PRIO) =&lt;/em&gt;&lt;br /&gt;&lt;em&gt;{&lt;/em&gt;&lt;br /&gt;&lt;em&gt; .handler = nrf_drv_power_sdh_state_evt_handler,&lt;/em&gt;&lt;br /&gt;&lt;em&gt; .p_context = NULL&lt;/em&gt;&lt;br /&gt;&lt;em&gt;};&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;And because of that&amp;nbsp;&lt;em&gt;nrf_drv_power_sdh_state_evt_handler() &lt;/em&gt;will be called when the softdevice is enabled.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So if you remove nrf_drv_power.c from your code, it should work fine.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Call to nrf_sdh_enable_request fails in SDK v16.0.0 (works in SDK v15.3.0)</title><link>https://devzone.nordicsemi.com/thread/290595?ContentTypeID=1</link><pubDate>Thu, 21 Jan 2021 16:43:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:353f498b-bad7-47ea-9bfd-c8bdfc44ca4e</guid><dc:creator>RVM</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;No, I did not plan to use the nrf_power_drv at all.&lt;/p&gt;
&lt;p&gt;The only reason I did so was because the call to nrf_sdh_enable_request() ended up (via one of its registered handlers) making a call to &amp;#39;nrf_drv_power_on_sd_enable()&amp;#39; which, as I indicated before, fails because the variable &amp;#39;m_initialized&amp;#39; is FALSE.&lt;/p&gt;
&lt;p&gt;And this variable is only ever set to TRUE if the nrf_drv_power module is initialized....&lt;/p&gt;
&lt;p&gt;And our firmware does NOT intend to use the nrf_drv_power or the USBD.&lt;/p&gt;
&lt;p&gt;This firmware design was working well for the past year or so but that was without defining the symbol DEBUG_NRF. This problem only occurs when I define DEBUG_NRF in the build.&lt;/p&gt;
&lt;p&gt;The only reason I chose to set this definition was because it was set in one of the examples I was reviewing when trying to bring up the bootloader and buttonless DFU application. &lt;/p&gt;
&lt;p&gt;I think I will revert back to not having this symbol defined and get on with my development plans for now.&lt;/p&gt;
&lt;p&gt;Cheers&lt;/p&gt;
&lt;p&gt;RMV&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Call to nrf_sdh_enable_request fails in SDK v16.0.0 (works in SDK v15.3.0)</title><link>https://devzone.nordicsemi.com/thread/290417?ContentTypeID=1</link><pubDate>Thu, 21 Jan 2021 09:38:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ebaacb16-f8d4-4ba8-ad1c-ea0a3c40987c</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi RMV,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t think the nrf_pwr_mgmt_init() is related to the nrf_drv_power library.&lt;/p&gt;
&lt;p&gt;Could you let me know what exactly you are doing with the nrf_drv_power library&amp;nbsp; ?&lt;/p&gt;
&lt;p&gt;I would suggest to have a look at one of our example in the SDK that uses the nrf_drv_power , for example the usbd_ble_uart example where we uses both the softdevice and the nrf_drv_power to handle the interrupt when USB power is plugged.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;NRF_ERROR_SVC_HANDLER_MISSING is not in the list of error code for&amp;nbsp;sd_softdevice_enable(). Please double check if it&amp;#39;s actually return error code 1.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Call to nrf_sdh_enable_request fails in SDK v16.0.0 (works in SDK v15.3.0)</title><link>https://devzone.nordicsemi.com/thread/290347?ContentTypeID=1</link><pubDate>Wed, 20 Jan 2021 17:37:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0665f153-40ac-41c8-8497-bde22e24846d</guid><dc:creator>RVM</dc:creator><description>&lt;p&gt;Just an update.&lt;/p&gt;
&lt;p&gt;I added a call to nrf_drv_power_init() after the call to nrf_pwr_mgmt_init()&amp;nbsp; -- not sure if the order is correct.&lt;br /&gt;Now, I get the error &amp;quot;NRF_ERROR_SVC_HANDLER_MISSING&amp;quot; when the call to nrf_sdh_enable_request() internally calls &amp;#39;sd_softdevice_enable()&amp;#39;&lt;/p&gt;
&lt;p&gt;Cheers&lt;br /&gt;RMV&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Call to nrf_sdh_enable_request fails in SDK v16.0.0 (works in SDK v15.3.0)</title><link>https://devzone.nordicsemi.com/thread/290344?ContentTypeID=1</link><pubDate>Wed, 20 Jan 2021 17:14:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8fcb8712-bc15-4bb5-93e5-7837b1101c0f</guid><dc:creator>RVM</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;Thanks for your response, and it certainly confirms my suspicions too as to why I am seeing this behavior.&lt;br /&gt;Below is the stack trace when the assert traps the error &lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1611162256815v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;And further down is a screen shot of the firmware that fails the assertion. &lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1611162462596v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In SDK v16.0.0, one of the only places I see that the variable &amp;#39;m_initialized&amp;#39; is set to true &lt;br /&gt;with my specific SDK configuration is in this function below:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1611162623301v3.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;I call &amp;#39;nrf_pwr_mgmt_init()&amp;#39; before &amp;#39;nrf_sdh_enable_request()&amp;#39; but do I also have to call &amp;#39;nrf_drv_power_init()&amp;#39;&amp;nbsp; ?&lt;/p&gt;
&lt;p&gt;Cheers&lt;br /&gt;RMV&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Call to nrf_sdh_enable_request fails in SDK v16.0.0 (works in SDK v15.3.0)</title><link>https://devzone.nordicsemi.com/thread/290330?ContentTypeID=1</link><pubDate>Wed, 20 Jan 2021 15:45:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ee8a1d7b-5957-496b-a487-72371f88144e</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi RMV,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If you don&amp;#39;t define DEBUG_NRF the ASSERT check with be masked and it may explain why it run fine without.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you add some breakpoint and check what exactly throwing the error ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m a bit confused what exactly causing the issue,&amp;nbsp;&lt;span&gt;nrf_sdh_enable_request or a function inside&amp;nbsp;nrf_drv_power.c&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Did you add any modification into nrf_drv_power.c ? Could you give some more info on how you use the library in your application ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>