<?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 Re: Nested ISRs with priorities in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Nested-ISRs-with-priorities/m-p/1534422#M15784</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Pls download the DSP56800EX core reference manual DSP56800ERM.pdf from the link:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.nxp.com/products/processors-and-microcontrollers/additional-mpu-mcus-architectures/digital-signal-controllers/32-bit-56f8xxxx-families/performance-level-digital-signal-controllers-usb-fs-otg-can-fd:MC56F83xxx" target="_blank"&gt;https://www.nxp.com/products/processors-and-microcontrollers/additional-mpu-mcus-architectures/digital-signal-controllers/32-bit-56f8xxxx-families/performance-level-digital-signal-controllers-usb-fs-otg-can-fd:MC56F83xxx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pls refer to section 9.3.1 Interrupt Priority Structure as following.&lt;/P&gt;
&lt;P&gt;If you set the priority of timer, for example set&amp;nbsp; TMRA_1 as 1, TMRA_1 as 2, you can not implement the nested interrupt, because when TA1 ISR is being executed, the CCPL bits will add 1 automatically, which forbids that the same priority ISR preempts it.&lt;/P&gt;
&lt;P&gt;You can set the TMRA_1 as 1, TMRA_1 as 3 to implement the nested interrupt.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="xiangjun_rong_0-1665301195688.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/196164iCA756F07C0ED921D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="xiangjun_rong_0-1665301195688.png" alt="xiangjun_rong_0-1665301195688.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Regarding the phenomenon that "Without this protection, Timer A1 ISR stops being called.", I suppose that TA2 period is 50uS, the period is too small, the TA2 will occupy all the source so that the TA1 has not opportunity to be executed.&lt;/P&gt;
&lt;P&gt;Pls try to set the period of TA2 as 50mS, TA1 500mS and have a try.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Every interrupt source has an associated priority level. For some interrupt sources, such as the SWI&lt;BR /&gt;instructions and non-maskable interrupts, the interrupt level is pre-assigned. Other interrupt sources, such&lt;BR /&gt;as on-chip peripherals, support a programmable priority level. Programmable interrupt sources other than&lt;BR /&gt;those in the debug port can be set to one of the maskable priority levels (0, 1, or 2) or be disabled.&lt;BR /&gt;Enhanced OnCE interrupt sources can be programmed as level 1, 2, or 3 or as disabled. The CCPL is set to&lt;BR /&gt;level 3 on reset.&lt;BR /&gt;When an exception or interrupt is recognized and the CCPL is low enough to allow it to be processed, the&lt;BR /&gt;CCPL is automatically updated to be one higher than the level of the interrupt (except for the case of&lt;BR /&gt;SWILP, which does not update the CCPL, or the case of level 3 interrupts, which leave the priority level at&lt;BR /&gt;level 3). This updating prevents interrupts that have the same or a lower priority level from interrupting the&lt;BR /&gt;handler for the current interrupt. When the interrupt service routine finishes, the CCPL is set back to its&lt;BR /&gt;original value.&lt;BR /&gt;To better understand the interrupt priority structure, consider a simple example with nested interrupts.&lt;BR /&gt;Assume that the following have already taken place:&lt;BR /&gt;1. A serial port on a chip has requested a level 1 interrupt when the core’s CCPL was at level 0.&lt;BR /&gt;2. The core has recognized this interrupt and entered the exception processing state. The&lt;BR /&gt;CCPL was updated from level 0 to level 2, which is one level higher than the priority of the&lt;BR /&gt;recognized interrupt (level 1).&lt;BR /&gt;3. Program flow has been transferred to the interrupt handler for the serial port.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope it can help you&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;XiangJun Rong&lt;/P&gt;</description>
    <pubDate>Sun, 09 Oct 2022 07:49:14 GMT</pubDate>
    <dc:creator>xiangjun_rong</dc:creator>
    <dc:date>2022-10-09T07:49:14Z</dc:date>
    <item>
      <title>Nested ISRs with priorities</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Nested-ISRs-with-priorities/m-p/1531366#M15782</link>
      <description>&lt;P&gt;I am developing app on MC56F83000-EVK using CW 11.1.&amp;nbsp; My app has two ISRs, one ISR is at Priority 1 and the other ISR is at Prioirty 2.&amp;nbsp; Of course, I expect the higher priority ISR to interrupt the lower priority ISR. I am using Quad Timer A. What I have discovered is that I have to protect the lower priority ISR from being interrupted in certain sections of its code.&amp;nbsp; I present the code below with questions interspersed.&lt;/P&gt;&lt;P&gt;First, here is the relevant configuration of the Quad Timers in appconfig.h:&lt;/P&gt;&lt;P&gt;/*.&lt;BR /&gt;INTC Configuration&lt;BR /&gt;--------------------------------------------&lt;BR /&gt;.*/&lt;BR /&gt;#define INTC_ICTL_INIT 0x0000U&lt;BR /&gt;#define INT_VECTOR_ADDR_26 ISRDRV_A2&lt;BR /&gt;#define INT_PRIORITY_LEVEL_26 INTC_LEVEL2&lt;BR /&gt;#define INT_VECTOR_ADDR_27 ISRDRV_A1&lt;BR /&gt;#define INT_PRIORITY_LEVEL_27 INTC_LEVEL1&lt;BR /&gt;&lt;BR /&gt;/*.&lt;BR /&gt;QT_A1 Configuration&lt;BR /&gt;--------------------------------------------&lt;BR /&gt;Count mode: Counting mode, count rising edges of primary source&lt;BR /&gt;Timer Channel Enabled (counter starts counting immediatelly after initialized): No&lt;BR /&gt;Primary source: Prescaler (IPB clock/ 16) ,&lt;BR /&gt;Input polarity: True , Output polarity: True&lt;BR /&gt;Input capture mode: Capture disabled, Input Edge Flag disabled&lt;BR /&gt;Output mode: Clear OFLAG output on successful compare&lt;BR /&gt;Count stop mode: Count repeatedly , Count length: Count until compare and reinitialize , Count direction: Count down&lt;BR /&gt;Output enable (OFLAG to pin): No&lt;BR /&gt;Force OFLAG output at startup: No , Forced OFLAG value: 0&lt;BR /&gt;Master mode (broadcast compare event): Disable&lt;BR /&gt;Enable external OFLAG force (on broadcasted event): No&lt;BR /&gt;Co-channel initialization (on broadcasted event): No&lt;BR /&gt;Preload Control: 1: Upon successful compare in CMP2 , Load Reg: 0&lt;BR /&gt;2: Upon successful compare in CMP2 , Load Reg: 0&lt;BR /&gt;Interrupts: Overflow: Disabled&lt;BR /&gt;Input edge: Disabled&lt;BR /&gt;Compare: Disabled&lt;BR /&gt;Cmp 1: Disabled&lt;BR /&gt;Cmp 2: Enabled&lt;BR /&gt;Input Filter: Input Signal Sampling [timer clocks] : 0&lt;BR /&gt;Consecutive Samples Required to Agree: 3&lt;BR /&gt;Input Signal Latency: OFF&lt;BR /&gt;Fault function: No&lt;BR /&gt;Alternative Load: No&lt;BR /&gt;Reload on Capture: Yes&lt;BR /&gt;Debug action: Continue&lt;BR /&gt;Enable DMA write for Comparator Preload Register CMPLD1: No&lt;BR /&gt;Enable DMA write for Comparator Preload Register CMPLD2: No&lt;BR /&gt;Enable DMA read for Input Edge Flag: No&lt;BR /&gt;.*/&lt;BR /&gt;#define QT_A1_CTRL_INIT 0x3831U&lt;BR /&gt;#define QT_A1_CNTR_INIT 0x9896U&lt;BR /&gt;#define QT_A1_COMSCR_INIT 0x088AU&lt;BR /&gt;#define QT_A1_ENBL_INIT 0x0000U&lt;/P&gt;&lt;P&gt;/*.&lt;BR /&gt;QT_A2 Configuration&lt;BR /&gt;--------------------------------------------&lt;BR /&gt;Count mode: Counting mode, count rising edges of primary source&lt;BR /&gt;Timer Channel Enabled (counter starts counting immediatelly after initialized): No&lt;BR /&gt;Primary source: Prescaler (IPB clock/ 1) ,&lt;BR /&gt;Input polarity: True , Output polarity: True&lt;BR /&gt;Input capture mode: Capture disabled, Input Edge Flag disabled&lt;BR /&gt;Output mode: Asserted while counter is active&lt;BR /&gt;Count stop mode: Count repeatedly , Count length: Count until compare and reinitialize , Count direction: Count down&lt;BR /&gt;Output enable (OFLAG to pin): No&lt;BR /&gt;Force OFLAG output at startup: No , Forced OFLAG value: 0&lt;BR /&gt;Master mode (broadcast compare event): Disable&lt;BR /&gt;Enable external OFLAG force (on broadcasted event): No&lt;BR /&gt;Co-channel initialization (on broadcasted event): No&lt;BR /&gt;Preload Control: 1: Upon successful compare in CMP2 , Load Reg: 2500&lt;BR /&gt;2: Upon successful compare in CMP2 , Load Reg: 0&lt;BR /&gt;Interrupts: Overflow: Disabled&lt;BR /&gt;Input edge: Disabled&lt;BR /&gt;Compare: Disabled&lt;BR /&gt;Cmp 1: Disabled&lt;BR /&gt;Cmp 2: Enabled&lt;BR /&gt;Input Filter: Input Signal Sampling [timer clocks] : 0&lt;BR /&gt;Consecutive Samples Required to Agree: 3&lt;BR /&gt;Input Signal Latency: OFF&lt;BR /&gt;Fault function: No&lt;BR /&gt;Alternative Load: No&lt;BR /&gt;Reload on Capture: No&lt;BR /&gt;Debug action: Continue&lt;BR /&gt;Enable DMA write for Comparator Preload Register CMPLD1: No&lt;BR /&gt;Enable DMA write for Comparator Preload Register CMPLD2: No&lt;BR /&gt;Enable DMA read for Input Edge Flag: No&lt;BR /&gt;.*/&lt;BR /&gt;#define QT_A2_CTRL_INIT 0x3030U&lt;BR /&gt;#define QT_A2_CMP1_INIT 0x09C4U&lt;BR /&gt;#define QT_A2_LOAD_INIT 0x09C4U&lt;BR /&gt;#define QT_A2_CNTR_INIT 0x09C4U&lt;BR /&gt;#define QT_A2_CMPLD1_INIT 0x09C4U&lt;BR /&gt;#define QT_A2_COMSCR_INIT 0x008AU&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the top level main.c:&lt;/P&gt;&lt;P&gt;void main(void)&lt;BR /&gt;{&lt;BR /&gt;ioctl(SYS, SYS_INIT, NULL);&lt;/P&gt;&lt;P&gt;ioctl(GPIO_LED_R2, GPIO_SETAS_GPIO, LED_B2);&lt;BR /&gt;ioctl(GPIO_LED_R2, GPIO_SETAS_OUTPUT, LED_B2);&lt;BR /&gt;ioctl(GPIO_LED_R2, GPIO_SET_PIN, LED_B2);&lt;/P&gt;&lt;P&gt;ioctl(COP, COP_INIT, NULL);&lt;/P&gt;&lt;P&gt;// Disable all A timers&lt;BR /&gt;ioctl( QTIMER_A0, QT0_MASS_DISABLE, QT_CH0 | QT_CH1 | QT_CH2 | QT_CH3 );&lt;/P&gt;&lt;P&gt;// Initialise Timers A1 &amp;amp; A2.&lt;BR /&gt;ioctl( QTIMER_A1, QT_INIT, NULL );&lt;BR /&gt;ioctl( QTIMER_A2, QT_INIT, NULL );&lt;/P&gt;&lt;P&gt;// configure Interrupt Controller&lt;BR /&gt;ioctl(INTC, INTC_INIT, NULL);&lt;BR /&gt;archEnableInt();&lt;/P&gt;&lt;P&gt;// Enable Timers A1 &amp;amp; A2 to start count down.&lt;BR /&gt;TIMER_API_TimerStart( T2 ); //ioctl( QTIMER_A0, QT0_MASS_ENABLE, QT_CH1 );&lt;BR /&gt;TIMER_API_TimerStart( T3 ); //ioctl( QTIMER_A0, QT0_MASS_ENABLE, QT_CH2 );&lt;/P&gt;&lt;P&gt;// Enable watchdog&lt;BR /&gt;ioctl( COP, COP_DEVICE, COP_ENABLE );&lt;/P&gt;&lt;P&gt;uint32_t delayCnt = 0;&lt;/P&gt;&lt;P&gt;// This while loop runs as a background task when the two ISRs are not executing.&lt;BR /&gt;while(1)&lt;BR /&gt;{&lt;BR /&gt;/* service COP watchdog (if enabled) */&lt;BR /&gt;WD_API_Service(); // ioctl(COP, COP_CLEAR_COUNTER, NULL);&lt;/P&gt;&lt;P&gt;delayCnt++;&lt;BR /&gt;if (delayCnt &amp;gt; 1000000) delayCnt = 0;&lt;/P&gt;&lt;P&gt;archDelay(60000);&lt;/P&gt;&lt;P&gt;if ((delayCnt%200) == 0 )&lt;BR /&gt;{&lt;BR /&gt;/* toggle blue LED indicator */&lt;BR /&gt;ioctl(GPIO_LED_B2, GPIO_TOGGLE_PIN, LED_B2);&lt;BR /&gt;}&lt;BR /&gt;} // end while(1)&lt;BR /&gt;} // end main()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now here are the two ISRs:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;#pragma interrupt on&lt;/P&gt;&lt;P&gt;void ISRDRV_A2()&amp;nbsp;&amp;nbsp; // 50 microsecond timer ISR, priority 2&lt;BR /&gt;{&lt;BR /&gt;TIMER_API_ClearInterrupt( T3 ); //ioctl(QTIMER_A2, QT_CLEAR_COMPARE_FLAG, QT_COMPARE2_FLAG );&lt;/P&gt;&lt;P&gt;if ( timerA2Cntr &amp;gt; 1000000 ) timerA2Cntr = 0;&lt;BR /&gt;timerA2Cntr++;&lt;/P&gt;&lt;P&gt;} // end ISRDRV_ControlLaw()&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;void ISRDRV_A1()&amp;nbsp;&amp;nbsp; // 5000 microsecond timer ISR, priority 1&lt;BR /&gt;{&lt;BR /&gt;ioctl( IntruptController.intruptBase, INTC_INTERRUPTS, INTC_DISABLE );&lt;BR /&gt;TIMER_API_TimerStop( T2 );&lt;BR /&gt;TIMER_API_ClearInterrupt( T2 ); //ioctl(QTIMER_A1, QT_CLEAR_COMPARE_FLAG, QT_COMPARE2_FLAG );&lt;BR /&gt;ioctl( IntruptController.intruptBase, INTC_INTERRUPTS, INTC_ENABLE );&lt;/P&gt;&lt;P&gt;if ( timerA1Cntr &amp;gt; 1000000 ) timerA1Cntr = 0;&lt;BR /&gt;timerA1Cntr++;&lt;/P&gt;&lt;P&gt;&amp;nbsp;ioctl( IntruptController.intruptBase, INTC_INTERRUPTS, INTC_DISABLE );&lt;BR /&gt;&amp;nbsp;TIMER_API_TimerSet( T2, 5000 ); // 5000 microseconds&lt;BR /&gt;&amp;nbsp;TIMER_API_TimerStart( T2 );&lt;BR /&gt;&amp;nbsp;ioctl( IntruptController.intruptBase, INTC_INTERRUPTS, INTC_ENABLE );&lt;BR /&gt;&lt;BR /&gt;} // end ISRDRV_Scheduler( )&lt;/P&gt;&lt;P&gt;#pragma interrupt off&lt;/P&gt;&lt;P&gt;The critical code are the calls to TIMER_API_TimerStop/TimerSet/TimerStart/TimerClearInterrupt functions.&lt;/P&gt;&lt;P&gt;The above coding scheme works since timerA2Cntr is always 100 times greater than timerA1Cntr whenever I pause to reveal their values.. Note that timerA2 = 50 usec, timer21 = 5000 us, so timerA2Cntr divided by timerA1Cntr = 100.&lt;/P&gt;&lt;P&gt;Notice that I am dynamically stopping, setting, and starting Timer A1. This is the critical section of code that must be protected. Without this protection, Timer A1 ISR stops being called.&lt;/P&gt;&lt;P&gt;Okay, so things work with the proper protection around the critical code. BUT, why I can't I move the protection into the TIMER_API_Stop/Set/Start functions. For example,&lt;/P&gt;&lt;P&gt;void TIMERDRV_TimerStop( UCTIMER_Obj_t* pThis )&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;ioctl( IntruptController.intruptBase, INTC_INTERRUPTS, INTC_DISABLE );&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;arch_sTimerChannel* timerA0Channel1Base = CPUTimer[0]-&amp;gt;timerChannelBase;&lt;BR /&gt;ioctl( timerA0Channel1Base, QT0_MASS_DISABLE, pThis-&amp;gt;channelBitMask );&lt;/P&gt;&lt;P&gt;&amp;nbsp;ioctl( IntruptController.intruptBase, INTC_INTERRUPTS, INTC_ENABLE );&lt;BR /&gt;} // end TimerStop()&lt;/P&gt;&lt;P&gt;Note that the TIMER_API functions are just pass through functions to matching TIMERDRV functions. Similarly, I add the same protection for all TIMERDRV functions.&lt;/P&gt;&lt;P&gt;BUT much to my surprise, this does not work. WHY? It should. I have only moved the protection from the calling routine to the called routine wherein the real critical code resides.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 02 Oct 2022 04:52:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Nested-ISRs-with-priorities/m-p/1531366#M15782</guid>
      <dc:creator>pgillaspy</dc:creator>
      <dc:date>2022-10-02T04:52:59Z</dc:date>
    </item>
    <item>
      <title>Re: Nested ISRs with priorities</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Nested-ISRs-with-priorities/m-p/1534422#M15784</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Pls download the DSP56800EX core reference manual DSP56800ERM.pdf from the link:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.nxp.com/products/processors-and-microcontrollers/additional-mpu-mcus-architectures/digital-signal-controllers/32-bit-56f8xxxx-families/performance-level-digital-signal-controllers-usb-fs-otg-can-fd:MC56F83xxx" target="_blank"&gt;https://www.nxp.com/products/processors-and-microcontrollers/additional-mpu-mcus-architectures/digital-signal-controllers/32-bit-56f8xxxx-families/performance-level-digital-signal-controllers-usb-fs-otg-can-fd:MC56F83xxx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pls refer to section 9.3.1 Interrupt Priority Structure as following.&lt;/P&gt;
