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


RTI Instruction to start off Scheduler

Posted by Nobody/Anonymous on April 27, 2007
I am trying to run FreeRTOS on a HCS12X processor and when it comes to the point where the Scheduler should start there is an RTI instruction. However, the PC is then set to an instruction in the void PE_low_level_init(void) function. Then the function finishes its work and nothing happens, the PC points at an BGND instruction... I have no idea how to fix it.


RE: RTI Instruction to start off Scheduler

Posted by Nobody/Anonymous on April 27, 2007
The code goes as follows:

/* Restore the context of the first task. */

/* Simulate the end of an interrupt to start the scheduler off. */
__asm( "rti" );

Without knowing the details of the HCS port in particular, the first line should setup the stack pointer such that the RTI instruction causes the program counter to be loaded with the address of the first instruction of the task about to execute.

You should be able to step through the portRESTORE_CONTEXT() code to see this happen. When you step through the code, check that the registers are loaded with their expected values as setup by pxPortInitialiseStack() in port.c. By the looks of it the X register should contain 0xffee and the Y 0xddcc. If this is not the case then something is wrong before portRESTORE_CONTEXT() is called.

I presume PE_ functions are processor expert functions. Have you at any time enabled the processor expert in the project? If so, unzip a clean version, then when you open the project and you are asked if you want to connect it to the processor expert, select NO.

Another Dave.

RE: RTI Instruction to start off Scheduler

Posted by Nobody/Anonymous on April 27, 2007
I don't have Processor Expert at all, these functions are included in the clean version of FreeRTOS. The big problem is that the port is for MC9S12DP256 and my MCU is MC9S12XDP512 so what I am actually trying is to adapt it. I've changed the linker parameter file and the cpu.c file but it is obviously not enough.

I tried stepping through portRESTORE_CONTEXT() and unfortunately the registers don't have the values you mentioned. Could there be anything in the port files I have to change so that it works properly on my MCU?

RE: RTI Instruction to start off Scheduler

Posted by Richard on April 27, 2007
What are the differences in the architecture between the MC9S12DP256 and MC9S12XDP512? I'm guessing the 512 just means more flash, but what does the X get you?


RE: RTI Instruction to start off Scheduler

Posted by Nobody/Anonymous on April 27, 2007
Yes, 512 is the amount of Flash memory. X probably stands for XGATE, which is a "peripheral co-processor that allows autonomous data transfers between the MCU's peripherals", but I don't use it.

[ 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