Page 1 of 1

Waking up a thread from a fast irq?

Posted: Mon Mar 25, 2013 5:11 am
by Tinker
Hi,

I am using a "fast irq" for comm and inserting data into a lock-free queue as it comes in. So far so good...

I would like to signal a sleeping thread that there is data available, from inside the "fast irq". I know of two ways: (1) having the thread busy-waiting checking on the queue, or (2) trigger a regular EXTI irq from the "fast irq" and have the handler wake up the thread. Is there another way?

~T

Re: Waking up a thread from a fast irq?

Posted: Mon Mar 25, 2013 9:12 am
by Giovanni
Hi,

The recommended way is to trigger a normal IRQ to wake up the thread. This can be done using EXTI but there is a dedicated Cortex-M interrupt for that: "PendSVVector". Note that this vector is not available in the simplified kernel mode (the option CORTEX_SIMPLIFIED_PRIORITY which is not the default anyway).

Giovanni

Re: Waking up a thread from a fast irq?

Posted: Mon Mar 25, 2013 7:06 pm
by Tinker
Awesome! That's the kind of solution I was hoping for. Thanks a lot,

~t