<?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>Questions regarding interrupts level in nRF52840 chip</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/36733/questions-regarding-interrupts-level-in-nrf52840-chip</link><description>Hello, 
 
 I&amp;#39;m integrating mesh and freeRTOS and having problems with interrupts priorities on both sides. It&amp;#39;s a little bit confusing to set the interrupt priority on each side so I&amp;#39;m trying to understand how the mesh interrupts are set and handled thus</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 26 Jul 2018 12:27:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/36733/questions-regarding-interrupts-level-in-nrf52840-chip" /><item><title>RE: Questions regarding interrupts level in nRF52840 chip</title><link>https://devzone.nordicsemi.com/thread/141519?ContentTypeID=1</link><pubDate>Thu, 26 Jul 2018 12:27:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:141ac609-4b38-444f-be09-c8ff3cd4560c</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;
[quote user=""]1 - The number of bits used to define priority in the chip are set to 3&amp;nbsp; (__NVIC_PRIO_BITS), this means that an interrupt can have a priority from 0 to 7! assuming sub-priority is not using since I couldn&amp;#39;t fin any information about it in the datasheet, is that correct ?[/quote]
&lt;p&gt;This corresponds to the NVIC interrupt priorities available in the hardware core of the Cortex M4 CPU, which are from 0 (highest priority) to 7 (lowest priority). Information related to the CPU core can be found on ARMs infocenter:&amp;nbsp;&lt;a href="http://infocenter.arm.com/help/topic/com.arm.doc.100166_0001_00_en/index.html"&gt;http://infocenter.arm.com/help/topic/com.arm.doc.100166_0001_00_en/index.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]2- I read in the forum that&amp;nbsp;the mesh application thread can be set to&amp;nbsp;NRF_MESH_IRQ_PRIORITY_LOWEST(7) or NRF_MESH_IRQ_PRIORITY_THREAD(15). What&amp;#39;s the relation between these values and the&amp;nbsp;hardware interrupt priorities in the first question ?[/quote]
&lt;p&gt;The difference between the two is that NRF_MES_IRQ_PRIORITY_LOWEST is running in interrupt context, with priority level 7. This means that it will interrupt a function running in main-context (ie: your main while loop), but not any other interrupt priorities (from 6 to 0).&lt;/p&gt;
&lt;p&gt;NRF_MESH_IRQ_PRIORITY_THREAD is the same as running a function in your main-loop (thread and main is the same).&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: Questions regarding interrupts level in nRF52840 chip</title><link>https://devzone.nordicsemi.com/thread/141342?ContentTypeID=1</link><pubDate>Wed, 25 Jul 2018 13:41:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c06d5112-fb79-47a1-a70c-2f1d7e2b8cea</guid><dc:creator>Chaabane</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Any feedback on my request ?&lt;/p&gt;
&lt;p&gt;Thx&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>