Movatterモバイル変換


[0]ホーム

URL:


CN103294509A - Multi-serial equipment driving process for VxWorks operating system - Google Patents

Multi-serial equipment driving process for VxWorks operating system
Download PDF

Info

Publication number
CN103294509A
CN103294509ACN2013101832621ACN201310183262ACN103294509ACN 103294509 ACN103294509 ACN 103294509ACN 2013101832621 ACN2013101832621 ACN 2013101832621ACN 201310183262 ACN201310183262 ACN 201310183262ACN 103294509 ACN103294509 ACN 103294509A
Authority
CN
China
Prior art keywords
serial ports
serial
equipments
function
operating system
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN2013101832621A
Other languages
Chinese (zh)
Inventor
张小林
原亮亮
孙大勇
杨蕾
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
EWARE INFORMATION TECHNOLOGY Co Ltd
Original Assignee
EWARE INFORMATION TECHNOLOGY Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by EWARE INFORMATION TECHNOLOGY Co LtdfiledCriticalEWARE INFORMATION TECHNOLOGY Co Ltd
Priority to CN2013101832621ApriorityCriticalpatent/CN103294509A/en
Publication of CN103294509ApublicationCriticalpatent/CN103294509A/en
Pendinglegal-statusCriticalCurrent

Links

Images

Landscapes

Abstract

The invention discloses a multi-serial equipment driving process for a VxWorks operating system. The multi-serial equipment driving process mainly includes acquiring MEM space address of PCI/PCIE multi-serial equipment, initializing the multi-serial equipment, programming a drive service program, registering and installing an interrupt service program, creating serial channel files and the like. By the multi-serial equipment driving process, the multi-serial equipment can be driven in the VxWorks operating system, and real-time communications of the multi-serial equipment are realized.

Description

