Presentation is loading. Please wait.

Presentation is loading. Please wait.

Implementation of Embedded OS Lab3 Porting μC/OS-II.

Similar presentations


Presentation on theme: "Implementation of Embedded OS Lab3 Porting μC/OS-II."— Presentation transcript:

1 Implementation of Embedded OS Lab3 Porting μC/OS-II

2 Lab3 Goal  Learn how to port μ C/OS-II to the ARM platform. 2015/5/26 / 122 * source: www.arm.com

3 Lab3 Environment  Host System  Windows XP  Build System  VirtualBox + Ubuntu 8.04  Target System  Creator XScale PXA270  Software  The binary support package for PXA270.  The source codes of μ C/OS-II.  The application note (AN-1011) for porting μ C/OS-II.  You can download them from RSWiki IEOS Course SoftwareRSWiki IEOS Course Software 2015/5/26 / 123

4 Lab3 μC/OS-II 2015/5/26 / 124  μ C/OS-II is a real-time operating system with the following features.  Highly portable  ROMable  Very scalable  Preemptive real-time  Multitasking  …  The source codes can be downloaded from the official website freely.

5 Lab3 Porting Strategies (1/2) 2015/5/26 / 125  μ C/OS-II can be split into core and port.  To port μ C/OS-II to the ARM architecture, we need to implement the ARM port.  A generic ARM port is included in the source archive on our course website.  We only need to modify timer- related functions.  The difference between μ C/OS- II and μ C/OS-III can be found in the user manual of μ C/OS-III. Files that we should modify remaining unchanged

6 Lab3 Porting Strategies (2/2) 2015/5/26 / 126  There are four components should be considered first.  Memory  The very first step is to initialize the DRAM controller so that we can load executable images to the target board.  UART console  It is useful for debugging.  Interrupt  It enables us to handle asynchronous events from peripheral devices.  Timer  It will keep the scheduler running repeatedly.  The information about how to configure the components can be found in the datasheet of the microprocessor.

7 Lab3 Directories and Files of μC/OS-II Source Codes 2015/5/26 / 127  The source files are put in three different directories. ./PXA270 : port-specific  It contains files specific to the hardware platform.  OS_CPU.H : constants, macros, and types specific to the platform.  OS_CPU_C.C : C functions for scheduling and processor events.  OS_CPU_A.S : assembly codes for interrupt handling and context switching. ./SOURCES : core  It contains files implementing the core functionality of μ C/OS-II. ./TEST : application-specific  It contains files specific to the application, i.e., the entry functions of user-defined tasks.  The detail information can be found in the application note.

8 Lab3 Board Support Package (BSP) 2015/5/26 / 128  A board support package contains the minimal codes supporting a specific OS for the given target board.  It usually has the following components.  Low-level initialization functions  A bootloader  OS startup functions  Device drivers  In lab4, we will use U-Boot to load μ C/OS-II.  Hence, only the last two components are needed for porting μ C/OS-II.

9 Lab3 Lab Steps (1/3) 2015/5/26 / 129  Modify uCOS-II/TEST/Makefile.  The toolchain prefix should be changed.  μ C/OS-II should be compiled without using standard C library.  You can exclude the C library from linking with the gcc option “- nostdlib -lgcc”.  Modify source codes.  You might need to implement some C library functions, e.g., strncpy, strncmp, memcmp, etc.  Hints:  Please do not include any headers from Linux or the C library.  “NULL” is actually a macro expending to “((void*)0)”.

10 Lab3 Lab Steps (2/3) 2015/5/26 / 1210  Try compiling the source codes.  You will get TEST.bin if the compilation is done successfully.

11 Lab3 Lab Steps (3/3) 2015/5/26 / 1211  Add timer update function.  It should reprogram the timer to the next deadline when the timer interrupt occurs.  Hints:  when a timer interrupt occurs, the function “OSTimeTickHook” will be invoked.  The timer can be updated by invoking the function “Update_OSMR0” with an argument “p_irq_desc[IRQ_OST0].pVoid”.  Flash the kernel image.  The entry point of μ C/OS-II is at 0xa1000000.  The image should be loaded to that address before execution.  Please use the command mkimage to create uImage for μ C/OS-II.

12 Lab3 Lab Requirements 2015/5/26 / 1212  Let U-Boot load and boot μ C/OS-II automatically.  The timer should be set correctly in μ C/OS-II so that the tasks can run alternately.


Download ppt "Implementation of Embedded OS Lab3 Porting μC/OS-II."

Similar presentations


Ads by Google