<?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>BLE SDH observer interrupt level</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/91735/ble-sdh-observer-interrupt-level</link><description>We are using SDK15.0.0 and have products with both the NRF52832 and NRF52840 sharing the vast majority of code between them. The softdevices we use are S132 and S140 at version 6.0.0 
 
 We have a BLE event handler registered as an observer as follows</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 07 Sep 2022 13:41:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/91735/ble-sdh-observer-interrupt-level" /><item><title>RE: BLE SDH observer interrupt level</title><link>https://devzone.nordicsemi.com/thread/385050?ContentTypeID=1</link><pubDate>Wed, 07 Sep 2022 13:41:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c1baff96-fb81-4775-94dd-127bdb3d2d18</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You are right that there are different interrupt priorities for the SD_EVT SWI between some SoftDevices, and there was also a mismatch with what was used by the SoftDevice and what was documented in the SoftDevice specification (this was a bug). In SDK 15.0.0 there is code manipulating&amp;nbsp;this in&amp;nbsp;&lt;code&gt;swi_interrupt_priority_workaround()&lt;/code&gt; in &amp;lt;SDK15.0.0&amp;gt;\components\softdevice\common\nrf_sdh.c for all SoftDevices except S140, which sets the priority to 7. This was changed in SDK 15.2, and you can find a brief mention of it in the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.2.0/index.html"&gt;release notes&lt;/a&gt;:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;Removed the workaround in nrf_sdh.c overriding the default priority level on SWI interrupt SD_EVT_IRQn and RADIO_NOTIFICATION_IRQn used by the SoftDevice.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The SoftDevice priority is 6, and that is intentional. This is also mentioned in the release notes of SoftDevice S132 6.1.0:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;Fixed documentation for SD_EVT_IRQHandler and RADIO_NOTIFICATION_IRQHandler, where the default interrupt priority was documented incorrectly (DRGN-10174).&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;So, for the questions:&lt;/p&gt;
[quote user=""]1) Is this difference in behaviour intentional? If not what might be the factors involved in determining the interrupt priority?[/quote]
&lt;p&gt;No. It was a bug. The priority should have been 6.&lt;/p&gt;
[quote user=""]2) Is there a recommended/official way to configure the interrupt level these events will come from?[/quote]
&lt;p&gt;You can use&amp;nbsp;sd_nvic_SetPriority() to change the interrupt priorities of the SoftDevice, as done in the implementation of&amp;nbsp;swi_interrupt_priority_workaround(). This is not normally something you should do with the SoftDevice interrupts, though&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>