The method that is used for the many serial equipments of driving of vxworks operating system
Technical field
The present invention relates to the computing machine communication field, relate in particular to a kind of method of the many serial equipments of driving for vxworks operating system.
Background technology
Serial ports is the agreement of a kind of very general devices communicating on the computing machine, and most computers comprises two based on the serial ports of RS232; The compatible equipment of a lot of general purpose interface bus (GPIB) also has the serial ports of RS-232; Simultaneously, serial communication protocol also can be used for obtaining the data of remote collection equipment.
Vxworks operating system is that (Real-Time Operating System RTOS), is the key components of embedded-development environment to a kind of embedded real-time operating system of designing and developing in nineteen eighty-three of U.S. WindRiver company.On linux or windows platform, chip producer generally all can provide corresponding driver, but in the VxWorks system, producer does not provide corresponding driver, makes Vxworks operating system not provide effective driving support to the many serial equipments based on other buses (PCI, PCIE) expansion.And adopt many serial ports platform of real-time system that Communications service can better be provided, realize in vxworks operating system that therefore the driving of many serial equipments is necessary.
Summary of the invention
The present invention is in order to address the above problem, and proposes a kind of method of the many serial equipments of driving for vxworks operating system.
The method of a kind of many serial equipments of driving for vxworks operating system proposed by the invention comprises the steps:
Obtain the location, PCI/PCIE MEM space base of many serial equipments;
Many serial equipments of initialization serial ports passage;
Programme and register the installation interrupt service routine driving service routine;
Create serial ports passage character device.
In the present embodiment, get access to the quantity of serial ports passage by the related register information of many serial equipments, perhaps according to circuit design, the actual serial ports passage number that uses arranges.Initialization serial ports channel unit description scheme body array comprises register plot, baud rate, clock frequency, interrupt mode.When interrupt request takes place, according to the processing that interrupt type carries out, comprise receiving data, transmission data, removing mistake etc.The data member of the program structure body of assignment comprises: equipment control function, device start transmission data function, call back function are installed function, device polling detects and receives data function, device polling detection transmission data.
The present invention realizes the driving of many serial equipments in vxworks operating system, with the real-time communication (employing interrupt mode) that realizes many serial equipments.The present invention is according to the characteristics of Vxworks Embedded Real-Time platform, according to different chip custom driver, simplify volume by the customization to driver, not only the software volume is less, reduced the spending of system resource, and the expansion by chip functions can realize multiple serial communication technology flexibly, and for example 9bit communication mode, higher-level flow pattern etc. make the vxworks operating system system that better Communications service is provided.
Description of drawings
Fig. 1 is process flow diagram of the present invention;
Fig. 2 is the hardware configuration synoptic diagram that drives many serial equipments;
Fig. 3 obtains process flow diagram for location, serial equipment PCI/PCIE of the present invention MEM space base;
Fig. 4 is serial equipment serial ports passage initialization procedure process flow diagram;
Fig. 5 is the interrupt service routine process flowchart;
Fig. 6 is the OxPcie958SioDevInit call graph;
Fig. 7 is driver function subfunction OxPcie958SioIoctl call graph.
Embodiment
Fig. 1 is the method synoptic diagram of the many serial equipments of driving that are used for vxworks operating system that propose of the present invention.Present embodiment is the driving that realizes many serial equipments in VxWorks 5.5 operating systems, the platform that adopts is RMI MIPS framework embedded platform, by the PCIE x1 bus expansion chip of serial port chip OXPCIe958 more than two (master slave mode), with reference to figure 2, wherein main OXPCIe958 chip is connected with processor by the PCIe port, be connected with main OXPCIe958 chip from the OXPCIe958 chip, because the OXPCIe958 chip has 8 serial ports passages, so the principal and subordinate OXPCIe958 chip of this embodiment can be realized maximum 16 serial ports passages.
Among this embodiment, the method that the present invention proposes mainly comprises four steps:
Steps A. the OXPCIe958 chip that adopts because of the present invention adopts PCIE interface, the location, PCIE MEM space base that need obtain principal and subordinate OXPCIe958 chip earlier;
The serial ports passage of step B. initialization principal and subordinate OXPCIe958 chip, the serial ports passage initialization function of OXPCIe958 chip is called in configuration driver data structure and initialization;
Step C: programme and register the installation interrupt service routine driving service routine;
Step D: creating serial ports passage character device, because the serial ports passage is an equipment, therefore also is the character device of creating the respective channel number.
Fig. 3 is the concrete steps that steps A is obtained location, PCIE MEM space base:
Steps A 1. is according to many serial equipments of use chip, it is the OXPCIe958 chip, define two grand PCI_VENDOR_ID_OXPCIE958 0x1415 and PCI_DEVICE_ID_OXPCIE958 0xc308, and use these two macro definitions to come producer sign (Vendor ID) and the device identification (Device ID) of initialization apparatus;
Steps A 2. is called the device identification that the pciFindDevice function is sought main OXPCIe958 chip, if do not find then ending step A, if found the device identification of main OXPCIe958 chip, then continues steps A 3;
Steps A 3. gets access to OXPCIe958 device bus number, device number and function number by the pciFindDevice function;
In the present embodiment, the Bus number that obtains is 0, and device number is 0, and function number is 0.This device number is different with device identification, and device identification Device ID is that the equipment that manufacturer arranges when hardware dispatches from the factory indicates, and device number then is the device number of the OXPCIe958 equipment of carry on bus, i.e. which equipment under bus.
Steps A 4. is returned the PCIE device type of OXPCIe958 equipment by the pciConfigInByte function;
Steps A 5. use PciConfigInLong obtain the equipment base address PCI_CFG_BASE_ADDRESS data in the OXPCIe958 equipment PCIE configuration space, it is location, PCIE MEM space base, thereby the register base address that obtains equipment of serial passage 0 is 0xc0001000h, then ending step A.
Fig. 4 is the concrete steps of step B initialization principal and subordinate OXPCIe958 chip:
Step B1. creates the serial ports passage description scheme body OXPCIE958SIO_CHAN of OXPCIe958 equipment;
Step B2. arranges the quantity of serial ports passage, and the value that the serial ports number of channels is set in the present embodiment is 16.Can adopt dual mode can get access to the quantity of serial ports passage, the firstth, the related register 0xc0000004h bit[4:0 in the MEM space by OXPCIe958 equipment] information gets access to the quantity of serial ports passage, the secondth, according to circuit design, the actual serial ports number of channels that uses arranges, the quantity that actual usage quantity may indicate less than the register read value;
It is the OXPCIE958SIO_CHAN array that step B3. creates type according to the quantity of serial ports passage, and the array number of members is corresponding with the serial ports number of channels.In the present embodiment, create the pChan_obj[16 of OXPCIE958SIO_CHAN type] array, and to each parameter initialize, wherein parameter comprises register plot, baud rate, clock frequency, passage mode of operation (interrupting or poll);
Step B4. creates the variable OxPcie958SioDrvFuncs of driver data structure body SIO_DRV_FUNCS type, and its structure member carried out initialization, its structure member comprise facility control program, device start send data, call back function installation procedure, device polling detect receive data program, device polling detects and sends data program.Write corresponding function subfunction at last, comprise that function subfunction OxPcie958SioIoctl is used for the control of serial ports passage; Function subfunction function OxPcie958SioTxStartup is used for enabling to send interrupting, thereby log-on data sends; Function subfunction OxPcie958SioCallbackInstall is used for will receiving, sending character function and is associated with a virtual driving layer call back function, in order to can call to take away the data in the hardware reception formation or data are sent to the hardware transmit queue.Function subfunction OxPcie958SioPollInput, OxPcie958SioPollOutput receives and sends the function that will call for using polling mode to carry out data;
With reference to figure 7, wherein the effect of function subfunction OxPcie958SioIoctl is control serial ports passage, this function call OxPcie958SioBaudSet arranges the baud rate of serial ports passage, call OxPcie958SioModeSet and carry out the setting (comprise and interrupting and poll) of serial ports passage mode of operation, call OxPcie958SioOptsSet and carry out data bit, position of rest, the setting of parity check bit and Flow Control, call OxPcie958SioHup and realize closing the serial ports passage, call OxPcie958SioOpen and realize unlatching to the serial ports passage, call the setting that OxPcie958Sio9BitModeSet realizes special 9bit pattern.All functions all are to realize by serial ports channel hardware register being configured operation.The relevant setting of different hardware is closely not identical.Specifically can provide the programming handbook to write with reference to producer.
Step B5. calls serial ports passage initialization function OxPcie958DevInit (), further improve device description structure member is carried out assignment, comprise the data bit that acquiescence is set, position of rest, parity checking, and the OxPcie958SioDrvFuncs driver structure of finishing among the B4 etc., then that partial sum register is relevant value is written in the hardware register, with reference to figure 6, the device initialize function call two functions help initialization, one is that the OxPcie958SioBaudSet function arranges serial ports passage default baud rate, another is by the OxPcie958SioOptSet function serial ports passage mode of operation to be set, comprise data bit, position of rest, parity check bit and Flow Control arrange etc.Last ending step B.
Fig. 5 is the realization flow figure of step C1 interrupt service routine, and interrupt service routine OxPcie958SioInt is the interrupt bit of each serial ports passage in the poll register successively.
Step C11. reads the interrupt bit of all serial ports passages, and for reading the value of Globe UART IRQ Status register, register address is 0xc0000008h bit[16:0 in OXPCIE958 equipment MEM space].Be saved in then among the temporary variable temp;
Step C12. adopt step-by-step and mode judge whether current serial ports passage interrupts, if interrupt request does not take place, then jump to step C14, if interrupt request takes place, then enter next step;
Step C13. judges this interrupt type, terminal server is made corresponding processing, these are handled all is to the operation of hardware register and call the virtual call back function that drives layer and realize according to the programming handbook of OXPCIE958 chip, comprise the interruption of accepting data, transmission data, handling wrong generation, remove interruption etc.;
Step C14. judges whether that the serial ports passage needs to detect in addition, and namely whether Temp is more than or equal to 1, if then representative also has the serial ports passage to need detection, then repeating step C12 to C14; Then handle the interruption of all serial ports passages if not, then continued next step;
Step C15. notice CPU also withdraws from interrupt service routine.
Step C2 registers interrupt service routine, and the registration interrupt service routine can carry out related with interrupt service routine the unusual entry address of interrupt vector.CPU jumped to unusual entry address according to interrupt vector after central broken hair was given birth to, and interrupted accordingly handling according to the interrupt service routine of registering in the entry address.
At last, step D, the user is convenient to conduct interviews and operates the serial ports passage in order to make, and the serial ports passage is created as corresponding serial ports passage name (also being the character device name), on the upper strata serial ports passage is operated exactly character device is operated.The method for packing of character device is at first setting up the character device name successively according to serial ports port number, serial ports channel number, call the sysSerialChanGet function according to the serial ports channel number and obtain this serial ports channel unit description scheme body, use ttyDevCreate to carry out related with relevant device description scheme body serial ports passage name then, and create virtual driving layer buffer circle, finish the establishment of character device.
IO system and multi-serial-port card driver method of calling are: when sending data, system uses Write () function to send to the output buffer circle, the virtual driving layer ttyDrv/tylib that the meeting calling system provides in this process down sends, and finally calls the transmission of bottom layer driving power function log-on data.When hardware queue is sent completely, can produce the interrupt call interrupt service routine and handle, if the buffer data sky, then close to send and interrupt, and finish to send, if buffer data exists, then call call back function and send a given data and send to the hardware transmit queue.When data receive, system produces interrupts, received data by which passage of interrupt service routine poll, and by call back function hardware received queuing data and be pushed to the ttyDrv/tyLib layer and put into buffer circle, the user finally by read () function with data read.
The present invention is simple and easy to realize for the driving that realizes many serial ports in the Vxworks system provides a kind of method, and can make the driver can flexible customization.
Only in order to illustrate structure of the present invention, those of ordinary skill in the art can make various deformation and variation to above specific embodiment under design of the present invention, and these distortion and variation include within protection scope of the present invention.

