<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Disabling Global Interrupts inside ISR in S32K</title>
    <link>https://community.nxp.com/t5/S32K/Disabling-Global-Interrupts-inside-ISR/m-p/1441199#M14862</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;we have an application (S32K118 - Cortex-M0+) where a few parameters can be changed upon the request via CAN or UART. The requests set the global variables inside the Receive ISR.&lt;BR /&gt;Subsequently, the highest priority (lowest importance) PIT Timer ISR reads those variables. To ensure the data integrity we want to temporarily switch off ALL the Interrupts while reading the global variables inside Timer ISR. Is it safe/recommended to use&amp;nbsp;DISABLE_INTERRUPTS() just before reading globals inside Timer ISR and to call&amp;nbsp;ENABLE_INTERRUPTS() just after the reading - to make a kind of 'critical section' this way ?&lt;/P&gt;&lt;P&gt;What about memory and instruction barriers like&amp;nbsp; __DSB() and __ISB() - should we use them (it's Cortex-M0+) in this case ?&lt;BR /&gt;Will it change if we would like to switch off only particular Interrupts (like CAN receive interrupt) ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;Are there any differences if we want to apply above solution in case of i.MX RT (Cortex-M7) ?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Maciek&lt;/P&gt;</description>
    <pubDate>Fri, 08 Apr 2022 09:42:46 GMT</pubDate>
    <dc:creator>Maciek</dc:creator>
    <dc:date>2022-04-08T09:42:46Z</dc:date>
    <item>
      <title>Disabling Global Interrupts inside ISR</title>
      <link>https://community.nxp.com/t5/S32K/Disabling-Global-Interrupts-inside-ISR/m-p/1441199#M14862</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;we have an application (S32K118 - Cortex-M0+) where a few parameters can be changed upon the request via CAN or UART. The requests set the global variables inside the Receive ISR.&lt;BR /&gt;Subsequently, the highest priority (lowest importance) PIT Timer ISR reads those variables. To ensure the data integrity we want to temporarily switch off ALL the Interrupts while reading the global variables inside Timer ISR. Is it safe/recommended to use&amp;nbsp;DISABLE_INTERRUPTS() just before reading globals inside Timer ISR and to call&amp;nbsp;ENABLE_INTERRUPTS() just after the reading - to make a kind of 'critical section' this way ?&lt;/P&gt;&lt;P&gt;What about memory and instruction barriers like&amp;nbsp; __DSB() and __ISB() - should we use them (it's Cortex-M0+) in this case ?&lt;BR /&gt;Will it change if we would like to switch off only particular Interrupts (like CAN receive interrupt) ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;Are there any differences if we want to apply above solution in case of i.MX RT (Cortex-M7) ?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Maciek&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2022 09:42:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Disabling-Global-Interrupts-inside-ISR/m-p/1441199#M14862</guid>
      <dc:creator>Maciek</dc:creator>
      <dc:date>2022-04-08T09:42:46Z</dc:date>
    </item>
    <item>
      <title>Re: Disabling Global Interrupts inside ISR</title>
      <link>https://community.nxp.com/t5/S32K/Disabling-Global-Interrupts-inside-ISR/m-p/1441381#M14880</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/12402"&gt;@Maciek&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;I don't see any issue with that.&lt;/P&gt;
&lt;P&gt;The interrupt can be preempted only by an interrupt with a higher priority.&lt;/P&gt;
&lt;P&gt;So, you can mask the interrupt globally as you mentioned.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regarding the barriers, please refer to this document:&lt;/P&gt;
&lt;P&gt;ARM Cortex ™ -M Programming Guide to Memory Barrier Instructions Application Note 321&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation-service.arm.com/static/5efefb97dbdee951c1cd5aaf?token=" target="_blank"&gt;https://documentation-service.arm.com/static/5efefb97dbdee951c1cd5aaf?token=&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;4.8 Disabling interrupts using CPS and MSR instructions&lt;BR /&gt;4.7 Enabling interrupts using CPS instructions and MSR instructions&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are no errata related to this:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.nxp.com/docs/en/errata/S32K118_0N97V.pdf" target="_blank"&gt;https://www.nxp.com/docs/en/errata/S32K118_0N97V.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not familiar with i.MX RT, please create a new thread on the i.MX RT community.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2022 15:02:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Disabling-Global-Interrupts-inside-ISR/m-p/1441381#M14880</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2022-04-08T15:02:43Z</dc:date>
    </item>
  </channel>
</rss>

