<?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>Kinetis MicrocontrollersのトピックRe: Will the KL17 allow higher priority interrupts to interrupt a lower priority interrupt?</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Will-the-KL17-allow-higher-priority-interrupts-to-interrupt-a/m-p/468656#M28307</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is more than one kind of 'interrupt level' or 'priority'.&amp;nbsp; The vector-table order defines what happens if more than one interrupt (of the same ARM priority) happen 'at once' -- lower would take precedence.&amp;nbsp; However, the NVIC implements the IPR Interrupt Priority Registers of ARM priority, which in this incarnation of the ARM architecture has two bits per interrupt for four complete levels of priority.&amp;nbsp; Higher priority interrupts (those with lower IPR numbers) can interrupt already-executing lower priority interrupt routines.&amp;nbsp; When an interrupt happens, its priority from IPR is copied to BASEPRI and that defines what higher priority must be presented to re-interrupt.&amp;nbsp; As related to another of your questions, yes CPSID/E i DOES work with PRIMASK LSB to disable/enable ALL 'configurable priority interrupts', which includes not only all from NVIC but some system interrupts as well, like SYSTICK.&amp;nbsp; You can read/write PRIMASK, and the CMSIS 'compiler extentions' for direct access are listed in section 3.2 of the M0+ user-guide linked below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BUT the 'priority level' process allows the user to mask just SOME interrupts by writing to BASEPRI (available only on M3 and M4-core implementations -- sorry, the M0+ core of the KL family does NOT have this):&lt;/P&gt;&lt;P data-canvas-width="189.76423137583893" style="font-size: 14.3607px; font-family: sans-serif;"&gt;&lt;STRONG&gt;Base Priority Mask Register&lt;/STRONG&gt;&lt;/P&gt;&lt;P data-canvas-width="308.52684742953016" style="font-size: 15.8926px; font-family: serif;"&gt;&lt;STRONG&gt;The &lt;SPAN class="highlight"&gt;BASEPRI&lt;/SPAN&gt; register defines the minimum priority for exception processing. When &lt;SPAN class="highlight"&gt;BASEPRI&lt;/SPAN&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P data-canvas-width="187.7752499798658" style="font-size: 15.8926px; font-family: serif;"&gt;&lt;STRONG&gt;is set to a nonzero value, it prevents the activation of all exceptions with the same or lower &lt;/STRONG&gt;&lt;/P&gt;&lt;P data-canvas-width="223.69559224832219" style="font-size: 15.8926px; font-family: serif;"&gt;&lt;STRONG&gt;priority level as the &lt;SPAN class="highlight"&gt;BASEPRI&lt;/SPAN&gt; value.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use this, for instance, to prevent execution of critical interrupt handlers only in VERY LIMITED circumstances where there might be a conflict, knowing that other things one might not want to be generally interruptable will tolerate these CRITICAL hits -- in one case FTM-module encoder-rollover-interrupt where I MUST 'very quickly' get a read of the overflow direction to insure proper counter-extension handling.&amp;nbsp; &lt;SPAN style="text-decoration: underline;"&gt;That&lt;/SPAN&gt; I set to the highest priority, and all other sources 'less'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Most of this 'very basic ARM architecture stuff' is 'minimally documented' in NXP literature -- refer to ARM itself for details -- like:&lt;/P&gt;&lt;P&gt;&lt;A href="http://infocenter.arm.com/help/topic/com.arm.doc.ddi0484b/DDI0484B_cortex_m0p_r0p0_trm.pdf" title="http://infocenter.arm.com/help/topic/com.arm.doc.ddi0484b/DDI0484B_cortex_m0p_r0p0_trm.pdf"&gt;http://infocenter.arm.com/help/topic/com.arm.doc.ddi0484b/DDI0484B_cortex_m0p_r0p0_trm.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://infocenter.arm.com/help/topic/com.arm.doc.dui0662b/DUI0662B_cortex_m0p_r0p1_dgug.pdf" title="http://infocenter.arm.com/help/topic/com.arm.doc.dui0662b/DUI0662B_cortex_m0p_r0p1_dgug.pdf"&gt;http://infocenter.arm.com/help/topic/com.arm.doc.dui0662b/DUI0662B_cortex_m0p_r0p1_dgug.pdf&lt;/A&gt;&amp;nbsp; but&lt;/P&gt;&lt;P&gt;A particular description of the NVIC is here, albeit specific to the M1 but extensible to this M0+ device:&lt;/P&gt;&lt;P&gt;&lt;A href="http://infocenter.arm.com/help/topic/com.arm.doc.dai0211a/DAI0211A_interrupt_behaviour_of_cortexm1.pdf" title="http://infocenter.arm.com/help/topic/com.arm.doc.dai0211a/DAI0211A_interrupt_behaviour_of_cortexm1.pdf"&gt;http://infocenter.arm.com/help/topic/com.arm.doc.dai0211a/DAI0211A_interrupt_behaviour_of_cortexm1.pdf&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Apr 2016 01:57:40 GMT</pubDate>
    <dc:creator>egoodii</dc:creator>
    <dc:date>2016-04-22T01:57:40Z</dc:date>
    <item>
      <title>Will the KL17 allow higher priority interrupts to interrupt a lower priority interrupt?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Will-the-KL17-allow-higher-priority-interrupts-to-interrupt-a/m-p/468655#M28306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Someone here said the KL17 interrupt priority only decides which interrupt is executed first.&amp;nbsp; That if the KL17 was in the middle of an interrupt the KL17 would disable all other interrupts until the current interrupt returned.&amp;nbsp; Even higher level interrupts.&amp;nbsp; Is that true?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Apr 2016 22:37:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Will-the-KL17-allow-higher-priority-interrupts-to-interrupt-a/m-p/468655#M28306</guid>
      <dc:creator>rickstuart</dc:creator>
      <dc:date>2016-04-21T22:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: Will the KL17 allow higher priority interrupts to interrupt a lower priority interrupt?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Will-the-KL17-allow-higher-priority-interrupts-to-interrupt-a/m-p/468656#M28307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is more than one kind of 'interrupt level' or 'priority'.&amp;nbsp; The vector-table order defines what happens if more than one interrupt (of the same ARM priority) happen 'at once' -- lower would take precedence.&amp;nbsp; However, the NVIC implements the IPR Interrupt Priority Registers of ARM priority, which in this incarnation of the ARM architecture has two bits per interrupt for four complete levels of priority.&amp;nbsp; Higher priority interrupts (those with lower IPR numbers) can interrupt already-executing lower priority interrupt routines.&amp;nbsp; When an interrupt happens, its priority from IPR is copied to BASEPRI and that defines what higher priority must be presented to re-interrupt.&amp;nbsp; As related to another of your questions, yes CPSID/E i DOES work with PRIMASK LSB to disable/enable ALL 'configurable priority interrupts', which includes not only all from NVIC but some system interrupts as well, like SYSTICK.&amp;nbsp; You can read/write PRIMASK, and the CMSIS 'compiler extentions' for direct access are listed in section 3.2 of the M0+ user-guide linked below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BUT the 'priority level' process allows the user to mask just SOME interrupts by writing to BASEPRI (available only on M3 and M4-core implementations -- sorry, the M0+ core of the KL family does NOT have this):&lt;/P&gt;&lt;P data-canvas-width="189.76423137583893" style="font-size: 14.3607px; font-family: sans-serif;"&gt;&lt;STRONG&gt;Base Priority Mask Register&lt;/STRONG&gt;&lt;/P&gt;&lt;P data-canvas-width="308.52684742953016" style="font-size: 15.8926px; font-family: serif;"&gt;&lt;STRONG&gt;The &lt;SPAN class="highlight"&gt;BASEPRI&lt;/SPAN&gt; register defines the minimum priority for exception processing. When &lt;SPAN class="highlight"&gt;BASEPRI&lt;/SPAN&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P data-canvas-width="187.7752499798658" style="font-size: 15.8926px; font-family: serif;"&gt;&lt;STRONG&gt;is set to a nonzero value, it prevents the activation of all exceptions with the same or lower &lt;/STRONG&gt;&lt;/P&gt;&lt;P data-canvas-width="223.69559224832219" style="font-size: 15.8926px; font-family: serif;"&gt;&lt;STRONG&gt;priority level as the &lt;SPAN class="highlight"&gt;BASEPRI&lt;/SPAN&gt; value.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use this, for instance, to prevent execution of critical interrupt handlers only in VERY LIMITED circumstances where there might be a conflict, knowing that other things one might not want to be generally interruptable will tolerate these CRITICAL hits -- in one case FTM-module encoder-rollover-interrupt where I MUST 'very quickly' get a read of the overflow direction to insure proper counter-extension handling.&amp;nbsp; &lt;SPAN style="text-decoration: underline;"&gt;That&lt;/SPAN&gt; I set to the highest priority, and all other sources 'less'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Most of this 'very basic ARM architecture stuff' is 'minimally documented' in NXP literature -- refer to ARM itself for details -- like:&lt;/P&gt;&lt;P&gt;&lt;A href="http://infocenter.arm.com/help/topic/com.arm.doc.ddi0484b/DDI0484B_cortex_m0p_r0p0_trm.pdf" title="http://infocenter.arm.com/help/topic/com.arm.doc.ddi0484b/DDI0484B_cortex_m0p_r0p0_trm.pdf"&gt;http://infocenter.arm.com/help/topic/com.arm.doc.ddi0484b/DDI0484B_cortex_m0p_r0p0_trm.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://infocenter.arm.com/help/topic/com.arm.doc.dui0662b/DUI0662B_cortex_m0p_r0p1_dgug.pdf" title="http://infocenter.arm.com/help/topic/com.arm.doc.dui0662b/DUI0662B_cortex_m0p_r0p1_dgug.pdf"&gt;http://infocenter.arm.com/help/topic/com.arm.doc.dui0662b/DUI0662B_cortex_m0p_r0p1_dgug.pdf&lt;/A&gt;&amp;nbsp; but&lt;/P&gt;&lt;P&gt;A particular description of the NVIC is here, albeit specific to the M1 but extensible to this M0+ device:&lt;/P&gt;&lt;P&gt;&lt;A href="http://infocenter.arm.com/help/topic/com.arm.doc.dai0211a/DAI0211A_interrupt_behaviour_of_cortexm1.pdf" title="http://infocenter.arm.com/help/topic/com.arm.doc.dai0211a/DAI0211A_interrupt_behaviour_of_cortexm1.pdf"&gt;http://infocenter.arm.com/help/topic/com.arm.doc.dai0211a/DAI0211A_interrupt_behaviour_of_cortexm1.pdf&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Apr 2016 01:57:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Will-the-KL17-allow-higher-priority-interrupts-to-interrupt-a/m-p/468656#M28307</guid>
      <dc:creator>egoodii</dc:creator>
      <dc:date>2016-04-22T01:57:40Z</dc:date>
    </item>
  </channel>
</rss>

