<?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>Question about critical code region differences</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/97103/question-about-critical-code-region-differences</link><description>Due to backward compatibility requirements I am working with mainly S110 on nRF51 and using parts of the SDK10. I have run into problem with what I suspect is a critical code region. When I have an active BLE connection during which I push data to a FIFO</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 27 Feb 2023 13:12:53 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/97103/question-about-critical-code-region-differences" /><item><title>RE: Question about critical code region differences</title><link>https://devzone.nordicsemi.com/thread/412276?ContentTypeID=1</link><pubDate>Mon, 27 Feb 2023 13:12:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:474b0ca3-2fb2-4e3b-a730-e7ac361fc926</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user=""]From studying the critical region on S110 I can see that it just disables all interrupts globally and reenables them on exit. My suspicion is that this causes S110 to be delayed due to TIMER0 IRQs being blocked and thus missing its BLE deadlines.&amp;nbsp;[/quote]
&lt;p&gt;In nRF51 SDK v10, there is a SVCall to the softdevice to handle interrupts. What this will do is to disable all interrupts that belongs to the application, while keeping RADIO/RTC/TIMER active (ie. the SoftDevice owned vectors).&lt;/p&gt;
&lt;p&gt;In newer SDK versions, this has been moved to the application side, as a SVCall has significant overhead (in the order of &amp;gt;10 microseconds).&lt;/p&gt;
&lt;p&gt;It does the exact same thing in newer versions, which is to effectively disable all &lt;em&gt;application&lt;/em&gt; interrupts, while keeping softdevice interrupts still enabled.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you see that a CRITICAL_REGION_ENTER/EXIT effectively goes to __disable_irq/__enable_irq, then it sounds like your project does not have the &amp;quot;SOFTDEVICE_PRESENT&amp;quot; define set. Could you double-check this?&lt;/p&gt;
[quote user=""]Is there anything stopping me from using that implementation on the nRF51?[/quote]
&lt;p&gt;SDK v11 and newer has this implementation, no need to jump as high as v17.&lt;/p&gt;
&lt;p&gt;Please note that nRF51 is supported up to nRF5 SDK v12.3:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/comp_matrix_nrf51/COMP/nrf51/nRF51422_nRF51822_ic_rev_sdk_sd_comp_matrix.html?cp=6_0_5"&gt;https://infocenter.nordicsemi.com/topic/comp_matrix_nrf51/COMP/nrf51/nRF51422_nRF51822_ic_rev_sdk_sd_comp_matrix.html?cp=6_0_5&lt;/a&gt;&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>