Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


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 ]    [ Privacy ]    [ Sitemap ]    [ ]

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS v10.2.1 is available for immediate download. MIT licensed, includes 64-bit RISC-V, NXP Cortex-M33 demo & Nuvoton Cortex-M23 demo.

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Cadence Tensilica Cortes

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers





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

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

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner