What is wrong here, High priority IRQ stopped by loop in low priority one. [T4, 4.1]

Status
Not open for further replies.

neutron7

Well-known member
I have 2 intervaltimer ISRs, for clarity on the scope when suing sync they are running at:
"audio_ISR_Timer" 15us set to priority 0.
"controlLoopTimer" 300us priority 64.

it is easiest to see on a scope if you sync to the channel on pin 2.
the fast one toggles pin 1 up and down every time it runs, and the slow one toggles pin 2 just before a loop of 20000 ASM NOPs. which appears to stop the fast and higher priority ISR.

I thought with "nested interrupts" the lower priority one was supposed to stop and wait for the high priority ISR?


SCR05.PNG

Code in Zip file because there are 3 .ino files on tabs.

View attachment irq_problem_demo.zip
 
Because, on Teensy 4, there is only one interrupt vector for all timers.
priority() sets the priority for all.
Code:
    void priority(uint8_t n) {
        nvic_priority = n;
        if (channel) {
            int index = channel - IMXRT_PIT_CHANNELS;
            nvic_priorites[index] = nvic_priority;
            uint8_t top_priority = nvic_priorites[0];
            for (uint8_t i=1; i < (sizeof(nvic_priorites)/sizeof(nvic_priorites[0])); i++) {
                if (top_priority > nvic_priorites[i]) top_priority = nvic_priorites[i];
            }
            NVIC_SET_PRIORITY(IRQ_PIT, top_priority);
        }
    }
 
Status
Not open for further replies.
Back
Top