# portYIELD\_FROM\_ISR() not recognised

**URL:** <https://forums.freertos.org/t/portyield-from-isr-not-recognised/11968>\
**Category:** Kernel\
**Created:** [March 12, 2021, 3:22am UTC](https://forums.freertos.org/t/portyield-from-isr-not-recognised/11968 "2021-03-12T03:22:17Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rik001](https://avatars.discourse-cdn.com/v4/letter/r/bbce88/32.png) [@Rik001](https://forums.freertos.org/u/Rik001)\
**Post date:** [March 12, 2021, 3:22am UTC](https://forums.freertos.org/t/portyield-from-isr-not-recognised/11968/1 "2021-03-12T03:22:17Z")

</div>

Hi,  
I cannot find portYIELD\_FROM\_ISR() in the freeRTOS online documentation. Is there a search facility or index for all functions?

Also I include the task.h but the following line

```auto
portYIELD_FROM_ISR(NULL);

```

gives the error below as if it does not see it. Do I need to include another header for the function definition?

```auto
../src/config/default/interrupts.c: In function 'CHANGE_NOTICE_B_Handler':
../src/config/default/interrupts.c:115:5: error: implicit declaration of function 'portYIELD_FROM_ISR' [-Werror=implicit-function-declaration]
     portYIELD_FROM_ISR(NULL);
     ^

```

---

<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:** [March 12, 2021, 3:29am UTC](https://forums.freertos.org/t/portyield-from-isr-not-recognised/11968/2 "2021-03-12T03:29:21Z")

</div>

Have you included FreeRTOS.h then task.h? Your support requests just sound like you are not including the header files.

---

<div class="post-metadata">

**Author:** ![Rik001](https://avatars.discourse-cdn.com/v4/letter/r/bbce88/32.png) [@Rik001](https://forums.freertos.org/u/Rik001)\
**Post date:** [March 12, 2021, 3:36am UTC](https://forums.freertos.org/t/portyield-from-isr-not-recognised/11968/3 "2021-03-12T03:36:00Z")

</div>

Hi Richard,  
I did included task.h in my code and following your reply I have now also included FreeRTOS.h

But the same error persists. And if I click on the function it does not bring me to the definition, as if it does not find the file. But it is there, included.

This is the complete output:

```auto
make[2]: Entering directory 'D:/Dropbox (TDL)/TDL Design/Rational/Firmware_OP60_RTOS/firmware/OP60_RTOS.X'
../src/config/default/interrupts.c: In function 'CHANGE_NOTICE_B_Handler':
../src/config/default/interrupts.c:116:5: error: implicit declaration of function 'portYIELD_FROM_ISR' [-Werror=implicit-function-declaration]
     portYIELD_FROM_ISR(NULL);
     ^
cc1.exe: all warnings being treated as errors
make[2]: *** [build/default/production/_ext/1171490990/interrupts.o] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
"C:\Program Files (x86)\Microchip\xc32\v2.30\bin\xc32-gcc.exe" -g -x c -c -mprocessor=32MZ1024EFG100 -ffunction-sections -O1 -I../src/third_party/rtos/FreeRTOS/Source/portable/MPLAB/PIC32MZ -I../src/third_party/rtos/FreeRTOS/Source/include -I../src -I../src/config/default -I../src/packs/PIC32MZ1024EFG100_DFP -Werror -Wall -MMD -MF build/default/production/_ext/1171490990/interrupts.o.d -o build/default/production/_ext/1171490990/interrupts.o ../src/config/default/interrupts.c -DXPRJ_default=default -no-legacy-libc "-mdfp=C:/Program Files (x86)/Microchip/MPLABX/v5.30/packs/Microchip/PIC32MZ-EF_DFP/1.1.45" 
nbproject/Makefile-default.mk:428: recipe for target 'build/default/production/_ext/1171490990/interrupts.o' failed
make[2]: Leaving directory 'D:/Dropbox (TDL)/TDL Design/Rational/Firmware_OP60_RTOS/firmware/OP60_RTOS.X'
nbproject/Makefile-default.mk:91: recipe for target '.build-conf' failed
make[1]: Leaving directory 'D:/Dropbox (TDL)/TDL Design/Rational/Firmware_OP60_RTOS/firmware/OP60_RTOS.X'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed

BUILD FAILED (exit value 2, total time: 1s)

```

---

<div class="post-metadata">

**Author:** ![Rik001](https://avatars.discourse-cdn.com/v4/letter/r/bbce88/32.png) [@Rik001](https://forums.freertos.org/u/Rik001)\
**Post date:** [March 12, 2021, 3:39am UTC](https://forums.freertos.org/t/portyield-from-isr-not-recognised/11968/4 "2021-03-12T03:39:26Z")

</div>

I also looked into both files task.h and FreeRTOS.h and neither have the function definition/declaration of portYIELD\_FROM\_ISR.

---

<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:** [March 12, 2021, 3:54am UTC](https://forums.freertos.org/t/portyield-from-isr-not-recognised/11968/5 "2021-03-12T03:54:50Z")

</div>

Previously I asked if you had more than one header file called task.h, can you confirm that is not the case as it should not have built at all if you included task.h with previously including FreeRTOS.h - but just output a #error message.

---

<div class="post-metadata">

**Author:** ![Rik001](https://avatars.discourse-cdn.com/v4/letter/r/bbce88/32.png) [@Rik001](https://forums.freertos.org/u/Rik001)\
**Post date:** [March 12, 2021, 4:04am UTC](https://forums.freertos.org/t/portyield-from-isr-not-recognised/11968/6 "2021-03-12T04:04:51Z")

</div>

I just double checked and can only find a single task.h file in the entire freeRTOS folder/sub-folders  
and also there are no task.h in any of my project folders/subfolders.

I also tried including **only** task.h and then **only** freeRTOS.h and then both. The output from the compiler is always the same.

I also looked into both task.h and freeRTOS.h and neither contain the definition of portYIELD\_FROM\_ISR function

Do I have to perhaps enable the inclusion of that function to be available?

I hope that answers your point? If not, could you please elaborate.

Thank you 🙂

---

<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:** [March 12, 2021, 4:14am UTC](https://forums.freertos.org/t/portyield-from-isr-not-recognised/11968/7 "2021-03-12T04:14:09Z")

</div>

> [@Rik001](#):
>
> I also tried including **only** task.h and then **only** freeRTOS.h and then both. The output from the compiler is always the same.

In which case I don’t think you are building code provided by us. You can see [here](https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/include/task.h#L32) that if you include task.h without first including FreeRTOS.h the compiler will stop with the #error message on that link.

---

<div class="post-metadata">

**Author:** ![Rik001](https://avatars.discourse-cdn.com/v4/letter/r/bbce88/32.png) [@Rik001](https://forums.freertos.org/u/Rik001)\
**Post date:** [March 12, 2021, 4:24am UTC](https://forums.freertos.org/t/portyield-from-isr-not-recognised/11968/8 "2021-03-12T04:24:51Z")

</div>

I just opened task.h and it does have the same #error directive. I then saw that they were both included through a previous include of another file that was generated by MPLAB.

Which also confirms the fact that that the same error does appear even if I don’t include either of them - because they are #included in the other file #included a few #include above

I also checked both task.h and freeRTOS.h from the link you sent me and neither of them include the portYIELD\_FROM\_ISR(). And mine don’t either.

So where is the definition of portYIELD\_FROM\_ISR ?

Also is there a search for portYIELD\_FROM\_ISR in the online documentation? Is there a search facility on the [freeRTOS.org](http://freeRTOS.org) website? I could not find any. It is tedious to have to manually go through the API index on the left side of the web page.

Thank you

---

<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:** [March 12, 2021, 4:25am UTC](https://forums.freertos.org/t/portyield-from-isr-not-recognised/11968/9 "2021-03-12T04:25:24Z")

</div>

One thing to note, since the name begins with port, the definition will come from the portability layer. FreeRTOS.h will have in it a statement to include portable.h which will include the portmacro.h file from the appropriate directory (you may need to set the include paths so this happens).

Note that different ports may use slightly different methods to write things like an ISR. It somewhat depends on how old the port is.

The documentation for symbols beginning with port is ultimately in that header, though much is described in the documentation for general rules for ports.

---

<div class="post-metadata">

**Author:** ![Rik001](https://avatars.discourse-cdn.com/v4/letter/r/bbce88/32.png) [@Rik001](https://forums.freertos.org/u/Rik001)\
**Post date:** [March 12, 2021, 4:31am UTC](https://forums.freertos.org/t/portyield-from-isr-not-recognised/11968/10 "2021-03-12T04:31:52Z")

</div>

I just looked into those files (portable.h and portmacro.h) and all the #include files that are in there too. No sign of the portYIELD\_FROM\_ISR

So do I have to enable it somehow to be present in the API, perhaps during the installation by enabling some “installation flags”?

---

<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:** [March 12, 2021, 4:45am UTC](https://forums.freertos.org/t/portyield-from-isr-not-recognised/11968/11 "2021-03-12T04:45:33Z")

</div>

It is not a configurable option - but looking now I see the PIC32 port doesn’t have a macro called portYIELD\_FROM\_ISR() - it uses the older [portEND\_SWITCHING\_ISR()](https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/portable/MPLAB/PIC32MZ/portmacro.h#L200). I suspect your interrupts.c file is not written for the PIC32. Interrupts on the PIC32 require wrappers, and per the “interrupt service routines” section of this page [https://www.freertos.org/port\_PIC32\_MIPS\_MK4.html](https://www.freertos.org/port_PIC32_MIPS_MK4.html)
