I have the following hardware and software:
RX631ACD (780kbyte Program memory)
Eclipse (Renesas E2 version) with kpit GCC compiler
Sample program for RX63N for FreeRTOS/Eclipse/GCC (linked by renesasrtossolutions.org)
All software is currently up to date
The RTOS appears to work (2 tasks) when compiling everything for RX631BCD or RX63NBCD. The RX63N has just got a network controller added, but I believe is otherwise identical.
So setting Ecllipse to our CORRECT memory sized processor (ACD 780k) seems to be more the problem.
Looking at the FreeRTOS code I cannot see any memory size references, it all seems to be picked up from the Eclipse environment.
Any ideas would be most welcome
At which point do you notice a problem? For example:
- at compile time?
- at link time?
- between starting the programming running and main() being called?
- Between main() being called and the scheduler starting?
- When the first task starts?
- After the first task starts?
What are the symptoms of the problem? For example - is an exception raised? Or is the scheduler stuck in one task? Etc.
How did you change the memory map? Using the "sections" settings of the project settings, or some other method?
Are you sure the start up code is not trying to initialise the network controller (which won't be there)?
Hello, Thanks for the reply,
The code compiles with no errors and runs as shown below up to the instruction :
/* initialise user stack pointer */
/* initialise interrupt stack pointer */
/* setup intb /
mvtc #rvectorsstart, intb / INTERRUPT VECTOR ADDRESS definition */
/* setup FPSW */
mvtc #100h, fpsw
/* load data section from ROM to RAM */
mov #_mdata,r2 /* src ROM address of data section in R2 */
mov #_data,r1 /* dest start RAM address of data section in R1 */
mov #_edata,r3 /* end RAM address of data section in R3 */
sub r1,r3 /* size of data section in R3 (R3=R3-R1) */
smovf /* block copy R3 bytes from R2 to R1 */
/* bss initialisation : zero out bss */
mov #00h,r2 /* load R2 reg with zero */
mov #_ebss, r3 /* store the end address of bss in R3 */
mov #_bss, r1 /* store the start address of bss in R1 */
sub r1,r3 /* size of bss section in R3 (R3=R3-R1) */
/* call the hardware initialiser */
/* setup PSW /
mvtc #10000h, psw / Set Ubit & Ibit for PSW */
/* change PSW PM to user-mode */
; MVFC PSW,R1
; OR #00100000h,R1
; PUSH.L R1
; MVFC PC,R1
; ADD #10,R1
; PUSH.L R1
/* start user program */
At this point it is stuck in the FreeRTOS function below with nothing happening and no tasks running (using the 780k processor selection in eclipse)
static portTASK_FUNCTION( prvIdleTask, pvParameters )
/* Stop warnings. */
( void ) pvParameters;
for( ;; )
/* See if any tasks have been deleted. */
if( listCURRENT_LIST_LENGTH( &( pxReadyTasksLists[ tskIDLE_PRIORITY ] ) ) >
( unsigned portBASE_TYPE ) 1 )
If I INCORRECTLY Use the 1M processor selection then we jump to main() and the tasks seem to run ok
I have looked at the stack pointers and the load data registers in this startup code for both possible processors and they both seem correct
There is NO code in the _HardwareSetup routine and I don't think there is any other hardware initialisation, the code works ok with B processor with or without network and doesn't work with A processor at all.
I do not know where there is a memory map (rom/ram sections etc) I have simply selected the correct processor in eclipse.
No exceptions, just stuck in portTASK_FUNCTION()
This sounds like a linker script issue rather than a FreeRTOS issue, but could also be related to something different in the way the timer that generates the tick interrupt is accessed: portTASK_FUNCTION() is just a macro, you are actually stuck in the idle task. Can you confirm that tick interrupts are executing correctly - the easiest way to do that is to break on the debugger while in the idle function and check the value of the xTickCount variable. Then let it run a bit longer, break in the debugger again and check xTickCount again - has its value increased? The other way of course is to put a break point in the interrupt's handler.
To set the memory map (effectively the linker script): Bring up the project options dialogue box. Select C/C++ Build->Setting in the left panel of the dialogue box. Then select the Tools Setting tab on the right side of the dialogue box, and go to Linker->sections. See the attached image.
Hi: Real Time Engineers
** PROBLEM SOLVED **
I had been used to IAR linker files and couldn't see one in Eclipse and assumed WRONGLY that when you select the exact processor type then the memory map was automatically configured. This was further wrongly confirmed as I run the program I could see the correct start of memory being picked up ok !
I was simply using a RX631A which has program memory starting at FFF40000 instead of FFF00000 for the RX631B
There are other documented changes in a document on renesasrtos.com for the RX63N for GCC compilers
So I changed two things:
linker -> sections -> sections and changed .text from FFF00000 to FFF40000
linker -> Sections -> Memory Regions and changed ROM from FFF0000 to FFF4000
linker -> Sections -> Sections and changed .data from 0x00000204 to 0x00000404
linker -> Sections -> Sections and changed .ustack from 0x00000200 to 0x00000400
linker -> Sections -> Sections and changed .istack from 0x00000100 to 0x00000300
Note BOTH of these had to be done, otherwise the RTOS would not run
Many thanks for your help, I have a better understanding now of how to make RTOS run for different size processor memories.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.