C/OS-II Real Time Kernel Port For Cirrus Logic EP93xx Platform
C/OS-II Real Time Kernel Port For Cirrus Logic EP93xx Platform
C/OS-II Real Time Kernel Port For Cirrus Logic EP93xx Platform
Abstract — Real-time systems are a key element for ROM-able. This OS was designed for embedded
applications where deadlines must be satisfied. The absence of systems and if using adequate development tools
a time constraint in a hard real-time system can cause severe it can be embedded as a part of the final product.
material damage or even life threatening scenarios. This is why
Scalable. The total amount of memory or the
the system designer’s task is to make proper selection of an
embedded operating system that can meet these demands. memory footprint can be modified from a
configuration file accordingly to the hardware
Index Terms — µC/OS-II, hard real-time/soft real-time, restraints.
embedded system, EP9302, real-time scheduling, operating Portable. The way the software structure is built
system allows easy porting to other architectures.
Preemptive. This means that µC/OS-II will
I. INTRODUCTION always run the highest priority task that is ready
This article presents the practical steps toward running to be executed.
Micriµm’s µC/OS-II real time kernel on a Cirrus Logic Deterministic. User knows how much CPU time
EP9302 processor. is spent for µC/OS-II system function execution.
Real-time systems are a bit different from the classical Interrupt Management. The kernel can manage
ones because they have to offer a certain response within a interrupts with up to 255 levels deep.
specified time period. In the case of real-time systems, Tasks Stacks. This feature allows using separate
correct execution of tasks will depend not only on the stacks with different sizes for each task thus
correctness of the results, but also on the time instance they permitting better footprint management.
are started. Unlike soft real-time where deadline miss is not All the above characteristics conclude that µC/OS-II is a
a major problem, missing a time constraint in a hard real- well built, robust and reliable operating system that can be
time system can lead to physical damage [1][1][2][2]. used in real-time embedded systems.
All these problems are satisfied with µC/OS-II as we
could see on other tested hardware architectures. Without II. HARDWARE ARCHITECTURE
any doubt, µC/OS-II is a very powerful product, since it was The test system uses Technologic System’s TS7300
certified by the Federal Aviation Administration to meet the development board [3][3]. This board was initially sold with
requirements of the RTCA DO-178B standard for software Linux preinstalled, but we decided to use it for µC/OS-II
used in avionics equipment. Our previous testing of this porting and testing, since the hardware platform allowed this
operating system on some embedded architectures (ARM 7, software change.
HCS12) here at Stefan cel Mare University of Suceava,
proved that µC/OS-II is the best choice for real-time
applications. This OS was born back in 1992, when engineer
Jean Labrosse, future founder of Micriµm Technologies
Corporation, began working on a real-time operating system
that was needed to satisfy strict timing requirements of one
of his projects. The latest stable version is 286 and can be
found on Micriµm's website along with the latest version,
µC/OS-III.
Applications such as cameras, avionics, high-end audio
equipment, engine controls, medical equipment, industrial
machines, have been using µC/OS-II for a long time now
with great success [2][2][1].
Latest distributions allow integration with other software
packages such as µC/TCP-IP, µC/GUI, µC/File System,
µC/USB, µC/CAN, µC/Modbus, µC/Bluetooth, for
obtaining greater scalability and performance [2][2][5].
It is important to mention just a few characteristics of this
Figure 1. Hardware organization of the test board [3][3].
real time kernel to observe its key features:
85
10th International Conference on DEVELOPMENT AND APPLICATION SYSTEMS, Suceava, Romania, May 27-29, 2010
86
10th International Conference on DEVELOPMENT AND APPLICATION SYSTEMS, Suceava, Romania, May 27-29, 2010
87
10th International Conference on DEVELOPMENT AND APPLICATION SYSTEMS, Suceava, Romania, May 27-29, 2010
V. CONCLUSION
The paper presents the basic steps that need to be
performed for loading µC/OS-II on TS7300 development
board. This includes PLL configuration, cache activation
Figure 4. SDRAM Functional Block Diagram. and writing a bootloader that copies the image sent serially
to the SDRAM. For testing and development purpose the
IV. SOFTWARE CONFIGURATION UART serial download has been used. Using this system in
The second bootloader starts downloading into the an application requires adding a bigger EEPROM memory
memory from address 0x00000000. The memory domain 1 that can host the entire application code. An alternative
to which U24 is attached, starts from this address. Since all option can be the redesigning of hardware, so that stand-
available memory from the board is SDRAM, both code and alone flash memories can be used.
data segments will be placed in RAM starting from address Even though Technologic Systems TS7300 was initially
0x00 as can be seen in Listing 1. developed for use with Linux, we found that its real time
computing power comes to life when using true RT
define symbol __ICFEDIT_intvec_start__ = 0x0; operating systems such as µC/OS-II. Practical results of task
/*-Memory Regions-*/ switching times, interrupt latencies and jitter will be
define symbol __ICFEDIT_region_ROM_start__ = 0x80; presented in a future paper.
define symbol __ICFEDIT_region_ROM_end__ = 0x7FFF;
define symbol __ICFEDIT_region_RAM_start__ = 0x8000;
define symbol __ICFEDIT_region_RAM_end__ = 0xFFFF; ACKNOWLEDGMENT
/*-Sizes-*/ We would like to thank Mr. Jean Labrosse for helping us
define symbol __ICFEDIT_size_cstack__ = 0x400; with porting µC/OS-II to Analog Devices ADuC7026 back
define symbol __ICFEDIT_size_svcstack__ = 0x400;
in 2005 and for optimizing system performance and memory
define symbol __ICFEDIT_size_irqstack__ = 0x200;
define symbol __ICFEDIT_size_fiqstack__ = 0x200; footprint for a few of our educational projects.
define symbol __ICFEDIT_size_undstack__ = 0x200;
define symbol __ICFEDIT_size_abtstack__ = 0x200; REFERENCES
define symbol __ICFEDIT_size_heap__ = 0x2000; [1] Cottet F., Delacroix J., Kaiser C., Mammeri Z., "Scheduling In Real-
Listing 1. ROM, RAM and stack memory usage. Time Systems, " John Wiley & Sons Ltd, England, 2002, pp 1-41.
[2] J. Labrosse, "MicroC/OS-II The Real Time Kernel ", 2nd Ed, CMP
IAR Embedded Workbench version 5.40.1 and 286 Books, 2002, pp. 20-150.
µC/OS-II source files were used for testing. Execution of the [3] Technologic Systems, TS7300 Manual Hardware and Software
Revision 1.5 Jul 2008
µC/OS-II binary image starts with the exception handlers [4] Technologic Systems, TS7300 Schematic 1 May 2006
and stack initialization sequence that are coded in file [5] http://www.micrium.com
cstartup.s. Control is next passed to the main function that [6] Cirrus Logic, EP93xx User Guide, September 2007
[7] IAR Embedded Workbench, ARM IAR Assembler- Reference Guide
contains the initialization of the system, AppStartTask [8] IAR Embedded Workbench, IDE User Guide
creation function and the function that actually starts the [9] http://www.cirrus.com EP9302 Rev E2 Silicon
system: OSStart(). Task switching is assured by configuring [10] Samsung Electronics, 256Mb H-die SDRAM Specification, Revision
1.0, October 2005
the timer 1 to generate periodic interrupts that launch the
scheduler. We set it to trigger with 1KHz frequency. This
value must be in correlation with the OS_TICKS_PER_SEC
88