<?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>nrf52 disable interrupt below a certain level</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/58884/nrf52-disable-interrupt-below-a-certain-level</link><description>My goal is that disabling the interrupts other than soft device interrupt. 
 I think that this is achieved by d isabling interrupts below a certain level (in this case, 2?), is this possible? 
 Or I suppose that to set the current interrupt priority state</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 10 Mar 2020 08:47:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/58884/nrf52-disable-interrupt-below-a-certain-level" /><item><title>RE: nrf52 disable interrupt below a certain level</title><link>https://devzone.nordicsemi.com/thread/239006?ContentTypeID=1</link><pubDate>Tue, 10 Mar 2020 08:47:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:577e2ba8-8e7b-4e05-bd2e-ac23cbac6483</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Glad to hear that you found the source of the initial issue.&lt;/p&gt;
[quote user="kodama521"]I thought that the cause of the error handler&amp;nbsp; is called is that some of the important interrupts of softdevice or anything else modules are disabled for a long time, is it correct?[/quote]
&lt;p&gt;I know that you&amp;#39;re already found this issue, but: this is a side-effect of when you&amp;#39;re re-enabling interrupts again where you get many events triggered at the same time.&lt;/p&gt;
&lt;p&gt;The softdevice has a predictive order of events, and when things happen out-of-order, it detects and asserts.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;[quote user="kodama521"][/quote]&lt;/p&gt;
&lt;p&gt;If so, I thought that disabling interrupts below a certain level is one of the best solution, but I couldn&amp;#39;t find the corresponding API.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;There is no API for this, you need to parse each interrupt and check manually.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="kodama521"]change current interrupt level[/quote]
&lt;p&gt;&amp;nbsp;Do you mean exit the interrupt handler? I am not sure I understand really what you want to obtain here.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 disable interrupt below a certain level</title><link>https://devzone.nordicsemi.com/thread/238995?ContentTypeID=1</link><pubDate>Tue, 10 Mar 2020 08:10:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77ae1986-2b33-4a14-b9d6-24b20d7a77e8</guid><dc:creator>k.k</dc:creator><description>&lt;p&gt;The problem has solved, the cause is our software bug (SOFTDEVICE_PRESENT definition is disabled.).&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks to your advice, I tried to watch inside the CRITICAL_REGION_ENTER function and could find this bug. Thank you so much.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;But I still want to know how to realize following 2 methods;&lt;/span&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span&gt;change current interrupt level&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;disable interrupt below a certain level&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 disable interrupt below a certain level</title><link>https://devzone.nordicsemi.com/thread/238967?ContentTypeID=1</link><pubDate>Tue, 10 Mar 2020 03:19:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:03158a43-54c0-4893-919c-001015cfdb14</guid><dc:creator>k.k</dc:creator><description>&lt;p&gt;I found that the error handler is from `sd_softdevice_enable` (the second argument callback function is called). If&amp;nbsp;&lt;span&gt;CRITICAL_REGION_ENTER/EXIT&amp;nbsp;is used and after&amp;nbsp;a certain period of time in this region, the error handler is called.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I thought that the cause of the error handler&amp;nbsp; is called is that some of the important interrupts of softdevice or anything else modules are disabled for a long time, is it correct?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;If so, I thought that disabling interrupts below a certain level is one of the best solution, but I couldn&amp;#39;t find the corresponding API.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 disable interrupt below a certain level</title><link>https://devzone.nordicsemi.com/thread/238817?ContentTypeID=1</link><pubDate>Mon, 09 Mar 2020 13:05:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1394dd8d-0c07-41aa-960e-bb487d7eacbb</guid><dc:creator>k.k</dc:creator><description>&lt;p&gt;When i used CRITICAL_REGION_ENTER/EXIT functions, and excecuted a little bit time consuming process in this region, an error handler from ble_stack was called. I want to do time consuming process without any interrups from peripherals.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 disable interrupt below a certain level</title><link>https://devzone.nordicsemi.com/thread/238797?ContentTypeID=1</link><pubDate>Mon, 09 Mar 2020 12:37:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f51d3be5-5e6d-4369-bf77-f5691d289c55</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>[quote user="kodama521"]but I want to allow only ble stack interrupt, so those functions can not be used.[/quote]
&lt;p&gt;The functions will disable all interrupt vectors that belong to the application, and keep the softdevice owned vectors still enabled.&lt;/p&gt;
&lt;p&gt;Isn&amp;#39;t this what you want?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 disable interrupt below a certain level</title><link>https://devzone.nordicsemi.com/thread/238784?ContentTypeID=1</link><pubDate>Mon, 09 Mar 2020 11:53:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8c96f226-d51f-409b-b9ac-9062f0eb4a7c</guid><dc:creator>k.k</dc:creator><description>&lt;p&gt;Thank you for your reply. &amp;nbsp;And sorry for the lack of information, but I want to allow only ble stack interrupt, so those functions can not be used.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 disable interrupt below a certain level</title><link>https://devzone.nordicsemi.com/thread/238778?ContentTypeID=1</link><pubDate>Mon, 09 Mar 2020 11:45:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d6f4793-82fd-4235-a9a6-d38aacf65921</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When the softdevice is present, you can use the macro&amp;#39;s&amp;nbsp;CRITICAL_REGION_ENTER and&amp;nbsp;CRITICAL_REGION_EXIT to disable all application interrupts.&lt;/p&gt;
&lt;p&gt;This macro will expand to call app_util_platform.c::app_util_critical_region_enter(), which will leave all softdevice interrupts still enabled.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>