Claims (10)

CN2013101832621A2013-05-172013-05-17Multi-serial equipment driving process for VxWorks operating systemPendingCN103294509A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN2013101832621ACN103294509A (en)2013-05-172013-05-17Multi-serial equipment driving process for VxWorks operating system

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN2013101832621ACN103294509A (en)2013-05-172013-05-17Multi-serial equipment driving process for VxWorks operating system

Publications (1)

Publication NumberPublication Date
CN103294509Atrue CN103294509A (en)2013-09-11

Family

ID=49095446

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN2013101832621APendingCN103294509A (en)2013-05-172013-05-17Multi-serial equipment driving process for VxWorks operating system

Country Status (1)

CountryLink
CN (1)CN103294509A (en)

Cited By (16)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN103853683A (en)*2014-03-072014-06-11山东超越数控电子有限公司Method for realizing multi-serial-port data communication
CN104539499A (en)*2014-12-222015-04-22江苏大学Intelligent multi-protocol communication management machine based on ARM
CN104539699A (en)*2014-12-262015-04-22山东中创软件商用中间件股份有限公司Adapter assembly
CN104536934A (en)*2014-12-242015-04-22深圳市航盛电子股份有限公司Serial port communication method and system
CN104965700A (en)*2015-06-092015-10-07航天科工深圳(集团)有限公司Method and system for implementing driving on SPI equipment under VxWorks operating system
CN106776382A (en)*2016-12-022017-05-31北京东土军悦科技有限公司The collocation method and device of a kind of PCIE device
CN107346296A (en)*2016-05-052017-11-14研祥智能科技股份有限公司A kind of driving method and device
CN107451076A (en)*2016-05-302017-12-08龙芯中科技术有限公司Serial ports interruption processing method and device based on VxWorks system
CN107918375A (en)*2017-12-152018-04-17航天晨光股份有限公司A kind of equipment high in the clouds monitoring management system
CN108009103A (en)*2017-11-282018-05-08中国船舶重工集团公司第七六研究所A kind of device PCI sort method of VxWorks system
CN108037931A (en)*2017-12-062018-05-15广州路派电子科技有限公司A kind of method that file programming is carried out to microprocessor storage unit
CN110109849A (en)*2019-04-302019-08-09湖北三江航天万峰科技发展有限公司A kind of CAN device driving device and method based on pci bus
CN111737180A (en)*2020-06-082020-10-02湖北三江航天万峰科技发展有限公司Serial port driving system based on PCI bus
CN111870939A (en)*2020-07-092020-11-03天津津航计算技术研究所Semaphore event-based joystick serial port drive design method under vxworks system
CN112231265A (en)*2020-10-142021-01-15天津津航计算技术研究所High-speed data transmission method for serial device under embedded operating system
CN112416521A (en)*2020-11-242021-02-26超越科技股份有限公司Serial port virtualization implementation method based on linux tty subsystem

Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20050180337A1 (en)*2004-01-202005-08-18Roemerman Steven D.Monitoring and reporting system and method of operating the same
CN102347899A (en)*2011-07-282012-02-08中国船舶重工集团公司第七一六研究所Intelligent dual-redundant gigabit Ethernet processing board

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20050180337A1 (en)*2004-01-202005-08-18Roemerman Steven D.Monitoring and reporting system and method of operating the same
CN102347899A (en)*2011-07-282012-02-08中国船舶重工集团公司第七一六研究所Intelligent dual-redundant gigabit Ethernet processing board

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
刘薇等: "嵌入式VxWorks的多串口共享中断的驱动程序设计", 《电脑知识与技术》*
官琴等,: "基于VxWorks嵌入式系统的多串口驱动程序开发", 《兵工自动化》*
官琴等,: "基于VxWorks嵌入式系统的多串口驱动程序开发", 《兵工自动化》, vol. 30, no. 6, 30 June 2011 (2011-06-30)*
欧峰等,: "基于PCI总线的多串口卡驱动程序设计", 《工业控制计算机》*
欧峰等,: "基于PCI总线的多串口卡驱动程序设计", 《工业控制计算机》, vol. 21, no. 9, 31 December 2008 (2008-12-31)*

Cited By (22)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN103853683B (en)*2014-03-072017-09-15山东超越数控电子有限公司A kind of Multi-serial port data communication implementation method
CN103853683A (en)*2014-03-072014-06-11山东超越数控电子有限公司Method for realizing multi-serial-port data communication
CN104539499A (en)*2014-12-222015-04-22江苏大学Intelligent multi-protocol communication management machine based on ARM
CN104536934A (en)*2014-12-242015-04-22深圳市航盛电子股份有限公司Serial port communication method and system
CN104539699A (en)*2014-12-262015-04-22山东中创软件商用中间件股份有限公司Adapter assembly
CN104965700B (en)*2015-06-092018-07-03航天科工深圳(集团)有限公司The method and system of driving SPI equipment is realized under vxworks operating system
CN104965700A (en)*2015-06-092015-10-07航天科工深圳(集团)有限公司Method and system for implementing driving on SPI equipment under VxWorks operating system
CN107346296A (en)*2016-05-052017-11-14研祥智能科技股份有限公司A kind of driving method and device
CN107346296B (en)*2016-05-052022-01-18研祥智能科技股份有限公司Driving method and device
CN107451076A (en)*2016-05-302017-12-08龙芯中科技术有限公司Serial ports interruption processing method and device based on VxWorks system
CN106776382A (en)*2016-12-022017-05-31北京东土军悦科技有限公司The collocation method and device of a kind of PCIE device
CN106776382B (en)*2016-12-022020-03-17北京东土军悦科技有限公司PCIE equipment configuration method and device
CN108009103A (en)*2017-11-282018-05-08中国船舶重工集团公司第七六研究所A kind of device PCI sort method of VxWorks system
CN108037931A (en)*2017-12-062018-05-15广州路派电子科技有限公司A kind of method that file programming is carried out to microprocessor storage unit
CN108037931B (en)*2017-12-062021-02-02广州路派电子科技有限公司Method for writing file in storage unit of microprocessor
CN107918375A (en)*2017-12-152018-04-17航天晨光股份有限公司A kind of equipment high in the clouds monitoring management system
CN110109849A (en)*2019-04-302019-08-09湖北三江航天万峰科技发展有限公司A kind of CAN device driving device and method based on pci bus
CN111737180A (en)*2020-06-082020-10-02湖北三江航天万峰科技发展有限公司Serial port driving system based on PCI bus
CN111870939A (en)*2020-07-092020-11-03天津津航计算技术研究所Semaphore event-based joystick serial port drive design method under vxworks system
CN112231265A (en)*2020-10-142021-01-15天津津航计算技术研究所High-speed data transmission method for serial device under embedded operating system
CN112231265B (en)*2020-10-142022-09-13天津津航计算技术研究所High-speed data transmission method for serial device under embedded operating system
CN112416521A (en)*2020-11-242021-02-26超越科技股份有限公司Serial port virtualization implementation method based on linux tty subsystem

Similar Documents

PublicationPublication DateTitle
CN103294509A (en)Multi-serial equipment driving process for VxWorks operating system
CN107003955B (en)Method, apparatus and system for integrating devices in a root complex
CN102281254B (en) Server serial port design system and method
US9223559B2 (en)Information processing apparatus, electronic control unit, information processing method, and program
CN104471537B (en)Intermediary's virtual machine task management
WO2011116556A1 (en)Wireless communication terminal in machine to machine network and its application method
EP4060588A1 (en)Virtual electronic card management method and system, security chip, terminal, and storage medium
CN107181634A (en)A kind of server Explore of Unified Management Ideas and system
CN100530152C (en)Method and device for starting i/o adapter of data processing system
CN105515811A (en)USB wireless network card configuration method, host, USB wireless network card and communication system
CN113657069A (en) System-on-chip SOC simulation verification method, device, verification server and storage medium
CN102253845B (en)Server system
CN103514074A (en)MVB network card development method and platform
WO2015131553A1 (en)Data transmission method and system
CN104932820B (en)Touch screen application method and system based on USB mapping
CN105242938B (en)automatic program downloading system and method
CN103077078A (en)Method for defining state transition in software and application control management object
CN110413285A (en)Method for deploying cloud service and method for developing cloud service
US7185119B2 (en)Method and apparatus for checking and analyzing the state of peripherals wherein state information is converted into a pattern of identification information
CN101917780B (en)Function implementation method and device of wireless communication terminal network equipment
JP6029501B2 (en) Software defined radio
CN109962788A (en)Multi-controller dispatching method, device and system and computer readable storage medium
CN111708568B (en)Modularized development decoupling method and terminal
CN108196866B (en)Firmware updating method and device
US9178882B1 (en)Concurrent, diverse party multi-processor wireless quality metric collection circuits and method of operation

Legal Events

DateCodeTitleDescription
C06Publication
PB01Publication
C10Entry into substantive examination
SE01Entry into force of request for substantive examination
C12Rejection of a patent application after its publication
RJ01Rejection of invention patent application after publication

Application publication date:20130911


[8]ページ先頭

©2009-2025 Movatter.jp