基于uC/OS-Ⅱ的嵌入式系统及其在测控中的应用
详细信息    本馆镜像全文|  推荐本文 |  |   获取CNKI官网全文
摘要
随着互联网的普及,嵌入式系统已越来越重视网络特性,基于嵌入式Internet网络将会成为下一代工业控制网络的重要选择,并将带来工业控制新的革命。
     然而,目前大多数嵌入式系统还处于单独应用的阶段,工业测控领域也只是利用孤立于Internet以外的控制通信网络,如RS485,CAN,I2C等现场总线实现MCU组网,由工控机汇总和管理所有现场采集的数据信息,最后实现与外界远端客户机的通信。如果能将这些小型的嵌入式控制设备具有连接到Internet上,就可以方便低廉地将信息传送到远端客户机上从而可以实时高效地进行远程监控。
     但是,在工业测控系统中将这些嵌入式设备接入Internet的困难在于,工业控制网络中广泛存在8位和16位的嵌入式控制设备,而在这些以低端微处理器为核心的每一个嵌入式设备上移植TCP/IP协议栈是不切实际的。针对上述问题一种较好的解决方案是,构建一个以32位为核心的嵌入式瘦服务器,取代以PC胖服务器为主的传统网络接入方案,通过RS232、RS485和CAN总线轻量级网等方式,将多个嵌入式设备连接在一起,一方面担当TCP/IP和轻量级网之间有关协议的转换任务,另一方面为远程浏览器提供数据访问,数据传输等服务。
     基于以上设想,本课题利用32位ARM7核S3C4510B所提供的丰富的系统资源和强大的处理能力,通过移植运行在源码公开的实时嵌入式操作系统精简内核uC/OS-II上的一套精简的TCP/IP协议栈LWIP,提出一种应用在烟气连续排放监测系统(Continuous Emission Monitoring System,简称CEMS)的网络接入方案,将广泛应用在工业控制网络中的现场总线所采集到的数据通过Internet传送到远程监控设备。
     为了实现上述目标,笔者主要做了以下工作:
     1.编写针对S3C4510B的启动代码,初始化必要的硬件设备,创建精简内核uC/OS-II需要的一些信息,完成中断向量映射,时钟设置,内存参数设置和堆栈初始化等任务,从而将系统的软硬件环境带到一个合适的状态;
     2.围绕中断的处理在S3C4510B上移植uC/OS-II作了三种不同的尝试,即嵌套式中断形式,非嵌套式中断形式和软中断系统调用形式,最后总结了移植中存在的问题并提出了改进的方法;
     3.根据精简内核uC/OS-II的特点,完成LWIP协议栈操作系统模拟层的封装,将LWIP移植到uC/OS-II平台上,实现TCP/IP协议栈的最基本功能;
     4.针对烟气连续排放监测系统(CEMS)现行网络接入方案存在的一些不足,为了产品的预研和日后的升级,将以上构建的嵌入式瘦服务器应用于CEMS中,提出一种可行的嵌入式Internet接入改进方案。
With the popular of the Internet, embedded system emphasizes networking features.The technology of the embedded internet will lead the industrial networking into the new era, making it a great revolution in the industrial world.
     However, the remote monitoring system always utilizes 8-bit and 16-bit MCUs which are widely used in industry to shoulder the task of gathering the data through traditional light weight netwoking Field Bus such as RS485/RS232、CAN etc. With inherent shortcomings, no uniform standards seriously limited the merits we pursuit. Making it worse, it is impossible and unnecessary to plant TCP/IP stack onto every low level MCU. To solve this problem,a feasible solution would be to construct a 32-bit Embedded System,not only playing a role as a gateway to connect FieldBus with Internet, but also realizing a‘Lean Server’to offer services for remote clients.
     And this paper introdues a solution to realize a‘Lean Server’on a 32-bit S3C4510B,a powerful ARM7 MCU. It immigrates the downsized TCP/IP stack LWIP into uC/OS-II, a customized RTOS planted into the S3C4510B previously, finally realizing most applications with embedded Internet. At the end of this paper, it introduces how to utilize this embedded system in the CEMS,making it possible to reconstruct the original networking solution to monitor the data gathered by low-level embedded devices through Internet which is connected by FieldBus widely used in industrial networking.
     To achieve these goals, the major contribution of this paper are as follows:
     1. Tailoring the bootloader for S3C4510B, completing such tasks as initializing hardware devices which necessary, configuring memory parameters, initializing stack pointers.
     2. Focusing on approaches of handlering interrupts, this paper makes three attemps to plant uC/OS-II onto ARM7 core S3C4510B, one for non-nesting Interrupt, the second for nesting Interrupt, the last for System Call using Software Interrupt, finally proposing solution to promote original shortcomings existing in planting.
     3. After analyzing the Operating System Simulating Layer of LWIP, It immigrates the downsized TCP/IP stack LWIP into uC/OS-II to realize the basic function of TCP/IP;
     4. It finally offers a feasible solution to utilizes this embedded system implemented above to reconstruct original networking of Continuous Emission Monitoring System(CEMS), making FieldBus integrated into Internet.
