<?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>Is it possible to set BLE and FDS&amp;#39;s interrupt priorities separately?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/78144/is-it-possible-to-set-ble-and-fds-s-interrupt-priorities-separately</link><description>Hi everyone, 
 
 Hope you are doing well! 
 
 I am using BLE and FDS simutinuously but since they share the same interrupt priority (SD_EVT_IRQn = 4), fds events will be blocked if they are triggered within ble interrupts. 
 
 One way to solve this issure</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 05 Aug 2021 06:34:23 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/78144/is-it-possible-to-set-ble-and-fds-s-interrupt-priorities-separately" /><item><title>RE: Is it possible to set BLE and FDS's interrupt priorities separately?</title><link>https://devzone.nordicsemi.com/thread/323437?ContentTypeID=1</link><pubDate>Thu, 05 Aug 2021 06:34:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b8e6b437-1899-46e5-969e-19e521c3c9e3</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;what you are trying to do in the pseudocode and the main discussion of the thread seems to have diverged.&lt;/p&gt;
&lt;p&gt;I thought that the discussion of this thread is about priorities in how BLE and FDS events are handled and not the priority of new FDS procedure request.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is it possible to set BLE and FDS's interrupt priorities separately?</title><link>https://devzone.nordicsemi.com/thread/323419?ContentTypeID=1</link><pubDate>Thu, 05 Aug 2021 00:32:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ea5414ab-b1c1-41b8-9a50-1dcbf97420c3</guid><dc:creator>RJ Fang</dc:creator><description>&lt;p&gt;I have tried that but it didn&amp;#39;t solve my issue. So specifically I am trying to call fds_write inside a ble interrupt handler:&lt;/p&gt;
&lt;p&gt;on_write(data from ble)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; fds_write(data from ble);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;The on_write() function is the handler for ble writing event. If I chagned the priority like you said, will this function working theoretically?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is it possible to set BLE and FDS's interrupt priorities separately?</title><link>https://devzone.nordicsemi.com/thread/323354?ContentTypeID=1</link><pubDate>Wed, 04 Aug 2021 13:54:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ed62e6ce-4a59-4c48-8182-334b2f35e33b</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;change&amp;nbsp;&lt;span&gt;NRF_SDH_SOC_STACK_OBSERVER_PRIO&amp;nbsp;from 0 to 1 if you think that fstorage events should be pulled first from the item queue even if ble event arrived first.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is it possible to set BLE and FDS's interrupt priorities separately?</title><link>https://devzone.nordicsemi.com/thread/323323?ContentTypeID=1</link><pubDate>Wed, 04 Aug 2021 12:46:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:79d08d22-202b-474a-8c04-9009a3a16e0d</guid><dc:creator>RJ Fang</dc:creator><description>&lt;p&gt;Hi Susheel,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for your reply! Could you please specify what should I do if I want to set FDS&amp;#39;s interrupt priority higher then BLE&amp;#39;s priority?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is it possible to set BLE and FDS's interrupt priorities separately?</title><link>https://devzone.nordicsemi.com/thread/323090?ContentTypeID=1</link><pubDate>Tue, 03 Aug 2021 12:15:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:94030987-9746-46ff-81bd-d2c1f0876b1b</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi Fang,&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v17.0.2%2Flib_fds.html"&gt;FDS&lt;/a&gt; uses &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v17.0.2%2Flib_fstorage.html&amp;amp;cp=8_1_3_17"&gt;fstorage&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Inside nrf_fstorage_sd.c you can see that it uses SDH observer priority of 0.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;NRF_SDH_SOC_OBSERVER(m_sys_obs, 0, nrf_fstorage_sys_evt_handler, NULL);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;and in the SDK config you can see that&amp;nbsp;NRF_SDH_SOC_STACK_OBSERVER_PRIO is also set to 0. These are software priorities based on the same interrupt line&amp;nbsp;SWI2_IRQn that are used by softdevice to notify both BLE/ANT and also fstorage events.&lt;/p&gt;
&lt;p&gt;These events are queued inside softdevice and these software priorities only define the order in which the handlers for these events are called. In your case, the BLE events and Fstorage events are of same priority, so if BLE events comes first in the queue they are processed first and if fstorage events comes first in the queue, they are processed first delaying the BLE event processing. If you want to change this behavior, you need to change the priorities of these as to how you want priority preference between BLE and fstorage events.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>