This section describes how to create a new application that uses
the RTX kernel.
First, create a new project in the µVision IDE by
selecting Project —> New Project.
In the Create New Project window, select a new directory
for your project and enter a name for your project.
In the Select Device for Target window, select your
target ARM device and click OK. Allow µVision to copy and add the
device startup file to your project. This creates a basic µVision
project.
Now setup the project to use the RTX kernel. To do this,
select Project —> Options for Target. Then select RTX
Kernel for the Operating system and click OK.
Copy the RTX configuration file for your target device from the
\Keil\ARM\RL\RTX\Config\ directory and rename it to
RTX_Config.c:
for ARM7™/ARM9™ devices, copy the configuration file
for your specific device. If the file does not exist for your
specific device, then copy the RTX_Conf_LPC21xx.c as a template
and modify it to suit your device.
for Cortex-M™ devices, copy RTX_Conf_CM.c
configuration file.
Modify the device startup file for ARM7™/ARM9™ devices
to enable SWI_Handler function (no change required for
Cortex-M™ devices):
Comment out the following line from the startup file:
SWI_Handler B SWI_Handler
Add the following line to the startup file:
IMPORT SWI_Handler
This change prevents the code from sitting in a loop when a
SWI interrupt occurs. The change allows the right function to run
when a SWI interrupt occurs.
Copy the retarget.c file from \Keil\ARM\Startup\
to your project directory, and add it to your project. The main
purpose of this file is to avoid the use of semihosting SWIs. Thus
the file must contain the following:
#include <rt_misc.h>
#pragma import(__use_no_semihosting_swi)
void _ttywrch(int ch) {
// Not used (No Output)
}
void _sys_exit(int return_code) {
label: goto label; /* endless loop */
}
Depending on your application, you might have to retarget more
functions. For example if you use the RL-FlashFS library, you can
obtain retarget.c from the \Keil\ARM\RL\FlashFS\SRC\
directory. Now the project is setup to use the RTX kernel.
For MicroLIB runtime library you do not need a
retarget.c in your project.
Now you must configure
the RTX kernel for the needs of your application by making
the required changes in the RTX_Config.c file.
Create the application source
files if they do not already exist. Add these source files
to the project. You can do this in the project workspace of µVision
by right clicking on the Source Group and selecting Add Files to
Group.
Build your application using Project —> Build
Target.
If you project builds successfully, you can download it to your
hardware or run it using the µVision Simulator. You can also
debug the application using
Debug —> Start Debug Session.
This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.
ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.