# Disable interrupts in ISR while calling API's  

**URL:** <https://forums.freertos.org/t/disable-interrupts-in-isr-while-calling-apis/6753>\
**Category:** Kernel\
**Created:** [August 23, 2017, 6:32am UTC](https://forums.freertos.org/t/disable-interrupts-in-isr-while-calling-apis/6753 "2017-08-23T06:32:08Z")\
**Posts on this page:** 8\
**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:** [August 23, 2017, 6:32am UTC](https://forums.freertos.org/t/disable-interrupts-in-isr-while-calling-apis/6753/1 "2017-08-23T06:32:08Z")

</div>

**[michaeln32](https://sourceforge.net/u/michaeln32/)** wrote on [Wednesday, August 23, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/78a86f00/#aa7f):

Hello

This is ISR :

void ISR(void)  
{  
taskENTER\_CRITICAL\_FROM\_ISR();

```
xEventGroupSetBitsFromISR();

taskEXIT_CRITICAL_FROM_ISR();

```

}

Can I call the API xEventGroupSetBitsFromISR() in critical section in ISR ?

Michael

---

<div class="post-metadata">

**Author:** ![htibosch](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/htibosch/32/62_2.png) [@htibosch](https://forums.freertos.org/u/htibosch)\
**Post date:** [August 23, 2017, 1:24pm UTC](https://forums.freertos.org/t/disable-interrupts-in-isr-while-calling-apis/6753/2 "2017-08-23T13:24:49Z")

</div>

**[heinbali01](https://sourceforge.net/u/heinbali01/)** wrote on [Wednesday, August 23, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/78a86f00/#0237):

I think that the critical section is not necessary. All `FromISR()` functions are aware of the ISR context.  
So this should be ok :

```auto
void ISR(void)
{
    xEventGroupSetBitsFromISR();
}

```

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [August 23, 2017, 1:49pm UTC](https://forums.freertos.org/t/disable-interrupts-in-isr-while-calling-apis/6753/3 "2017-08-23T13:49:51Z")

</div>

**[michaeln32](https://sourceforge.net/u/michaeln32/)** wrote on [Wednesday, August 23, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/78a86f00/#5a45):

Ok.

I use Free RTOS V8.

Interrupt nesting is when ISR with high priority can stop ISR with low priority from running  
and the high priority ISR take the CPU for himself.

1.How can I find out if my system support interrupt nesting ?

2.if my system do support interrupt nesting - How can I find out if interrupt nesting mechanism (context switch between ISR’s) is enabled ?

---

<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:** [August 23, 2017, 3:43pm UTC](https://forums.freertos.org/t/disable-interrupts-in-isr-while-calling-apis/6753/4 "2017-08-23T15:43:29Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Wednesday, August 23, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/78a86f00/#5a45/8e71):

> 1.How can I find out if my system support interrupt nesting ?

Preferred option - read the documentation for the FreeRTOS port you are  
using.

Fallback option - mention which port you are using in one of your posts  
so we can tell you.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [August 23, 2017, 5:42pm UTC](https://forums.freertos.org/t/disable-interrupts-in-isr-while-calling-apis/6753/5 "2017-08-23T17:42:35Z")

</div>

**[michaeln32](https://sourceforge.net/u/michaeln32/)** wrote on [Wednesday, August 23, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/78a86f00/#14a0):

What is this port ?

Port of what ?

Thanks

---

<div class="post-metadata">

**Author:** ![htibosch](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/htibosch/32/62_2.png) [@htibosch](https://forums.freertos.org/u/htibosch)\
**Post date:** [August 23, 2017, 6:02pm UTC](https://forums.freertos.org/t/disable-interrupts-in-isr-while-calling-apis/6753/6 "2017-08-23T18:02:15Z")

</div>

**[heinbali01](https://sourceforge.net/u/heinbali01/)** wrote on [Wednesday, August 23, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/78a86f00/#6b97):

Richard is asking which port of FreeRTOS you are using, or in other words, what is your platform ( CPU type ) ?

All ports are well documented and you can read if nested interrupts are supported or not.

---

<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:** [August 23, 2017, 6:04pm UTC](https://forums.freertos.org/t/disable-interrupts-in-isr-while-calling-apis/6753/7 "2017-08-23T18:04:06Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Wednesday, August 23, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/78a86f00/#14a0/c0b5):

Port of the RTOS.

FreeRTOS runs on many many architectures, and can be built with many  
different compilers. A ‘port’ is considered to be a  
compiler/architecture combination. For example, if you are targeting a  
Cortex-M0 MCU using the IAR compiler, then you are using the Cortex-M0  
IAR port.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [August 23, 2017, 7:12pm UTC](https://forums.freertos.org/t/disable-interrupts-in-isr-while-calling-apis/6753/8 "2017-08-23T19:12:05Z")

</div>

**[michaeln32](https://sourceforge.net/u/michaeln32/)** wrote on [Wednesday, August 23, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/78a86f00/#dd76):

Ok, I got it.

Microcontroller - STM32L433 Cortex M4.

Compiler - TrueSTUDIO - Atollic.

How can I find this documentation ?

Thank You