&lt;P&gt;If you set the priority of timer, for example set&amp;nbsp; TMRA_1 as 1, TMRA_1 as 2, you can not implement the nested interrupt, because when TA1 ISR is being executed, the CCPL bits will add 1 automatically, which forbids that the same priority ISR preempts it.&lt;/P&gt;
&lt;P&gt;You can set the TMRA_1 as 1, TMRA_1 as 3 to implement the nested interrupt.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="xiangjun_rong_0-1665301195688.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/196164iCA756F07C0ED921D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="xiangjun_rong_0-1665301195688.png" alt="xiangjun_rong_0-1665301195688.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Regarding the phenomenon that "Without this protection, Timer A1 ISR stops being called.", I suppose that TA2 period is 50uS, the period is too small, the TA2 will occupy all the source so that the TA1 has not opportunity to be executed.&lt;/P&gt;
&lt;P&gt;Pls try to set the period of TA2 as 50mS, TA1 500mS and have a try.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Every interrupt source has an associated priority level. For some interrupt sources, such as the SWI&lt;BR /&gt;instructions and non-maskable interrupts, the interrupt level is pre-assigned. Other interrupt sources, such&lt;BR /&gt;as on-chip peripherals, support a programmable priority level. Programmable interrupt sources other than&lt;BR /&gt;those in the debug port can be set to one of the maskable priority levels (0, 1, or 2) or be disabled.&lt;BR /&gt;Enhanced OnCE interrupt sources can be programmed as level 1, 2, or 3 or as disabled. The CCPL is set to&lt;BR /&gt;level 3 on reset.&lt;BR /&gt;When an exception or interrupt is recognized and the CCPL is low enough to allow it to be processed, the&lt;BR /&gt;CCPL is automatically updated to be one higher than the level of the interrupt (except for the case of&lt;BR /&gt;SWILP, which does not update the CCPL, or the case of level 3 interrupts, which leave the priority level at&lt;BR /&gt;level 3). This updating prevents interrupts that have the same or a lower priority level from interrupting the&lt;BR /&gt;handler for the current interrupt. When the interrupt service routine finishes, the CCPL is set back to its&lt;BR /&gt;original value.&lt;BR /&gt;To better understand the interrupt priority structure, consider a simple example with nested interrupts.&lt;BR /&gt;Assume that the following have already taken place:&lt;BR /&gt;1. A serial port on a chip has requested a level 1 interrupt when the core’s CCPL was at level 0.&lt;BR /&gt;2. The core has recognized this interrupt and entered the exception processing state. The&lt;BR /&gt;CCPL was updated from level 0 to level 2, which is one level higher than the priority of the&lt;BR /&gt;recognized interrupt (level 1).&lt;BR /&gt;3. Program flow has been transferred to the interrupt handler for the serial port.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope it can help you&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;XiangJun Rong&lt;/P&gt;</description>
      <pubDate>Sun, 09 Oct 2022 07:49:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Nested-ISRs-with-priorities/m-p/1534422#M15784</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2022-10-09T07:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: Nested ISRs with priorities</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Nested-ISRs-with-priorities/m-p/1535778#M15787</link>
      <description>&lt;P&gt;The problem I am having is not TMRA1 (priority 2) properly interrupting TMRA0 (priority 1). The problem is that TMRA0&amp;nbsp; contains code that does not execute properly if it is interrupted, ie, the so-called critical code.The critical code is the call to ioctl(TIMERA0.........) which is nothing more than reading or writing a device register. I have found that if I surround the calls to ioctl() with disable and enable interrupt ioctl calls, eg,&lt;/P&gt;&lt;P&gt;ioctl( IntruptController.intruptBase, INTC_INTERRUPTS, INTC_DISABLE );&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;arch_sTimerChannel* timerA0Channel1Base = CPUTimer[0]-&amp;gt;timerChannelBase;&lt;BR /&gt;ioctl( timerA0Channel1Base, QT0_MASS_ENABLE, pThis-&amp;gt;channelBitMask );&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ioctl( IntruptController.intruptBase, INTC_INTERRUPTS, INTC_ENABLE );&lt;/P&gt;&lt;P&gt;the code works, but without the interrupt protection the code does not work.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 16:38:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Nested-ISRs-with-priorities/m-p/1535778#M15787</guid>
      <dc:creator>pgillaspy</dc:creator>
      <dc:date>2022-10-11T16:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: Nested ISRs with priorities</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Nested-ISRs-with-priorities/m-p/1537275#M15791</link>
      <description>&lt;P&gt;This problem has mysteriously disappeared. I have removed the interrupt protection and the ISR and critical code work as expected.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2022 17:35:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Nested-ISRs-with-priorities/m-p/1537275#M15791</guid>
      <dc:creator>pgillaspy</dc:creator>
      <dc:date>2022-10-13T17:35:06Z</dc:date>
    </item>
  </channel>
</rss>

