FreeRTOS for the Renesas Demonstration kit (RDK) for the RX62N

I tried to ready FreeRTOS for the Renesas Demonstration Kit (RDK) for the RX62N. I could build it, but it did not run correctly. I also tried to modify a port for the Renesas Starter Kit (RSK) for the RX62N. It also did not work but I could build it. The port for the RSK was from 2011 and tasks.c was 70K. Where as todays task.c is over 200k.

Could any one elaborate on this.

Please specify “did not run correctly.”

When run and stepped through the execution of an example using the Hew, the program made a continuous loop through the same code but not going through the expected code.

What are those code? Can you share those code snippets?

Also, can you try to use the latest version? Per this readme, you should be able to use this port - FreeRTOS-Kernel/portable/Renesas/RX600v2 at main · FreeRTOS/FreeRTOS-Kernel · GitHub

Here are the code snippets, with comments from the Hew (High Performance Embedded Workstation) running in Debugger mode stepping through the code. Which was downloaded to the board and run from the board.

2349 portDISABLE_INTERRUPTS – only code line run by debugger, won’t step in

459 rpdl_INTC_callback_func[PDL_INTC_PRIVILEGED] – code run to here

That does not provide much help. Can you try using the latest FreeRTOS code and the port I mentioned above?

I tried … and got lots of errors. I already tried once before and got similar.
I first tried to compiler port.c

In FreeRTOSConfig.h – remedy found for the following
//#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 7 ) – not accepted by compiler
#define configMAX_PRIORITIES (7) – alternative

In port.c
BaseType_t xPortStartScheduler( void )

/* Start the first task. */
190 prvStartFirstTask();


#pragma inline_asm prvStartFirstTask
static void prvStartFirstTask( void )

MOV.L	#_pxCurrentTCB, R15

port.c(190) : A2002 (E) Characters exist in expression
port.c(190) : A2002 (E) Characters exist in expression
port.c(190) : A2113 (E) Symbol definition is not appropriate
port.c(190) : A2002 (E) Characters exist in expression
port.c(190) : A2002 (E) Characters exist in expression
port.c(190) : A2113 (E) Symbol definition is not appropriate
port.c(256) : A2113 (E) Symbol definition is not appropriate

I don’t no what to do about this one off hand.

I looked at how Renesas starts assembler in the c program file. I took out the #pragma

//#pragma inline_asm prvStartFirstTask
static void prvStartFirstTask( void )
/* When starting the scheduler there is nothing that needs moving to the
interrupt stack because the function is not called from an interrupt.
Just ensure the current stack is the user stack. */

/* Obtain the location of the stack associated with which ever task
pxCurrentTCB is currently pointing to. */
MOV.L   #_pxCurrentTCB, R15
MOV.L   [R15], R15

and got …
Phase RX C/C++ Compiler starting
…port.c(207) : C5020 (E) Identifier “SETPSW” is undefined
port.c(211) : C5065 (E) Expected a “;”
port.c(211) : C5010 (E) “#” not expected here
port.c(235) : C5012 (W) Parsing restarts here after previous syntax error
Phase RX C/C++ Compiler finished

Build Finished
3 Errors, 1 Warning

I would like to add that taking out the assember pragma was false. I found similar at the top of renesas resetprg.c file. Also all other FreeRTOS files (heap_4.c, list.c, queue.c and tasks.c) would compile without any issues.

I also should mention that for the RX62N there was no FreeRTOSConfig.h file as there was no port, due to a security problem. Files for the RX600v2 under the portable directory were available and used but had no FreeRTOSConfig.h file. I used one from the examples for the Renesas Starter Kit for the same RX62N. This could be the problem I’m having.

Where did you get the code from?

If you just run the code, then pause in the debugger, what is the MCU executing? Is it always executing the same thing? Please link to the lines in github rather than provide a line number - line numbers don’t help unless we also have the source file you are using. For example, this links to line 568 in the head revision of tasks.c

Which compiler and compiler version are you using?

Don’t remove the pragmas unless you are using a later compiler version which has a different way of inlining assembly code. It definitely won’t work if you remove the pragams and don’t replace them with anything else.


Pleased to have you.

The FreeRTOS source was downloaded from the FreeRTOS website around December 2012 and is version FreeRTOSv202212.00. I just saw that there is now a newer version available 01.

The MCU was always executing the same thing. I dumped the code and started new. I must have erased important code to make it compile but breaking the code.

On the new compiler errors:

This shows the fixed line. The previous one (72) is the line that did’nt work.

This shows the line in port.c Nr. 190 that complains.

Here is the data about the build tools from the High Performance Embedded workstation
High-performance Embedded Workshop

RX Standard Toolchain (V.

RX Family C/C++ Compile Driver V.
RX Family C/C++ Compiler V.
RX Family Assembler V.
Optimizing Linkage Editor V.
RX Family C/C++ Standard Library Generator V.
Copyright (C) 2008 (2009 - 2011) Renesas Electronics Corporation and
Renesas Solutions Corp.
Copyright (C) 1999 Hitachi, Ltd.
All rights reserved.

I already saw that I had to replace the pramas. So they are there.

So it looks like you are using one of the latest FreeRTOS releases, but an RX demo from the older FreeRTOS V10.4.x because the demos were removed from the main release (because they used uIP with a security flaw). Is that correct?

I’m looking at V10.4.x, in which there are a couple of RX62N demos that use the Renesas compiler. Looking at configMAX_PRIORITIES in the FreeRTOSConfig.h files in those projects I see:


So in those projects the definition is already set to just “7” without the unsigned portBASE_TYPE cast. That said, looking at the head revision of the kernel (if you are using a recent version of everything other than the demo) I see portBASE_TYPE defined at:

So don’t see why “unsigned portBASE_TYPE” wouldn’t compile - although this is a very old method, BaseType_t is preferred for some time now.

I was actually using FreeRTOS V6.1.1 from 2011. Much older than V10.4.x. It was for demos on the Renesas Starter Kit for the RX62N. I tried using your V10.4.x file. I had to add definitions for :
/* Added myself to fulfill error messages */

but I got a new single error in port.c
port.c(238) : C2703 (E) Illegal #pragma interrupt declaration

What could I try here?

The older FreeRTOSConfig.h file

Are you not using the latest RX compiler? Can you try using the latest compiler?