<?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>Graceful handling of softdevice asserts</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/43058/graceful-handling-of-softdevice-asserts</link><description>We have an application where certain executions hold more priority over BLE link. We are implementing a critical section(disable/enable interrupts). However, in some corner cases, the softdevice asserts. We do not mind losing the BLE link. 
 
 Is there</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 28 Jan 2019 13:05:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/43058/graceful-handling-of-softdevice-asserts" /><item><title>RE: Graceful handling of softdevice asserts</title><link>https://devzone.nordicsemi.com/thread/168232?ContentTypeID=1</link><pubDate>Mon, 28 Jan 2019 13:05:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b8da6228-9097-4c04-af60-fad4cf0d9cd9</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Interrupts should not be disabled globally as it&amp;nbsp;will delay servicing of timing critical protocol events inside the softdevice, hence lead to an assert. If you need a critical section it&amp;#39;s recommended to use the&amp;nbsp;CRITICAL_REGION_ENTER()/CRITICAL_REGION_EXIT() macros. These will only mask the application level interrupts, or that&amp;#39;s what it should do. The softdevice reserved MWU (used to &amp;quot;sandbox&amp;quot; softdevice memory) peripheral is wrongfully masked even if you use the macro. The fix for that is to redefine&amp;nbsp;&lt;span&gt;__NRF_NVIC_SD_IRQS_1&amp;nbsp; to&amp;nbsp;&lt;/span&gt;&lt;span&gt;__NRF_NVIC_SD_IRQS_1 ((uint32_t)(1U &amp;lt;&amp;lt; (MWU_IRQn - 32))) in the nrf_nvic.h header.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Can you try to implement the changes mentioned above and see if you still get the asserts? I&amp;#39;m not sure if it&amp;#39;s possible to safely recover from an assert without doing a reset.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Graceful handling of softdevice asserts</title><link>https://devzone.nordicsemi.com/thread/168221?ContentTypeID=1</link><pubDate>Mon, 28 Jan 2019 12:52:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f29c02e1-de7b-4dd4-81ac-d5fe6f179a71</guid><dc:creator>himanshu pande</dc:creator><description>&lt;p&gt;Hi Turbo,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;That does not answer my question. Could you elaborate more on &amp;quot;cannot be safely handled&amp;quot;. Like I said, we do not mind losing the BLE link. The critical sections are working fine for us as well.&lt;/p&gt;
&lt;p&gt;Is there a way I can completely reinitialise the software from the point where assert is encountered.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Himanshu.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Graceful handling of softdevice asserts</title><link>https://devzone.nordicsemi.com/thread/168116?ContentTypeID=1</link><pubDate>Mon, 28 Jan 2019 00:39:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d463bec0-e361-4e1e-bec0-266024c9e872</guid><dc:creator>Turbo J</dc:creator><description>[quote userid="15741" url="~/f/nordic-q-a/43058/graceful-handling-of-softdevice-asserts"]We are implementing a critical section(disable/enable interrupts).[/quote]
&lt;p&gt;Don&amp;#39;t do that - softdevice interrups can be very timing critical. Either use timeslot API or disable the softdevice altogether.&lt;/p&gt;
&lt;p&gt;And no, those asserts cannot be safely handled without a device reset.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>