# Porting FreeRTOS to Renesas RL78F14R5F10pgj

**URL:** <https://forums.freertos.org/t/porting-freertos-to-renesas-rl78f14r5f10pgj/2206>\
**Category:** Kernel\
**Created:** [September 29, 2014, 8:13am UTC](https://forums.freertos.org/t/porting-freertos-to-renesas-rl78f14r5f10pgj/2206 "2014-09-29T08:13:38Z")\
**Posts on this page:** 5\
**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:** [September 29, 2014, 8:13am UTC](https://forums.freertos.org/t/porting-freertos-to-renesas-rl78f14r5f10pgj/2206/1 "2014-09-29T08:13:38Z")

</div>

**[chris-itk](https://sourceforge.net/u/chris-itk/)** wrote on [Monday, September 29, 2014](https://sourceforge.net/p/freertos/discussion/382005/thread/5f51dd5e/#2d20):

Hi everybody,  
i’ve got some problems with porting the freertos demo project to a RL78F14 (RL78F14R5F10pgj) controller.  
I’m using the iar compiler.  
I can build the existing demo projects (as provided by freertos v8.1.2 for the rl78 controllers) without any error.  
But if I include the necesarry register definitions (ior5f10pgj.h, ior5f10pgj\_ext.t) for my controller in FreeRTOS\_Config.h, I get a compiler error about some undefined symbols. See the logfile extract below.  
Does anybody know about this problem, or how to fix it?  
I would be very glad if you could help me.

Regards  
Chris

/\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/  
port.c  
iccrl78.exe C:\Users\ckurz.ITK\Desktop\RL78\_Demo\RL78\_Demo\user\_src\FreeRTOS\portable\IAR\RL78\port.c --core rl78\_2 --code\_model near --data\_model near --near\_const\_location rom0 -o C:\Users\ckurz.ITK\Desktop\RL78\_Demo\RL78\_Demo\Debug\Obj\ --dlib\_config C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.0\rl78\LIB\dlrl78nn2n.h -e -Ol --no\_cse --no\_unroll --no\_inline --no\_code\_motion --no\_tbaa --no\_crosscall --no\_scheduling --no\_clustering --debug -I C:\Users\ckurz.ITK\Desktop\RL78\_Demo\RL78\_Demo\user\_src\FreeRTOS\ -I C:\Users\ckurz.ITK\Desktop\RL78\_Demo\RL78\_Demo\user\_src\FreeRTOS\portable\IAR\RL78\ -I C:\Users\ckurz.ITK\Desktop\RL78\_Demo\RL78\_Demo\user\_src\FreeRTOS\include\

IAR C/C++ Compiler V1.40.3.898 for RL78  
Copyright 2011-2014 IAR Systems AB.  
Evaluation license - IAR Embedded Workbench for Renesas RL78, Evaluation version 1.40  
C:\Users\ckurz.ITK\Desktop\RL78\_Demo\RL78\_Demo\user\_src\FreeRTOS\portable\IAR\RL78\port.c(279) : Error[Pe020]: identifier “ITMK” is undefined  
C:\Users\ckurz.ITK\Desktop\RL78\_Demo\RL78\_Demo\user\_src\FreeRTOS\portable\IAR\RL78\port.c(282) : Error[Pe020]: identifier “ITMC” is undefined  
C:\Users\ckurz.ITK\Desktop\RL78\_Demo\RL78\_Demo\user\_src\FreeRTOS\portable\IAR\RL78\port.c(285) : Error[Pe020]: identifier “ITIF” is undefined

Errors: 3  
Warnings: none  
Error while running C/C++ Compiler

portasm.s87  
arl78.exe C:\Users\ckurz.ITK\Desktop\RL78\_Demo\RL78\_Demo\user\_src\FreeRTOS\portable\IAR\RL78\portasm.s87 --core rl78\_2 -D\_\_DEVICE\_FILE\_\_=\<ior5f10pgj.h\> -D\_\_DEVICE\_FILE\_EXT\_\_=\<ior5f10pgj\_ext.h\> -o C:\Users\ckurz.ITK\Desktop\RL78\_Demo\RL78\_Demo\Debug\Obj\ -M\<\> -r -I C:\Users\ckurz.ITK\Desktop\RL78\_Demo\RL78\_Demo\user\_src\FreeRTOS\ -I C:\Users\ckurz.ITK\Desktop\RL78\_Demo\RL78\_Demo\user\_src\FreeRTOS\portable\IAR\RL78\ -I C:\Users\ckurz.ITK\Desktop\RL78\_Demo\RL78\_Demo\user\_src\FreeRTOS\include\ -D\_\_NEAR\_MODEL\_\_ -D\_\_NEAR\_DATA\_MODEL\_\_ --code\_model near --data\_model near

IAR Assembler V1.40.3.898 for RL78  
Copyright 2011-2014 IAR Systems AB.  
C:\Users\ckurz.ITK\Desktop\RL78\_Demo\RL78\_Demo\user\_src\FreeRTOS\portable\IAR\RL78\portasm.s87(102) : Error[As014]: Expression can not be forward  
C:\Users\ckurz.ITK\Desktop\RL78\_Demo\RL78\_Demo\user\_src\FreeRTOS\portable\IAR\RL78\portasm.s87(102) : Error[As014]: Expression can not be forward  
C:\Users\ckurz.ITK\Desktop\RL78\_Demo\RL78\_Demo\user\_src\FreeRTOS\portable\IAR\RL78\portasm.s87(102) : Error[As011]: Undefined symbol: INTIT\_vect  
C:\Users\ckurz.ITK\Desktop\RL78\_Demo\RL78\_Demo\user\_src\FreeRTOS\portable\IAR\RL78\portasm.s87(102) : Error[As014]: Expression can not be forward

Errors: 4  
Warnings: none  
Error while running Assembler

Total number of errors: 7  
Total number of warnings: 0

/\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/

---

<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:** [September 29, 2014, 8:31am UTC](https://forums.freertos.org/t/porting-freertos-to-renesas-rl78f14r5f10pgj/2206/2 "2014-09-29T08:31:49Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Monday, September 29, 2014](https://sourceforge.net/p/freertos/discussion/382005/thread/5f51dd5e/#0bc3):

I think the second set of errors are related to the first.

That demo has configurations for multiple different RL78 families. To switch between the families you have to select the correct build configuration in IAR (done using the drop down box at the top of the workspace window, just above where the files are listed). Selecting a build configuration will ensure the correct device is selected in the IAR project options (General Options, target tab), and define a pre-processor constant. The pre-processor constant is then used to select the correct header files for the selected device, but:

> But if I include the necesarry register definitions (ior5f10pgj.h,  
> ior5f10pgj\_ext.t) for my controller in FreeRTOS\_Config.h

the header files are included in demo\_specific\_io.h, not FreeRTOSConfig.h. I don’t think you need to edit FreeRTOSConfig.h.

Have you selected the correct target in the project options (the FreeRTOS download does not include a build configuration for the RL78f14) and ensured there are no pre-processor constants defined in the project (C/C++ Compiler, preprocessor tab in the project options dialogue box)?

Regards.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [September 29, 2014, 8:54am UTC](https://forums.freertos.org/t/porting-freertos-to-renesas-rl78f14r5f10pgj/2206/3 "2014-09-29T08:54:56Z")

</div>

**[chris-itk](https://sourceforge.net/u/chris-itk/)** wrote on [Monday, September 29, 2014](https://sourceforge.net/p/freertos/discussion/382005/thread/5f51dd5e/#0bc3/e72b):

Hi, thanks for your quick answer.

"To switch between the families you have to select the correct build configuration in IAR (done using the drop down box at the top of the workspace window, just above where the files are listed). "

Yes, I know that. And it does work for the available targets. But the controller I’m using isn’t provided by any of your demos.  
So I thougt about creating my own demo for the RL78F14.  
As you write on [http://www.freertos.org/a00090.html#RENESAS:](http://www.freertos.org/a00090.html#RENESAS:)  
“These demos can be adapted to any microcontroller within the same family that has sufficient ROM/RAM.”  
This applies to the RL78F14 in my oppinion, or am I wrong?

Regards  
Christian

---

<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:** [September 29, 2014, 9:17am UTC](https://forums.freertos.org/t/porting-freertos-to-renesas-rl78f14r5f10pgj/2206/4 "2014-09-29T09:17:28Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Monday, September 29, 2014](https://sourceforge.net/p/freertos/discussion/382005/thread/5f51dd5e/#f33a):

[sorry if this post appears twice]

The port is using an interval timer to generate the tick interrupt. In the build configurations included in the FreeRTOS download, the definitions for ITMC come from the ior\_nnn.h header file, but the ior5f10pgj.h file for your part does not contain that definition.

Looking at the block diagram for that part here, the timers block does not show an interval timer:  
[http://www.renesas.com/products/mpumcu/rl78/rl78f1x/rl78f14/index.jsp](http://www.renesas.com/products/mpumcu/rl78/rl78f1x/rl78f14/index.jsp)

whereas the block diagram for other RL78 families does show an interval timer. For example the block diagram on the following page:  
[http://www.renesas.com/products/mpumcu/rl78/rl78g1x/rl78g14/index.jsp](http://www.renesas.com/products/mpumcu/rl78/rl78g1x/rl78g14/index.jsp)

So it does indeed look like you are going to have to change the port.c file so that it generates its tick interrupt from a different timer peripheral.

Regards.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [September 29, 2014, 9:32am UTC](https://forums.freertos.org/t/porting-freertos-to-renesas-rl78f14r5f10pgj/2206/5 "2014-09-29T09:32:02Z")

</div>

**[chris-itk](https://sourceforge.net/u/chris-itk/)** wrote on [Monday, September 29, 2014](https://sourceforge.net/p/freertos/discussion/382005/thread/5f51dd5e/#f33a/0d1e):

Thank your very much for your answer. I also thought on doing that.  
Regards
