Quality RTOS & Embedded Software

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


How to port to new ARM9 CPU?

Posted by Jeff Owen on August 16, 2010
I would like to use FreeRTOS with an ARM9 LPC3250. I purchased the guide, but it does not seem to cover porting to new CPU's except to say start with a current project. It also lists the basic steps to set up a project in the IDE. Seems like it would be important to set up an interrupt for the RTOS, but i did not see any mention of that. Are there any guidelines on how the tick IRQ should be setup? Timing recommendations for the periodic IRQ? Is it in the code? I have not started digging into the source yet, so it could be documented in there.

As far as starting with an existing project, the Atmel AT91SAM9 (ARM9) Port appears to be similar (both ARM9), but it uses the IAR tools and I was planning on using the Rowley tools, not to mention an Atmel CPU rather than an NXP CPU..

Any suggestions as to which project to start with and how to set up the RTOS IRQ would be greatly appreciated!

RE: How to port to new ARM9 CPU?

Posted by Dave on August 16, 2010
There is a bit of information here http://www.freertos.org/FreeRTOS-porting-guide.html but it does not go deep enough for what you want.

I would probably start with an ARM7 GCC port if there are no ARM9 ports that are suitable as a base. To the RTOS ARM7 and ARM9 look the same.

prvSetupTimerInterrupt() in port.c will definitely need changing. Get the tick interrupt working in isolation first to keep things simple. Just have it increment a variable, then when you are happy it is firing at the right frequency you can add in the real code, using the ARM7 base as a reference. The real code should save the context (again use the ARM7 code as a reference), call vTaskIncrementTick(), then vTaskSwitchContext() (this does not switch context but select the next task to run) then restore the context of the selected task.

Make sure you have SWI interrupt call vPortYieldProcessor() and read the fifth post here about IRQ interrupt https://sourceforge.net/projects/freertos/forums/forum/382005/topic/3797181 .

Stacks need to be configured for IRQ and Supervisor modes, then also for any other modes you use specifically, and make sure main() is only called in Supervisor mode.

RE: How to port to new ARM9 CPU?

Posted by Jeff Owen on August 16, 2010
Thank you very much, that should get me started in the right direction!

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

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

Latest News

Version 10.1.0 of the FreeRTOS kernel is available for immediate download. MIT licensed.

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

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