嵌入式Linux操作系统下EZ-USB设备驱动程序的设计与实现
详细信息    本馆镜像全文|  推荐本文 |  |   获取CNKI官网全文
摘要
Linux系统是一款优秀的开放源码的操作系统,正是因为其开放性和可移植性使它在当前的嵌入式产品开发中有着非常重要地位。
     通用串行总线(USB)作为一种新型总线,日益广泛地应用到IT产品中。Cypress Semiconductor公司的EZ-USB FX2是世界上第一款集成USB2.0的微控制器,它集成了USB2.0收发器、SIE(串行接口引擎)、增强的8051微控制器和可编程的外围接口。在FX2中,智能SIE可以硬件处理许多USB1.1和USB2.0协议,从而减少了开发时间和确保了USB的兼容性。
     由于Cypress公司没有提供Linux系统下面EZ-USB FX2设备驱动程序,所以本课题的目标就是设计和实现EZ-USB FX2在Linux操作系统下面的设备驱动程序,并且要为已建立在Windows系统下的医学影像采集处理系统提供Linux系统下面的与Windows系统一致的固件下载接口。本文首先对EZ-USB FX2设备的体系结构和Linux 2.6内核的驱动模型进行了分析,然后提出了EZ-USB FX2设备驱动的设计方案以及对起固件下载接口的封装方案,最后是对方案的实现。
     课题的设计、实现涉及到Linux驱动程序、固件下载、接口封装三个方面的内容。在Linux驱动程序实现中,采用了Linux-2.6.20版本内核作为驱动开发的源码树支持,2.6.20内核不仅是一款非常稳定的内核版本而且还为开发人员提供了一些新的特性使开发更加便利,提高了开发的效率。本课题的固件下载是在已建立好的EZ-USB FX2驱动程序的基础上在用户空间中对驱动程序进行调用以完成固件下载任务,这样不仅提高了对内核资源的有效利用而且还降低了调试的难度。在封装固件下载接口的时候,针对Windows系统下已经建立的医学影像采集处理系统中所采用的下载函数以及函数内部所调用的Windows系统中用于设备通讯的DeviceIoControl接口进行了统一封装,为医学影像采集处理系统的跨系统移植奠定了基础。
     本文在Linux驱动程序和固件下载程序的设计与实现中,以软件工程的思想为指导,采用统一建模语言UML工具,对所研究的内容进行了设计、分析和实现。
     最后,还对所做工作的难点与不足进行了阐述和总结,对Linux设备驱动模型和USB2.0技术的前景进行展望、最新发展动态进行了跟踪。
Linux system is an outstanding open-source operating system, and it takes up a high positon in contemporary development of embedded products because of the open-source and transportation.
     As a new-type computer bus, Universal Serial Bus (USB) has already become a part of peripheral equipment of PC. Cypress’s EZ-USB FX2 is the world’s first USB 2.0 integrated microcontroller. By integrating the USB 2.0 transceiver, SIE, enhanced 8051 microcontroller, and a programmable peripheral interface in a single chip, Cypress has created a very costeffective solution that provides superior time-to-market advantages. The Cypress Smart SIE handles most of the USB1.1 and USB2.0 protocols in hardware, thus it decreases development time and ensures USB’s compatibility.
     Because Cypress corporation don’t provide the EZ-USB FX2 device driver on linux system, so our subject is that we need to design and implement the EZ-USB FX2 device driver on linux system, and provide a identical firmware download interface for a application named Medical Image Conllecting System which had been built on windows system. Firstly, this thesis analyse the architecture of EZ-USB FX2 device and the driver program model of linux 2.6 kernel, then give a blue print of EZ-USB FX2 device driver and identical interface, and take it into implementation.
     These design and implementation of my subject involve three aspects included Linux device driver, firmware download and indentical interface. In implementation of Linux device driver, I take the linux kernel source which’s version is 2.6.20 to surpport the development of device driver as source tree. 2.6.20 version kernel is not only a stable version but also provide some new traits for developers to upgrade efficiency. The firmware download utility which invokes the device driver to finish the firmware download task is built in user space, this design not only minimize the cost of kernel resource but also the difficulty of debugging. The interface of firmware download is identical to the interface of Medical Image Conllecting System built on windowns, moreover, the function named DeviceIoControl which is in charge of communication between host and device, and these works is a base of transportation of whole application.
     In the design of Linux device driver and interface, i have used Unified Modeling Language (UML), obeying basic software engineering rules.
     Finally, some difficulties and insufficiency are considered, and prospect the Linux devicer driver program model and USB On-The-Go (OTG).
引文
[1] 刘彤, 周功业. USB 接口技术在外置式采样系统中的应用. 今日电子. 2006: 2-5
    [2] 刘丁, 王云飞. USB 在数据采集系统中的应用. 电子技术应用. 2007:20-50
    [3] 许永和. EZ—USB FX 系列单片机 USB 外围设备设计与应用. 北京:北京航空航天大学出版社. 2005
    [4] 钱峰. EZ—USB FX2 单片机原理,编程及应用. 北京:北京航空航天大学出版社. 2006
    [5] Cypress Inc. Cypress USB 2. 0 Mass Storage Device Driver for Windows 2000 http://www. cypress. com/cfuploads/support/app_notes/MassStorageDriver. pdf. Jan 2003:1-4
    [6] Cypress Semiconductor Inc. Soft USB Controller Design Challenges http://www. cypress. com/cfuploads/support/app_notes/Soft_USB_Controller. pdf. Jan 2002:1-3
    [7] Cypress Semiconductor Inc. Choosing the Right Device for Your USB Application http://www. cypress. com/cfuploads/support/app_notes/Choosing_Device. pdf. Apr 2002:1-2
    [8] Keil Software Inc. Using the DDE Interface of the μVision2 Debugger http://www. keil. com/appnotes/docs/apnt_143. asp. July 2002:1-2
    [9] Keil Software Inc. Programming the Cypress EZ-USB Board. http://www. keil. com/appnotes/docs/apnt_162. asp. July 2002: 1
    [10] Keil Software Inc. Using and Programming the I2C Bus. http://www. keil. com/appnotes/docs/apnt_153. asp. July 2002: 1-2
    [11] Anon. Best of Everything in Data Acquisition. Scientific Computing and Instrument. Dec 1999: 30
    [12] 张弘. USB 接口设计. 西安:西安电子科技大学出版社. 2005
    [13] 萧世文. USB2.0 硬件设计. 北京: 清华大学出版社. 2006
    [14] 马伟. 计算机 USB 系统原理及其主/从机设计. 北京:北京航空航天大学出版社. 2004
    [15] Jan Axelson. Universal Serial Bus Complete. 北京:中国电力出版. 2005
    [16] 廖济林. USB2.0 应用系统开发实例精讲. 北京:电子工业出版社. 2006
    [17] 周立功. USB2.0 与 OTG 规范以及开发指南. 北京:北京航空航天大学出版社. 2004
    [18] 李英伟,王成儒,练秋生,胡正平. USB2.0 原理与工程开发. 北京:国防工业出版社. 2007
    [19] Wooi Tan. Developing USB PC Peripherals. Lakeview Research. 2000: 45-77
    [20] Cruickshank, H., Sun,Z. Universal Serial Bus Implementation in Integrated Access Chip for ISDN System. Communications, IEEE Proceedings, Volume:148 Issue:4,Aug 2001:207-211
    [21] Mike Zerkus, John Lusher & Jonathan Ward. USB Primer Practical Design Guide. RircuidCellar. May 1999:2
    [22] 孙琼. 嵌入式 Linux 应用程序开发详解. 北京:人民邮电出版社. 2005
    [23] 田泽. 嵌入式系统开发与应用. 北京:北京航空航天大学出版社. 2006
    [24] 陈俊宏. Embedded Linux 嵌入式系统原理与实务. 北京:中国铁道出版社. 2007
    [25] 李善平,陈文智. 边干边学 Linux 内核指导. 杭州:杭州浙江大学出版社. 2004
    [26] 张磮. 32 位嵌入式系统硬件设计与调试. 北京:机械工业出版社. 2006
    [27] 周立功. arm 嵌入式系统软件开发实例(二). 北京:北京航空航天大学出版社. 2006
    [28] 周立功. arm 嵌入式系统实验教程(二). 北京:北京航空航天大学出版社. 2006
    [29] 毛德操,胡希明. 嵌人式系统. 杭州:杭州浙江大学出版社. 2006
    [30] 刘淼. 嵌人式系统接口设计与 Linux 驱动程序开发. 北京:北京航空航天大学出版社. 2006
    [31] 马忠梅,李善平,康慨. ARM & Linux 嵌入式系统教程. 北京:北京航空航天大学出版社. 2004
    [32] [美]Jonathan Corbet,Alessandro Rubini, Greg Kroah-Hartman. Linux Device Drivers, Third Edition. O'REILLY. 2005
    [33] 肖距雄,翁铁成,宋中成. USB 技术及应用设计. 北京:清华大学出版社. 2003
    [34] 马伟. 计算机 USB 系统原理及其主/从机设计. 北京:北京航空航天大学出版社. 2004
    [35] High Speed USB Platform Design Guidelines. http://www. usb. org :2002:1-3
    [36] Tom Cantrell. To USB, or not to USB. Computer Design. May 1997. :82-88
    [37] Talbot Mark, Nayer Rita. Can and USB-the Serial Feature. Electronic Engineering. Sep 1997: 63-64
    [38] Tracht, Allen. Connecting with the New Universal Serial Bus in Instrumentation. Evaluation Engineering. Jul 1998: 12-14
    [39] John Hyde. USB Design Example: A Practice Guide to Building I/O Device. Intel Press. 2000. 19-23
    [40] 武安河等. Windows 2000/XP WDM 设备驱动程序开发. 北京:电子工业出版社. 2003
    [41] Microsoft Inc. WDM USB Driver Interface. http://www. microsoft. com/whdc/archive/wdmusb. mspx. Dec 04, 2001:1
    [42] 胡伟, 季晓衡. 单片机 C 程序设计及应用实例. 北京:人民邮电出版社. 2003
    [43] 何立民. MCS-51系列单片机应用程序设计系统配置与接口技术. 北京:北京航空航天大学出版社. 1995
    [44] 潘新民, 王燕芳. 单片微型计算机实用系统设计. 北京:人民邮电出版社. 1993
    [45] 李华. MCS-51 系列单片机实用接口技术. 北京:北京航空航天大学出版社. 1993
    [46] 荣蓉, 吕强中. 如何仿真单片机的外围设备. 单片机与嵌入式系统应用. 2003

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

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

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