引文
1.杜春雷.ARM体系结构与编程[M].北京:清华大学出版社2003.2.
    2.周立功. ARM嵌入式系统基础教程[M].北京:北京航空航天大学出版社. 2005.1.
    3.田泽.嵌入式开发与应用实验教程[M] .北京:北京航空航天大学出版社,2004. 264 -270.
    4.陈赜. ARM嵌入式技术实践教程[M] .北京:北京航空航天大学出版社,2005. 189 -203.
    5. I. Kuroda, T. Nishitani, Multimedia processors, in: Proc. the IEEE 86 (6), June (1998) 1203-1221.
    6. P.R. Panda, N.D. Dutt, and A. Nicolau, Architectural exploration and optimization of local memory in embedded systems, in: Proc. the Tenth International Symposium on System Synthesis, Sep. 1997, pp. 90-97.
    7. W. Shiue, S. Udayanarayanan, and C. Chakrabati, Data memory design and exploration for low-power embedded systems, ACM Trans. Design Automation of Electronic Systems 6 (4), Oct. (2001) 553-568.
    8. S. Santhanam, StrongARM SA110 - A 160MHz 32b 0.5W CMOS ARM Processor, Hot Chips 8: A Symposium on High-Performance Chips, Aug. (1996).
    9. P. Struik, P. van der Wolf, and A. D. Pimentel. A combined hardware/software solution for stream prefetching in multimedia applications, in: Proc. SPIE Multimedia Hardware Architectures, Jan. 1998, pp.120-130.
    10.王田苗.嵌入式系统设计与实例开发[M] .北京:清华大学出版社,2003. 62—89.
    11.万永波.基于ARM的嵌入式系统Bootloader启动流程分析[J].微计算机信息,11:90-92.
    12. International technology roadmap for semiconductors (ITRS)-design, http://public.itrs.net, 2005.
    13.徐荣珍。基于ARM7TDMI处理器的嵌入式系统启动流程[J]。计算机工程,2006,02:251-252
    14.李培毅.基于S3C4510B的嵌入式系统启动设计[J]重庆大学学报(自然科学版).2005,11:35-38
    15. J. Tse and A.J. Smith, CPU cache prefetching: Timing evaluation of hardware implementations,IEEE Trans. Computers 47 (5), May (1998) 509 - 526.
    16. C. Zhang, F. Vahid, and W. Najjar, A highly configurable cache architecture for embedded systems,in: Proc. the 30th Annual International Symposium on Computer Architecture, June 2003, pp. 136-146.
    17. SAMSUNG. S3c4510b Datasheet[M].Korea1999.3.
    18. Z. Xu, S. Sohoni, R. Min, and Y. Hu, An analysis of cache performance of multimedia applications,IEEE Trans. Computers 53 (1), Jan. (2004) 20-38.
    19.陈莉君. Linux操作系统内核分析[M].人民邮电出版社. 1998.
    20. L. Benini, G. DeMicheli, Networks on chips: A new SoC paradigm, IEEE Computer 35 (1) (2002) 70–78.
    21.刘波,马连川,张建明。嵌入式实时操作系统选用的初步分析[J]。北方交通大学学报2000年10月第24卷第5期
    22. P. Sharma, J. Loyall, G. Heineman, R. Schantz, R. Shapiro, G. Duzan, Component-based dynamic QoS adaptations in distributed real-time,and embedded systems, in: Proc. of the Intl. Symp. on Dist. Objects and Applications, DOA’04, Agia Napa, Cyprus, 2004.
    23. J.A. Stankovic, R. Zhu, R. Poornalingam, C. Lu, Z. Yu, M. Humphrey, B. Ellis, VEST: Anaspect-based composition tool for real-time systems,in: Proceedings of the IEEE Real-time Applications Symposium, IEEE, Washington, DC, 2003, pp. 58–69.
    24. Labrosse.嵌入式实时操作系统uC/OS-II[M].北京:北京航空航天大学出版社2003.5.
    25. W. Roll, Towards model-based and CCM-based applications for real-time systems, in: Proceedings of the International Symposium on Object-Oriented Real-time Distributed Computing, ISORC, IEEE/IFIP, 2003.
    26.任哲.操作系统uCOS-II原理及应用[M].北京:北京航空航天大学出版社2005.8.
    27.王明奇.uC/OS-II在ARM7微处理器上的移植[J].电脑与信息,2006,1005:22.
    28.刘雷.嵌入式实时操作系统uC/OS-II在Intel80x86上的移植[J].山东科学, 2005,26:52.
    29.雷必成,吴高标,吴永良.嵌入式实时操作系统uC/ OS- II的移植探讨[J ] .自动化技术与应用,2003 , (5) :1 -3.
    30.朱华军. uC/ OS - II操作系统在ARM处理器上的技巧[J ] .计算机工程,2004 , (S1) :2 -3.
    31.曾鸣. uC/ OS - II实时操作系统在嵌入式平台上进行移植的一般方法和技巧[ J ] .今日电子, 2004 , (11) :2 -3.
    32.叶丰桥,黄海. uC/ OS - II在51XA上的移植应用[J ] .工业控制计算机,2002 , (10) :1 -2.
    33.靳文兵.嵌入式操作系统uC/OS-II在单片机上的移植[J].太原理工大学学报2006,32:204-206.
    34. Andew S. Tanenbaum.计算机网络[M].清华大学出版社. 1999.
    35. W.Richard Stevens. TCP/IP详解[M].机械工业出版社. 2001.
    36.何轩,夏应清,李祥.基于以太网的嵌入式系统网络接口卡的设计.电子产品世界, 2005, (5): 34~37.
    37.姚鹰,蒋健,魏德骄.基于μCOS-Ⅱ的嵌入式系统的网络通讯实现.工业控制计算机, 2004, (12): 32~34.
    38. Sys_arch. txt in LwIP source code. Adam Dunkels
    39. Design and Implementation of the LwIP TCP/ IP Stack.Adam Dunkels
    40.张利华石中锁嵌入式WEB.监控系统服务器软件的设计[J].微计算机信息2004,12:79- 80
    41.曹洋.以太网与CAN总线间网关的设计与实现[J ].微型机与应用, 2004, 23 (9) : 28 - 30.
    42.杨波,徐成.嵌入式CAN2Ethernet网关的设计与实现[J ].计算机应用, 2005, 25 (2) : 273-275.
    43.梁泰文,阳宪惠. CAN / Internet嵌入式网关的一种设计方案及实现[J ].冶金自动化, 2004, 28 (2) : 5 - 10.
    44.李恩,蔡丽,梁自泽,等.一种适用于煤矿安全监控系统的CAN总线应用层通讯协议[ J ].计算机应用, 2006, 26 (9 ) : 2178 -2181.
    45.沈玉龙等.智能家居控制系统设计[J].电子科技,2004,5:47- 50.
    46. C. Lee, M. Potkonjak, and W.H. Mangione-Smith, MediaBench: a tool for evaluating and synthesizing multimedia and communications systems, in: Proc. the Thirtieth Annual IEEE/ACM International Symposium on Microarchitecture, Dec. 1997, pp. 330-335.

© 2004-2018 中国地质图书馆版权所有 京ICP备05064691号 京公网安备11010802017129号

地址:北京市海淀区学院路29号 邮编:100083

电话:办公室:(+86 10)66554848;文献借阅、咨询服务、科技查新:66554700