How to wake a FreeRtos task from a high priority ISR?

Using:

  • Stm32F10x, F2xx, F4xx
  • FreeRtos 8.1.1
  • NKU-arm-ni-EABI-4_8-2014q2

I have an ISR that should work with a high interrupt priority, so it's forbidden to call FreeRtos Api from this ISR (see here and here ).

In some cases, these ISRs detect conditions for which the FreeRtos sleeping task should be woken up with at least a possible delay.

Usually (if the ISR is allowed to call FreeRtos Api due to a low enough priority), I would use a queue or semaphore to solve this problem.

But how to understand that high priority ISR?

My current approach of intermediate elements looks like this (briefly):

volatile int flag = 0;

void XYZ_IRQHandler() {
    if (someCondition)
        flag = 1
}

void FreeRtosTaskFunction(void* parameters) {
    for (;;) {
        if (flag == 1)
            doSomething();
        vTaskDelay(1);  // sleep 10ms (tick frequency is 100Hz)
    }
}

But this approach has its drawbacks:

  • ( ISR ) 1 FreeRtos.
  • ( ).

, ?

+4
2

, , , .

, ISR , , - (.. ), , isn ' t (.. ).

ISR , .

ISR ( ), ISR. API FreeRTOS .

+2

FreeRTOS .

, / ISR.

+1

All Articles