您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 信息化管理 > UCOSII在STM32上的移植
哈尔滨工业大学本科毕业设计(论文)--IμC/OS-Ⅱ在STM32中的移植摘要近些年来,数字化技术高速发展,嵌入式产品已经出现在我们生活中的方方面面。嵌入式操作系统又作为嵌入产品的基石,在产业发展过程中扮演了越来越不可替代的角色。本文主要研究了嵌入式操作系统中应用较为广泛的、源代码开放的μC/OS-II在STM32芯片上的移植。本文首先分析了μC/OS-II实时系统的内核结构,介绍了μC/OS-II的中的任务、事件等基本概念以及μC/OS-II对任务和事件的基本操作。随后介绍了本次移植用到的STM32F103系列微处理器并简要描述了该微处理器内核Cortex-M3的结构和编程模型以及部分本次移植用到的STM32F013系列微处理器的外设。然后在此基础上分析了μC/OS-II在STM32F103系列芯片上的移植,并详细地介绍了μC/OS-II需要移植的各个部分代码的结构及其编写。昀后,在IAR编译环境下,应用STM32F103微处理器芯片上的部分外设,实现串口通信、CAN总线回环测试、流水灯、LCD显示任务,这些任务在系统的调度下自动切换、不断地运行。这些代码都在万利EK-STM32和DK-STM32开发板上完成了测试工作。测试所得到的现象就是串口在不断发送和接收、LED在不停地闪烁、CAN回环测试时刻在运行、LCD上显示的内容则根据这些任务运行的信息一直在更新。这些也就反应了μC/OS-II的多任务特性,因而也证明了此次移植是成功的。关键词:μC/OS-II移植;STM32;串行通讯;CAN总线哈尔滨工业大学本科毕业设计(论文)--IIμC/OS-ⅡPORTEDTOSTM32AbstractNowadayswiththerapiddevelopmentofdigitaltechnology,embeddedproductshaveappearedineveryaspectofourlives.Embeddedoperatingsystem,whichisthebasisofembeddedproducts,playsanincreasinglyirreplaceablerole.Inthispaper,anembeddedoperatingsystem,μC/OS-II,whichisopensourceandwidelyusedwillbeintroduced,andthenthepresentationoftheportofμC/OS-IItochipSTM32F103willbeshown.Thispaperatfirstanalyzesthestructureofthekernelofthereal-timesystem,μC/OS-IIandthenintroducessomebasicconceptofμC/OS-IIsuchastask,eventetc.,andtheoperationofthem.Afterthis,themicroprocessorSTM32F103serials,anditsperipherals,whichareusedintheportexperiment,willbedescribed,andthestructureandprogrammer‘smodelofitsCortex–M3kernelwillbeintroducedbrieflytoo.Thenonthisbasis,introducetheportofμC/OS-IIinSTM32F103serialchips;thepartofCPU-relatedcodewhichneedstobemodifiedwillbedescribedatlength.Finally,inIARenvironmentandwiththeapplicationofpartsofSTM32F103peripherals,thetasksofUART,CANloopback,ledflickerandLCDdisplaywillberealized.ThesetasksarescheduledbytheOSautomaticallyandrunningallthetime.what’smore,thecodehaspassedtestonManley’sED(DK)-STM32board.FromthephenomenawecanseethatUARTtransferringandreceivinguninterruptedly,theLEDsareflickeringwithoutstop,thetaskofCANloopbackrunningallthetimeandLCDdisplayupdatingallthewhile.Allofthesereflectsthefeatureofmulti-taskaboutμC/OS-II,andtheyalsoprovethattheportissuccessful.Keywords:μC/OS–IIport,STM32,UART,CANbus哈尔滨工业大学本科毕业设计(论文)--III目录摘要.....................................................................................................................IAbstract..................................................................................................................II1.绪论.................................................................................................................11.1.引言.......................................................................................................11.2.课题背景,研究目的和意义...............................................................11.2.1.课题背景....................................................................................11.2.2.研究目的和意义........................................................................21.3.μC/OS-II的移植概述...........................................................................21.3.1.μC/OS-II的内核结构................................................................21.3.2.STM32系列微处理器简单介绍...............................................41.4.国内外在该方向的研究现状及分析...................................................41.5.本文主要研究的内容...........................................................................51.6.本论文结构...........................................................................................61.7.本章小结...............................................................................................62.RTOS概念和μC/OS-II内核结构简要分析................................................72.1.RTOS.....................................................................................................72.1.1.实时系统的特点........................................................................72.1.2.实时任务一般都是由外部事件激活的....................................72.2.实时操作系统的特点...........................................................................72.3.实时系统μC/OS-II的分析..................................................................82.3.1.μC/OS-II的任务结构................................................................82.3.2.μC/OS-II任务的管理..............................................................122.3.3.任务的调度..............................................................................132.3.4.任务的初始化和启动..............................................................132.3.5.中断和时钟..............................................................................132.3.6.任务间的通信..........................................................................132.3.7.μC/OS-II对内存的管理..........................................................142.4.本章小结.............................................................................................143.STM32F103系列微处理器简介....................................................................153.1.Cortex-M3内核简介..........................................................................153.2.Cortex-M3内核编程模型..................................................................153.3.STM32F103系列处理器介绍...............
本文标题:UCOSII在STM32上的移植
链接地址:https://www.777doc.com/doc-4842957 .html