<?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>Configure freeRTOS from SDK 17.0.2 to correctly call sd_nvic_critical_region_enter() rather than vPortEnterCritical() when using the softdevice s112</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/77793/configure-freertos-from-sdk-17-0-2-to-correctly-call-sd_nvic_critical_region_enter-rather-than-vportentercritical-when-using-the-softdevice-s112</link><description>Hi... 
 
 I am using Nordic SDK V17.0.2 with a SoftDevice S112 and developing a project uses freeRTOS that came with this SDK 
 
 From reading the documentation about the soft device, I see that I should be using these APIs to enter/exit critical region</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 23 Jul 2021 11:39:38 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/77793/configure-freertos-from-sdk-17-0-2-to-correctly-call-sd_nvic_critical_region_enter-rather-than-vportentercritical-when-using-the-softdevice-s112" /><item><title>RE: Configure freeRTOS from SDK 17.0.2 to correctly call sd_nvic_critical_region_enter() rather than vPortEnterCritical() when using the softdevice s112</title><link>https://devzone.nordicsemi.com/thread/321548?ContentTypeID=1</link><pubDate>Fri, 23 Jul 2021 11:39:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:784d5e2e-5a07-4fa1-811c-96862ce2a101</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Ray&lt;/p&gt;
&lt;p&gt;The&amp;nbsp;&lt;em&gt;portDISABLE_INTERRUPTS()&lt;/em&gt; call basically sets the BASEPRI register to block any interrupts below a certain priority.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The critical thing here is what interrupt level you set the limit to, which is defined by the&amp;nbsp;configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY define in FreeRTOSConfig.h:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/* The highest interrupt priority that can be used by any interrupt service
routine that makes calls to interrupt safe FreeRTOS API functions.  DO NOT CALL
INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
PRIORITY THAN THIS! (higher priorities are lower numeric values. */
#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY _PRIO_APP_HIGH&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;In our implementation this is set to _PRIO_APP_HIGH, which corresponds to level 2,&amp;nbsp;allowing&amp;nbsp;all critical SoftDevice interrupts to be executed even in a critical section (interrupts level 0 and 1 are reserved for the SoftDevice to handle critical radio and timing related events).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In other words there is nothing else you need to do in order to make&amp;nbsp;the FreeRTOS critical section SoftDevice aware.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>