<?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>Get Tick Count From ISR</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/61973/get-tick-count-from-isr</link><description>Hi, 
 
 I have an issue of watchdog in my application. 
 
 I think it may occur due to an interrupt (NFC trigger), which calls the function xTaskGetTickCount () instead of xTaskGetTickCountFromISR (), while other task already entered the critical section</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 05 Jun 2020 13:14:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/61973/get-tick-count-from-isr" /><item><title>RE: Get Tick Count From ISR</title><link>https://devzone.nordicsemi.com/thread/253554?ContentTypeID=1</link><pubDate>Fri, 05 Jun 2020 13:14:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a2421ab-84c4-4290-ad6a-10de4f83c56f</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;It disables the application-specific interrupts without touch the softdevice reserved interrupts&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get Tick Count From ISR</title><link>https://devzone.nordicsemi.com/thread/253236?ContentTypeID=1</link><pubDate>Thu, 04 Jun 2020 10:17:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:df10015a-efbd-4244-94b8-da41bb6f7bdc</guid><dc:creator>Roei</dc:creator><description>&lt;p&gt;Thanks!&lt;/p&gt;
&lt;p&gt;Can you please explain how&amp;nbsp;&lt;span style="background-color:#ffffff;color:#11171a;float:none;font-family:&amp;#39;GT Eesti&amp;#39;,&amp;#39;Helvetica&amp;#39;,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;line-height:1.5em;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;portSET_INTERRUPT_MASK_FROM_ISR&lt;/span&gt; helps us with critical sections?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get Tick Count From ISR</title><link>https://devzone.nordicsemi.com/thread/253234?ContentTypeID=1</link><pubDate>Thu, 04 Jun 2020 10:15:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f09381f-3be5-461c-957f-7fb94be0b65f</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;All FromISR based functions that push the context to a queue does not need any critical sections while pushing onto the queue. The rest of the FromISR functions that are synchronous do use critical sections using&amp;nbsp;portSET_INTERRUPT_MASK_FROM_ISR&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get Tick Count From ISR</title><link>https://devzone.nordicsemi.com/thread/253031?ContentTypeID=1</link><pubDate>Wed, 03 Jun 2020 13:18:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:760b21a8-9f35-42bf-8c1f-f4f60d9dd22e</guid><dc:creator>Roei</dc:creator><description>&lt;p&gt;I&amp;#39;ve noticed that FromISR functions don&amp;#39;t use critical sections.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Isn&amp;#39;t that problematic?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get Tick Count From ISR</title><link>https://devzone.nordicsemi.com/thread/252982?ContentTypeID=1</link><pubDate>Wed, 03 Jun 2020 11:57:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e83c1f2a-2c7e-4d04-a334-217b04b9021c</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;You should do something like below in your app&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;if (__get_IPSR() != 0)
{
    xTaskGetTickCountFromISR()
} else 
{
    xTaskGetTickCount();
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get Tick Count From ISR</title><link>https://devzone.nordicsemi.com/thread/252903?ContentTypeID=1</link><pubDate>Wed, 03 Jun 2020 07:07:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ebd8b4a5-62cd-4d1a-90d8-30113e2ef0a2</guid><dc:creator>Roei</dc:creator><description>&lt;p&gt;Sure.&lt;/p&gt;
&lt;p&gt;We are talking about event which triggers&amp;nbsp;&lt;span style="background-color:#ffffff;"&gt;NFC_T2T_EVENT_FIELD_ON&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;After that, my application writes an event, stops current advertising, perform some checks and start new advertising.&lt;/p&gt;
&lt;p&gt;One of the checks is that&amp;nbsp;&lt;span style="background-color:#ffffff;color:#11171a;float:none;font-family:&amp;#39;GT Eesti&amp;#39;,&amp;#39;Helvetica&amp;#39;,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;xTaskGetTickCount&lt;/span&gt; is under a specific value.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In that case, I think I need to use&amp;nbsp;&lt;span style="background-color:#ffffff;color:#11171a;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;xTaskGetTickCountFromISR&lt;/span&gt;&lt;span style="background-color:#ffffff;color:#11171a;float:none;font-family:&amp;#39;GT Eesti&amp;#39;,&amp;#39;Helvetica&amp;#39;,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;line-height:1.5em;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;()&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get Tick Count From ISR</title><link>https://devzone.nordicsemi.com/thread/252892?ContentTypeID=1</link><pubDate>Wed, 03 Jun 2020 06:29:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:726ac951-0fb8-4ff5-898b-5c25cb417ea3</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Can you please give me more context of the callstack that calls&amp;nbsp;&lt;span&gt;xTaskGetTickCount inside an interrupt? Is this Nordic SDK code or application specific code?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>