# Interrupt arriving at the same time

**URL:** <https://forums.freertos.org/t/interrupt-arriving-at-the-same-time/4835>\
**Category:** Kernel\
**Created:** [October 14, 2014, 1:14pm UTC](https://forums.freertos.org/t/interrupt-arriving-at-the-same-time/4835 "2014-10-14T13:14:31Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [October 14, 2014, 1:14pm UTC](https://forums.freertos.org/t/interrupt-arriving-at-the-same-time/4835/1 "2014-10-14T13:14:31Z")

</div>

**[jj1010](https://sourceforge.net/u/jj1010/)** wrote on [Tuesday, October 14, 2014](https://sourceforge.net/p/freertos/discussion/382005/thread/d08dd514/#c548):

I use FreeRTOS in Cortex-M3 architecture. My question is:

1 When Systick interrupt and other interrupt arriving at the same time, How FreeRTOS works?

2 If other interrupt preempts Systick interrupt when they arriving at the same time, Systick handler will be deffed. Whether to set the Systick priority highest to ensure the accuracy of the System tick?

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [October 14, 2014, 1:21pm UTC](https://forums.freertos.org/t/interrupt-arriving-at-the-same-time/4835/2 "2014-10-14T13:21:01Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Tuesday, October 14, 2014](https://sourceforge.net/p/freertos/discussion/382005/thread/d08dd514/#7c3e):

> 1 When Systick interrupt and other interrupt arriving at the same time,  
> How FreeRTOS works?

How that works is dependent on the hardware (Cortex-M in this case). FreeRTOS is just software and cannot change how the hardware functions - so the answer is in the hardware reference manuals.

> 2 If other interrupt preempts Systick interrupt when they arriving at the same  
> time, Systick handler will be deffed. Whether to set the Systick priority  
> highest to ensure the accuracy of the System tick?

The SysTick _must_ be the lowest priority interrupt. Again the hardware will take care of it for you - and you will only get into a time slippage issue if you are executing an interrupt handler that takes more than one entire tick interrupt time to execute (that is - more than the time between two tick interrupts).

Regards.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [October 14, 2014, 1:53pm UTC](https://forums.freertos.org/t/interrupt-arriving-at-the-same-time/4835/3 "2014-10-14T13:53:27Z")

</div>

**[jj1010](https://sourceforge.net/u/jj1010/)** wrote on [Tuesday, October 14, 2014](https://sourceforge.net/p/freertos/discussion/382005/thread/d08dd514/#7c3e/6e17):

Other tasks want a definite time delay, but the time slippage issue affects accuracy of the delay time. How does such question solve?

About the SysTick priority explanation, has not explained in FreeRTOS tutorial Cortex-M3 edition , where can I get information about the SysTick interrupt explanation?

Regards.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [October 14, 2014, 1:55pm UTC](https://forums.freertos.org/t/interrupt-arriving-at-the-same-time/4835/4 "2014-10-14T13:55:01Z")

</div>

**[jj1010](https://sourceforge.net/u/jj1010/)** wrote on [Tuesday, October 14, 2014](https://sourceforge.net/p/freertos/discussion/382005/thread/d08dd514/#7c3e/c9f1):

By the way, what does Regards mean? my mother tongue is not English. Thanks!

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [October 14, 2014, 2:01pm UTC](https://forums.freertos.org/t/interrupt-arriving-at-the-same-time/4835/5 "2014-10-14T14:01:18Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Tuesday, October 14, 2014](https://sourceforge.net/p/freertos/discussion/382005/thread/d08dd514/#7c3e/6e17/6516):

> Other tasks want a definite time delay,

The accuracy of any delay period can be specified with a granularity of  
1 tick period. That is because the next tick interrupt that occurs  
after requesting the delay is taken as the first tick of the delay. So,  
if you ask for a delay immediately before a tick interrupt occurs then  
the first delay period will be a tiny fraction of one tick. Likewise,  
if you ask for a delay immediately after a tick interrupt occurs the  
first period of the delay will be one complete tick period.

> but the time slippage issue affects accuracy of the delay time. How  
> does such question solve?

As per my previous post - unless you are writing interrupt service  
routines that take more than one entire tick period to execute (so  
potentially two ticks occur during the execution of a single interrupt  
service routine) then there is no time slippage issue. If you interrupt  
genuinely do take that long then I would suggest drastically  
re-architecting your system as the goal should be for interrupt to be as  
short as feasibly possible - the deferred interrupt description in the  
book text shows you how to do that.

> About the SysTick priority explanation, has not explained in FreeRTOS  
> tutorial Cortex-M3 edition , where can I get information about the  
> SysTick interrupt explanation?

I’m not sure exactly what the book says about this, hopefully it is in  
the code comments.

Regards.

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [October 14, 2014, 2:05pm UTC](https://forums.freertos.org/t/interrupt-arriving-at-the-same-time/4835/6 "2014-10-14T14:05:04Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Tuesday, October 14, 2014](https://sourceforge.net/p/freertos/discussion/382005/thread/d08dd514/#7c3e/c9f1/c54b):

As a noun it means “best wishes” (used to express friendliness in  
greetings).

In formal letters (before the days of email) a sign off would be either  
“yours sincerely”, or “yours truly” (depending on how the letter starts  
I think). “best regards” being a slightly less formal version. Its a  
bit old fashioned, and I just abbreviated it to “regards”.

---

<div class="post-metadata">

**Author:** ![richard-damon](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/richard-damon/32/38_2.png) [@richard-damon](https://forums.freertos.org/u/richard-damon)\
**Post date:** [October 15, 2014, 2:40am UTC](https://forums.freertos.org/t/interrupt-arriving-at-the-same-time/4835/7 "2014-10-15T02:40:25Z")

</div>

**[richard\_damon](https://sourceforge.net/u/richard_damon/)** wrote on [Wednesday, October 15, 2014](https://sourceforge.net/p/freertos/discussion/382005/thread/d08dd514/#1e9d):

The other point about the slippage, unless the task was the highest priority task, it could be delayed by other tasks, and thus not restart at exactly the “right” time.

And, even if it was the highest task, that other interrupt that delayed the sys tick, would have delayed the task too, even if the systick had been highest priority and switched to it.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [October 16, 2014, 2:30pm UTC](https://forums.freertos.org/t/interrupt-arriving-at-the-same-time/4835/8 "2014-10-16T14:30:58Z")

</div>

**[jj1010](https://sourceforge.net/u/jj1010/)** wrote on [Thursday, October 16, 2014](https://sourceforge.net/p/freertos/discussion/382005/thread/d08dd514/#1e9d/9264):

Thank you very much!

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [October 16, 2014, 2:34pm UTC](https://forums.freertos.org/t/interrupt-arriving-at-the-same-time/4835/9 "2014-10-16T14:34:49Z")

</div>

**[jj1010](https://sourceforge.net/u/jj1010/)** wrote on [Thursday, October 16, 2014](https://sourceforge.net/p/freertos/discussion/382005/thread/d08dd514/#7c3e/c9f1/c54b/c41e):

I am so glad that you can help me to sovle the problem.
