Font Size: a A A

Research And Implementation On Kernel Transplantation Of The Embedded Operating System UC/OS-Ⅱ

Posted on:2015-04-18Degree:MasterType:Thesis
Country:ChinaCandidate:Y S HaoFull Text:PDF
GTID:2298330434460988Subject:Computer application technology
Abstract/Summary:PDF Full Text Request
As for the embedded system, uC/OS-II is a widely used and excellent RTOS kernel. Withthe emergence of32-bits micro controllers, only the peripherals and tasks that are commonlymanaged by the RTOS kernel like uC/OS-II can make developers focus on their own specificbusiness. With the basis of analyzing uC/OS-II kernel and Cortex-M3, this dissertation hasintroduced a method to transplant uC/OS-II kernel to STM32series chip based on Cortex-M3and built up an embedded network communication module based on ENC28J60and uIP stackthus expands the functions of uC/OS-II kernel.According to the kernel transplantation plan, this dissertation has analyzed the uC/OS-IIkernel from the aspects of kernel structure, task management, file system etc, illustratedCortex-M3and STM32series chip from the aspects of registering configuration, NVICinterruption mechanism, memory mapping and peripherals controlling etc. By adopting theRealView MDK, the transplant project and the board support packet has been built up anddeveloped with the assistance of STM32firmware library. During the transplantation process,uC/OS-II kernel files of OS_CPU.H, OS_CPU.C and OS_CPU_A.ASM were modified bycombining the characteristics of the microprocessor, and the task switching function wereimplemented with the PendSV interruption. Considering the new instruction of ‘CLZ’ whichis designed especially for task switching in Cortex-M3, the dissertation has given a strategy ofimproving the original task scheduling mechanism of uC/OS-II, analyzed the boot code andgave a detailed description of uC/OS-II startup process. According to the no TCP/IP stackproblem of uC/OS-II, the dissertation has selected the open sourced uIP, built up anembedded network communication module based on ENC28J60and uIP stack and fixed thebug of uIP in UDP protocol and finally completed the function expansion of uC/OS-II kernel.After the uC/OS-II kernel transplantation, several related test cases have been designedfor verifying whether the uC/OS-II kernel can be run and whether the task switchingmechanism can be accomplished. The test results shows that the uC/OS-II kernel can benormally started up and run, the value of OSCtxSwCtr can be automatically increased, themulti task switching can also be implemented for the tasks of controlling LEDs executed inturn. Pointing at the network communication module based on ENC28J60and uIP stack, thetest cases of ICMP, TCP and UDP are designed. It has been proven by tests results that theevaluation board can feedback the ICMP requests and establish a TCP connection with theNetwork Debugging Assistant run on PC. The bug of uIP stack in UDP protocol is fixed andthe UDP communication can also be in progress normally.
Keywords/Search Tags:uC/OS-II, Cortex-M3, STM32, kernel transplantation, uIP
PDF Full Text Request
Related items