<?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>SEVONPEND flag and high interrupt priorities</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/14026/sevonpend-flag-and-high-interrupt-priorities</link><description>There&amp;#39;s a note in the migration guide which says .. very ominously ... 
 Applications must not modify the SEVONPEND flag in the SCR register when running in priority level 1 for s130 and priority levels 2 or 3 for s132. 
 Two questions 
 
 Why? Some</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 24 May 2016 07:44:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/14026/sevonpend-flag-and-high-interrupt-priorities" /><item><title>RE: SEVONPEND flag and high interrupt priorities</title><link>https://devzone.nordicsemi.com/thread/53625?ContentTypeID=1</link><pubDate>Tue, 24 May 2016 07:44:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c89e4d6-3cad-4d4e-8dd5-65bf4bf41d7e</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;temporarily using BASEPRI equal to SVC should be safe. So your use case is not in conflict with anything :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SEVONPEND flag and high interrupt priorities</title><link>https://devzone.nordicsemi.com/thread/53624?ContentTypeID=1</link><pubDate>Tue, 24 May 2016 07:32:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c90dfd7-b953-41fc-acd4-bee52e9b68b0</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;@aryan - thanks. That&amp;#39;s fine then, my use-case still works safely. I&amp;#39;m doing something similar, using BASEPRI to block interrupts for a critical section around a low power sleep but letting the softdevice critical interrupts stay unblocked. In order to that you have to use WFE with SEVONPEND set or you don&amp;#39;t wake up on the lower priority interrupts.&lt;/p&gt;
&lt;p&gt;The alternative is to set PRIMASK, clear BASEPRI, use WFI for sleep and &lt;em&gt;quickly&lt;/em&gt; set BASEPRI then clear PRIMASK when WFI returns to let the softdevice critical interupt run. That delays the interrupt by just a few cycles, but I prefer not to have it blocked at all if possible.&lt;/p&gt;
&lt;p&gt;Good I can leave the code like it is.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SEVONPEND flag and high interrupt priorities</title><link>https://devzone.nordicsemi.com/thread/53623?ContentTypeID=1</link><pubDate>Tue, 24 May 2016 07:15:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c1fae8f1-05a6-42d0-9592-6e3379bf1a68</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi RK,&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;There are few SVC calls that sets SEVONPEND flag in SCR waits for some hardware events by going to sleep (__WFE) without enabling the interrupts. So if you are in higher priority than SVC (priority 1 in S130 , priority 2 or 3 in S132) and if you disable this flag then there is a possibility that the softdevice will worst case sleep forever (or sleep long enough to fail its real time constraints and assert)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Thread mode is the least priority. This restriction does not apply to contexts with lower priority than or equal to SVC. Because in these lower priorities, app cannot interrupt softdevice (and hence cannot disable this flag) until it wakes from the hardware event it is waiting on.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>