Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




Loading

Free RTOS with RX631 and Eclipse

Posted by ampltd on March 13, 2014

I have the following hardware and software:

RX631ACD (780kbyte Program memory) Eclipse (Renesas E2 version) with kpit GCC compiler E1 Emulator 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

Thanks, Alan..


Free RTOS with RX631 and Eclipse

Posted by rtel on March 13, 2014

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)?

Regards.


Free RTOS with RX631 and Eclipse

Posted by ampltd on March 13, 2014

Hello, Thanks for the reply,

The code compiles with no errors and runs as shown below up to the instruction :

bsr.a _main


PowerONReset : /* initialise user stack pointer */ mvtc #_ustack,USP

/* initialise interrupt stack pointer */ mvtc #_istack,ISP

/* 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) */
sstr.b

/* call the hardware initialiser */ bsr.a _HardwareSetup
nop

/* 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 ; RTE ; NOP ; NOP

/* start user program */ bsr.a _main
bsr.a _exit


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. */
	prvCheckTasksWaitingTermination();
if( listCURRENT_LIST_LENGTH( &( pxReadyTasksLists[ tskIDLE_PRIORITY ] ) ) > 
      ( unsigned portBASE_TYPE ) 1 )
{
     taskYIELD();
    }        
 }

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()

Many thanks, Alan..


Free RTOS with RX631 and Eclipse

Posted by rtel on March 14, 2014

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.

Regardsd.

Attachments

sections.jpg (110700 bytes)

Free RTOS with RX631 and Eclipse

Posted by ampltd on March 14, 2014

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:

  1. linker -> sections -> sections and changed .text from FFF00000 to FFF40000

    linker -> Sections -> Memory Regions and changed ROM from FFF0000 to FFF4000

  2. 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.

Alan..


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists