CN103514122B - USB equipment identification enhancing method in VxWorks operation system - Google Patents

USB equipment identification enhancing method in VxWorks operation system Download PDF

Info

Publication number
CN103514122B
CN103514122B CN201210221105.0A CN201210221105A CN103514122B CN 103514122 B CN103514122 B CN 103514122B CN 201210221105 A CN201210221105 A CN 201210221105A CN 103514122 B CN103514122 B CN 103514122B
Authority
CN
China
Prior art keywords
usb
information
usb device
hub
port
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.)
Expired - Fee Related
Application number
CN201210221105.0A
Other languages
Chinese (zh)
Other versions
CN103514122A (en
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.)
709th Research Institute of CSIC
Original Assignee
709th Research Institute of CSIC
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 709th Research Institute of CSIC filed Critical 709th Research Institute of CSIC
Priority to CN201210221105.0A priority Critical patent/CN103514122B/en
Publication of CN103514122A publication Critical patent/CN103514122A/en
Application granted granted Critical
Publication of CN103514122B publication Critical patent/CN103514122B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Transfer Systems (AREA)
  • Computer And Data Communications (AREA)

Abstract

An embodiment of the invention provides a method for enhancing the identification rate of USB equipment at the later state when initial enumeration of the equipment is not successful in a VxWorks operation system. The method comprises the steps that when a protocol stack of a USB mainframe is initialized, after downlink ports of all USB concentrators are scanned, information of the downlink ports of all the USB concentrators is obtained; when all the USB equipment is initialized, enumeration information of all the equipment is obtained; the downlink ports of the USB equipment on the USB concentrators are compared with the enumeration information of the equipment, if the equipment connected with the downlink ports of the USB concentrators is not enumerated successfully, reset operation is conducted on the ports, and therefore the protocol stack of the USB mainframe conducts enumeration operation on the equipment. According to the technical scheme, the identification rate of the USB equipment in the VxWorks operation system can be improved.

Description

USB device strengthens recognition methodss under a kind of vxworks operating system
Technical field
The present invention relates to USB device strengthens knowledge under usb communication technical field, more particularly to a kind of vxworks operating system Other method.
Background technology
USB interface has interface unification, plug and play, supports the characteristic such as hot-swappable due to it, and support low speed, full speed, The different transmission rates such as high speed, disclosure satisfy that the product requirement of different pieces of information transmission performance, and it is obtained in real-time embedded field Use in a large number.
In vxworks operating system, the initialization of usb host protocol stack, including:1)Usb host controller it is initial Change, directly control usb host controller hardware, including console controller and hub;2)The initialization of USB device driver, place Data transfer between reason client software and USB device, realizes the behaviour such as usb bus are enumerated, bus bandwidth distributes, transmission control Make.The initialization of USB device, including registration device drives, cooperation completes device bus and enumerates, adds in global list of devices The device name.
When USB device is linked into certain downlink port of hub, the hub can be anti-port status change information Feed main frame, main frame receives after information, starts to enumerate USB device.If enumerating unsuccessful, main frame can be put and enumerate not Success Flag, enumerates USB device again.In order to ensure the real-time of system, and the knowledge for not affecting other USB devices Not, this process for retrying has number of times to limit, generally 3 times.If retrying 3 times, main frame enumerating still not to equipment Success, system thinks that the equipment is a faulty equipment, can carry out the process of sweep equipment.
The applied environment of embedded system is typically complex, and USB device is usually easily vibrated, either internally or externally Electromagnetic interference etc. affect.If in the enumeration stage of equipment, just there occurs that vibration or electromagnetic interference etc. affect, cause USB device is unable to the inquiry bag of normal response usb host, enumerates failure, and the equipment is just unavailable.
The content of the invention
It is an object of the invention to provide one kind is in vxworks operating system, and when equipment initial enumeration is unsuccessful, the later stage The method for increasing USB device discrimination.
A kind of method for increasing USB device discrimination in vxworks operating system of the present invention, methods described includes following Step:
(1) after the completion of the initialization of usb host protocol stack, the downlink port information of all usb hubs is obtained;
(2) after the completion of USB device initialization, all devices enumerations information is obtained;
(3) the downstream end message of unsuccessful USB device information all connection USB devices with usb hub will be enumerated Breath is compared, and obtains enumerating hub number and the port numbers that unsuccessful USB device is connected;
(4) downlink port to enumerating the hub that unsuccessful USB device is connected resets, so that usb host Protocol stack carries out enumeration operation to the equipment again.The discrimination of USB device in vxworks operating system can so be increased.
The system for increasing USB device discrimination in a kind of vxworks operating system of the present invention, the system includes:
Usb hub port information acquisition module, for when the initialization of usb host protocol stack, usb hub downlink port After the completion of scanning, the information of all usb hub downlink ports is obtained, and be sent to information comparison module;
USB device enumeration data obtaining module, for after the completion of USB device initialization, obtaining all USB device enumerations Information, and it is sent to information comparison module;
Information comparison module, reception usb hub port information acquisition module and USB device enumeration data obtaining module Information, the downlink port information of all connection USB devices is carried out with usb hub will to enumerate unsuccessful USB device information Compare, obtain enumerating hub number and the port numbers that unsuccessful USB device is connected, and be sent to usb hub port reset Module;
Usb hub port reset module, the information that receive information comparing module is sended over, by the finger of usb hub Fixed end mouth carries out reset operation.
The present invention proposes a kind of method and system for strengthening USB device discrimination under vxworks operating system.In behaviour In making system boot process, in the event of electromagnetic interference, or because the reason such as vibration causes USB information transmission fault, can lead Cause USB device identification error or None- identified.The method of the invention can effectively promote USB device in different degrees of electromagnetism Normal identification and work under interference or vibration condition, it is to avoid USB device recognizes the appearance of problem during system boot, USB device discrimination is improve, the environmental suitability of USB device is enhanced.
After the completion of booting operating system, if USB device is not identified, user typically can be by the plug equipment USB cable, so that system is enumerated the equipment again, the purpose that the equipment of reaching can be used.If a plug does not have Identification, user can also carry out multiple plug operation.Such plug operation can cause a certain degree of infringement to USB interface, most Cause interface unavailable eventually.The present invention by the method for software come to without be identified USB device initiate enumeration operation again, It is not required to manual intervention;While USB device discrimination is improved, there is no any infringement to hardware, it is ensured that USB interface and equipment Stability and dependability.
, just for the reset operation that the equipment uplink port is carried out without identified equipment, the operation is at one for the present invention Carry out in independent task, do not interfere with the communication of other USB devices and main frame, it is ensured that the real-time of system.
The features such as USB device has life cycle length, device category is more, this is also caused under vxworks operating system, such as What lifts USB device discrimination and related fault-toleranr technique becomes one of bottleneck for improving in the equipment availability research process.This Invention can efficiently solve the problem.
By binding with VxWorks usb protocol stack, can provide enhancement mode usb protocol stack software based on the present invention and produce Product, or for client provide under vxworks operating system improve USB device discrimination total solution, help user and When efficiently solve USB device produced problem under relevant environment, save user in manpower, material resources, the related throwing in financial resources Enter, this is also the embodiment of achievement of the present invention economic worth in application process, while it is special as civilian invention to enhance the achievement The feasibility and necessity of profit.
Description of the drawings
Fig. 1 is the flowchart of increase USB device discrimination method provided in an embodiment of the present invention;
Fig. 2 is the structured flowchart of increase USB device discrimination system provided in an embodiment of the present invention.
Specific embodiment
To make purpose, technical scheme and the advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention In accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described.Based on the embodiment in the present invention, Only to explain the present invention, it is not intended to limit the present invention.
In the present embodiment, after the completion of the initialization of usb host protocol stack, all usb hub downlink port scannings, obtain The downlink port information of all usb hubs;After the completion of the initialization of all USB devices, each device enumeration information is obtained;General piece The downlink port information of all connection USB devices is compared with usb hub to lift unsuccessful USB device information, is obtained Enumerate hub number and port numbers that unsuccessful USB device is connected;To enumerating the line concentration that unsuccessful USB device is connected The downlink port of device is resetted, so that usb host protocol stack carries out enumeration operation to the equipment again.So can increase The discrimination of the USB device in vxworks operating system.
Fig. 1 shows the increase USB device discrimination method in vxworks operating system provided in an embodiment of the present invention Flow process is realized, it comprises the following steps that described:
In step sl, the initialization of usb host protocol stack, the scanning of hub downlink port is waited to complete.
In embodiments of the present invention, after the initialization of usb host protocol stack, need the regular hour to scan all USB sets The downlink port information of line device.In order to get the correct information of all usb hub downlink ports, it is necessary to wait USB set line The scanning of device downlink port is completed.
In step s 2, all usb hub downlink port information are obtained.
In embodiments of the present invention, usb hub downlink port information has following content:1)Connectionless equipment;2)Cascade HUB;3)Connection equipment, obtains instrument factory trading company, production number and released version number.Structure is as follows:
{ USBD_NODE_ID hubId;/ * usb hub */
USBD_NODE_ID devId;/ * USB devices number(0:Without equipment;1:Usb hub;Other:Connection equipment Number) */
UINT16 portIndex;/ * hub side slogans, from 0 start counting up */
} USB_HUB_DEV_INFO, *pUSB_HUB_DEV_INFO;
In step s3, all USB devices are initialized.
The USB device of usb hub in all connections is initialized, so that main frame is enumerated USB device.
In step s 4, all USB device enumeration information are obtained.
Main frame is obtained to information during all USB device enumerations, there is following content:USB device number and USB device enumeration into Work(mark.Structure is as follows:
typedef struct usb_dev_info
{ USBD_NODE_ID devId;/ * USB device */
UINT16 attachFlag;/ * enumerates Success Flag(1:Success;0:It is unsuccessful)*/
} USB_DEV_INFO, *pUSB_DEV_INFO;
In step s 5, judge whether all USB devices are all enumerated successfully, be to terminate, otherwise perform S6.
In step s 6, USB device enumeration information is compared with usb hub downlink port information, and acquisition is enumerated not Usb hub number and the port numbers of place usb hub that successfully USB device is connected.
In the step s 7, reset and enumerate the port that unsuccessful USB device connects usb hub.
In embodiments of the present invention, the port that usb hub is connected to enumerating unsuccessful USB device resets, Usb host can be caused to carry out an enumeration operation to the USB device again.
In step s 8, time delay is for a period of time.
In embodiments of the present invention, usb host carries out enumeration operation to the USB device after hub port reset, needs A period of time just can complete.Therefore after the time delay for a period of time of this step, it is again introduced into step S4.
In the present embodiment, as long as there is USB device not enumerate successfully, this five steps of S4 to S8 will be repeated, until All USB devices are all enumerated successfully.So the mistake that USB device can not be recognized caused by the reasons such as electromagnetic interference is arranged as far as possible Remove, increased the discrimination of the USB device in vxworks operating system.
Fig. 2 shows the increase USB device discrimination system in vxworks operating system provided in an embodiment of the present invention Structured flowchart, for convenience of description, only gives the part related to the embodiment of the present invention in figure.
Usb hub port information acquisition module 11, for when the initialization of usb host protocol stack, usb hub downstream end After the completion of mouth scanning, the information of all usb hub downlink ports, including usb hub number, USB device number and line concentration are obtained Device port numbers.
USB device enumeration data obtaining module 12, for after the completion of USB device initialization, obtaining all USB devices piece Act information, including:USB device number and enumerate Success Flag.
Information comparison module 13, for unsuccessful USB device information will to be enumerated with all connection USB on usb hub The downlink port information of equipment is compared, and obtains enumerating hub number and the port numbers that unsuccessful USB device is connected;
Usb hub port reset module 14, for the usb hub that unsuccessful USB device is connected will to be enumerated Port carries out reset operation.
A system embodiment of the present invention is above are only, wherein, for example above-mentioned method of function of the modules of the system Described in embodiment, will not be described here, but not to limit the present invention.
In embodiments of the present invention, when usb host protocol stack is initialized, all usb hub downlink port scannings are completed Afterwards, the downlink port information of all usb hubs is obtained;After the completion of the initialization of all USB devices, each device enumeration letter is obtained Breath;Unsuccessful USB device information will be enumerated, and the downlink port information of all connection USB devices is compared with usb hub It is right, obtain enumerating hub number and the port numbers that unsuccessful USB device is connected;Connect to enumerating unsuccessful USB device The downlink port of the hub for connecing is resetted, so that usb host protocol stack carries out enumeration operation to the equipment again.The present invention Technical scheme can increase the discrimination of the USB device in vxworks operating system.
Presently preferred embodiments of the present invention is the foregoing is only, not to limit the present invention.All essences in the present invention Any modification, equivalent and improvement made within god and principle etc., should be included within the scope of the present invention.

Claims (2)

1. it is a kind of in vxworks operating system increase USB device discrimination method, it is characterised in that methods described includes Following step:
(1) after the completion of the initialization of usb host protocol stack, the downlink port information of all usb hubs is obtained;
(2) after the completion of USB device initialization, all devices enumerations information is obtained;
(3) the downlink port information of all connection USB devices is entered with usb hub will to enumerate unsuccessful USB device information Row is compared, and obtains enumerating hub number and the port numbers that unsuccessful USB device is connected;
(4) downlink port to enumerating the hub that unsuccessful USB device is connected resets, so that usb host agreement Stack carries out enumeration operation to the equipment again, can so increase the discrimination of USB device in vxworks operating system.
2. it is a kind of in vxworks operating system increase USB device discrimination system, it is characterised in that the system is also wrapped Include following modules:
Usb hub port information acquisition module, for when the initialization of usb host protocol stack, the scanning of usb hub downlink port After the completion of, the information of all usb hub downlink ports is obtained, and it is sent to information comparison module;
USB device enumeration data obtaining module, for after the completion of USB device initialization, obtaining all USB device enumeration letters Breath, and it is sent to information comparison module;
Information comparison module, receives the letter of usb hub port information acquisition module and USB device enumeration data obtaining module Breath, the downlink port information of all connection USB devices is compared with usb hub will to enumerate unsuccessful USB device information It is right, obtain enumerating hub number and the port numbers that unsuccessful USB device is connected, and it is sent to usb hub port reset mould Block;
Usb hub port reset module, the information that receive information comparing module is sended over, by the designated ends of usb hub Mouth carries out reset operation.
CN201210221105.0A 2012-06-29 2012-06-29 USB equipment identification enhancing method in VxWorks operation system Expired - Fee Related CN103514122B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210221105.0A CN103514122B (en) 2012-06-29 2012-06-29 USB equipment identification enhancing method in VxWorks operation system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210221105.0A CN103514122B (en) 2012-06-29 2012-06-29 USB equipment identification enhancing method in VxWorks operation system

Publications (2)

Publication Number Publication Date
CN103514122A CN103514122A (en) 2014-01-15
CN103514122B true CN103514122B (en) 2017-04-19

Family

ID=49896871

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210221105.0A Expired - Fee Related CN103514122B (en) 2012-06-29 2012-06-29 USB equipment identification enhancing method in VxWorks operation system

Country Status (1)

Country Link
CN (1) CN103514122B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105100006A (en) * 2014-05-07 2015-11-25 杭州迪普科技有限公司 Proxy service device and remote control device and method
CN112437335B (en) * 2020-11-11 2023-01-24 海信视像科技股份有限公司 Display device and external device connection processing method thereof
CN114372017B (en) * 2022-01-04 2023-12-12 中国大恒(集团)有限公司北京图像视觉技术分公司 Enumeration method without affecting normal operation of CXP equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101609408A (en) * 2009-06-19 2009-12-23 中兴通讯股份有限公司 A kind of method and system that realize self-start of terminal equipment
CN102103528A (en) * 2009-12-22 2011-06-22 杭州华三通信技术有限公司 Device and method for carrying out recovery control on exceptions of USB (universal serial bus) device identification and USB host
CN102339259A (en) * 2010-07-27 2012-02-01 董建飞 Device and method for operating USB (universal serial bus) interface equipment

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100368179B1 (en) * 2000-11-13 2003-01-24 이호준 Screen/ IP phone for information system using local area network
CN100371847C (en) * 2005-09-22 2008-02-27 深圳市江波龙电子有限公司 Method for ciphering and diciphering of file, safety managing storage apparatus and system method thereof
CN100493100C (en) * 2006-06-15 2009-05-27 北京中星微电子有限公司 USB time sequence adaptive device, interface and its communication method
CN101567052B (en) * 2008-04-21 2011-04-06 北京同方微电子有限公司 System and method for issuing intelligent card with USB interface

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101609408A (en) * 2009-06-19 2009-12-23 中兴通讯股份有限公司 A kind of method and system that realize self-start of terminal equipment
CN102103528A (en) * 2009-12-22 2011-06-22 杭州华三通信技术有限公司 Device and method for carrying out recovery control on exceptions of USB (universal serial bus) device identification and USB host
CN102339259A (en) * 2010-07-27 2012-02-01 董建飞 Device and method for operating USB (universal serial bus) interface equipment

Also Published As

Publication number Publication date
CN103514122A (en) 2014-01-15

Similar Documents

Publication Publication Date Title
US9032105B2 (en) Scalable method and apparatus to configure a link
EP3276481B1 (en) Nvme networked storage implementation method, terminal, server, and system
EP1031930A2 (en) Universal serial bus test system
CN100407180C (en) Device and method for making HID apparatus provide smart card interface
CN103514122B (en) USB equipment identification enhancing method in VxWorks operation system
CN103164244A (en) Firmware system remote updating method based on universal extensible firmware interface
CN110048875B (en) Method and equipment for upgrading drive
WO2022041720A1 (en) Uds-based communication method, ecu and upper computer
CN103780674B (en) A kind of virtual machine communication method and device based on hardware simulation
CN105094877A (en) Method for firmware upgrading, and host side device and system
CN101706861B (en) Method and device for realizing adaptation of communication protocol of intelligent card
CN104102490B (en) Method for realizing CEN/XFS SP on basis of Windows service
CN112689083A (en) Vehicle-mounted camera configuration method and device, electronic equipment and storage medium
CN108920193A (en) SDIO communication interface realization method and device between FPGA and CPU
CN111198698B (en) EtherCAT-based multi-device firmware program parallel downloading method and system
CN106575278A (en) Universal serial bus emulation layer
CN107168725A (en) A kind of method for upgrading software of controller, apparatus and system
WO2015176366A1 (en) Universal serial bus drive method, computer and composite device
CN117950732A (en) Server starting method and server
WO2014000299A1 (en) Serial port redirection processing method, device, and system
WO2011076064A1 (en) Data card upgrading method and device
US20110145642A1 (en) Method and system for testing an application
CN114567445B (en) Method, device, equipment and medium for transmitting signature verification data
CN108055186A (en) A kind of principal and subordinate processor communication means and device
CN109725621A (en) A kind of secondary bus program based on 1553B bus and CAN bus is in line writing method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20170419