CN109254937B - USB hub, USB device enumeration exception detection method and computer storage medium - Google Patents

USB hub, USB device enumeration exception detection method and computer storage medium Download PDF

Info

Publication number
CN109254937B
CN109254937B CN201810796087.6A CN201810796087A CN109254937B CN 109254937 B CN109254937 B CN 109254937B CN 201810796087 A CN201810796087 A CN 201810796087A CN 109254937 B CN109254937 B CN 109254937B
Authority
CN
China
Prior art keywords
usb
tested
enumeration
equipment
hub
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.)
Active
Application number
CN201810796087.6A
Other languages
Chinese (zh)
Other versions
CN109254937A (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.)
Xinqiyuan Shanghai Semiconductor Technology Co ltd
Original Assignee
Xinqiyuan Shanghai Semiconductor 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 Xinqiyuan Shanghai Semiconductor Technology Co ltd filed Critical Xinqiyuan Shanghai Semiconductor Technology Co ltd
Priority to CN201810796087.6A priority Critical patent/CN109254937B/en
Publication of CN109254937A publication Critical patent/CN109254937A/en
Application granted granted Critical
Publication of CN109254937B publication Critical patent/CN109254937B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4063Device-to-bus coupling
    • G06F13/4068Electrical coupling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
    • G06F11/221Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested to test buses, lines or interfaces, e.g. stuck-at or open line faults
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0042Universal serial bus [USB]

Abstract

The invention provides a USB concentrator, a USB device enumeration abnormity detection method and a computer storage medium, wherein the invention is compatible with the function of a common concentrator and is additionally provided with an enumeration detection submodule, and can automatically execute enumeration detection and judge the result of the enumeration detection on the basis of not depending on an expensive USB protocol analyzer, thereby greatly reducing the labor cost brought by manual enumeration detection of engineers, improving the efficiency of the enumeration detection and avoiding errors or errors brought by human factors. In addition, the USB concentrator adopts a serial interface for output, so that large-scale test and problem recording are facilitated. Therefore, the invention effectively overcomes various defects in the prior art and has high industrial utilization value.

Description

USB hub, USB device enumeration exception detection method and computer storage medium
Technical Field
The present invention relates to the USB technology field, and in particular, to a USB hub, a USB device enumeration exception detection method, and a computer storage medium.
Background
USB is becoming increasingly popular as a universal bus. Nowadays, USB has been developed to USB version 3.2, and more USB devices with different functions are produced.
In the process of developing the USB device, the enumeration process of the USB device includes hot plug identification of the USB, unique address setting of the USB device, the USB host obtaining configuration information of the USB device through a USB request, the USB host configuring the USB device according to the obtained configuration information, and the USB device entering a configured state, at which time the USB device can be normally used. Therefore, one of the most important links in the development and testing of USB devices is the enumeration process of USB devices.
In the prior art, an engineer needs to use a protocol analyzer of the USB in the process of developing and locating an enumeration exception of a USB device, and the analysis process is as follows: one end of the USB protocol analyzer is connected with the USB equipment to be tested, and the other end of the USB protocol analyzer is connected with the USB host controller, namely the USB protocol analyzer is used as an intermediate device between the USB equipment to be tested and the USB host controller; the USB protocol analyzer captures all data packets (such as a protocol layer, a link layer and the like) on the USB device to be tested, outputs the data to the USB host controller, and analyzes the data packets by using matched analysis software so as to find out the reason of enumeration failure.
However, the prior art uses a USB protocol analyzer to capture the data packets on the USB bus and analyze the USB enumeration exception by manually comparing the USB detailed specifications provided by the USB official organization, and generally has the following disadvantages: 1) a protocol analyzer supporting the USB3.1 is expensive; 2) one protocol analyzer can only grab one USB device to be tested, and protocol grabbing of a plurality of USB devices to be tested is not supported; 3) a large number of data packet receiving and sending processes are required in the enumeration process, and manual analysis is required, so that huge repeated labor is generated; 4) the manual inspection can omit, and some hidden problems can not be found out, so that potential safety hazards are left.
Therefore, in the present day when USB devices are developed endlessly, how to save labor and analyze enumeration exception of USB devices automatically becomes a technical problem that practitioners in the art need to solve urgently.
Disclosure of Invention
In view of the above-mentioned drawbacks of the prior art, an object of the present invention is to provide a USB hub, a USB device enumeration exception detection method, and a computer storage medium, which are used to solve the technical problems of high cost and low efficiency of USB enumeration detection in the prior art.
To achieve the above and other related objects, the present invention provides a USB hub, wherein one end of the USB hub is connected to a USB host device and the other end is connected to one or more USB devices to be tested; the USB hub includes an enumeration detection submodule comprising: the screening backup module is used for intercepting data packets of a specific endpoint used for realizing enumeration operation in each data stream port of the USB concentrator, screening USB equipment to be tested corresponding to the specific endpoint of which the data packets are not intercepted within preset time, and backing up the data packets sent or received by the screened USB equipment to be tested; the analysis reporting module is used for receiving the notification from the screening backup module, analyzing the data packet backed up by the screening backup module and generating analysis result information of enumeration success or failure of the USB equipment to be tested; and the transceiving transmission module is used for receiving the analysis result information from the analysis reporting module and transmitting the analysis result information to the external display equipment.
In an embodiment of the present invention, the USB hub further includes a hub sub-module, which includes: the hub forwarding module is used for establishing communication connection between the USB host equipment and the USB equipment to be tested and processing bus exception; the hub control module is connected with a USB host controller of the USB host equipment so as to enable the USB host equipment to configure the USB hub; and the power supply module is electrically connected with the hub forwarding module and the hub control module to provide power supply.
In an embodiment of the present invention, the hub forwarding module includes a high-speed transceiver module and an ultra-high-speed transceiver module; the hub control module comprises a high-speed control module and an ultra-high-speed control module.
In an embodiment of the present invention, the analysis reporting module combs an enumeration process, and detects whether a request sent by the USB host device and a reply sent by the USB device to be tested are reasonable according to a USB protocol specification, so as to determine whether enumeration of the USB device to be tested is successful or failed.
In an embodiment of the present invention, the manner of detecting whether the request sent by the USB host device and the reply sent by the USB device to be tested are reasonable by the analysis reporting module includes any one of the following manners or a combination of a plurality of manners: mode 1) a request is sent by USB host equipment, and USB equipment to be tested responds; the analysis reporting module detects whether the content responded by the USB equipment to be tested meets the USB protocol specification; if the USB protocol specification is met, the USB equipment to be tested is enumerated successfully; if the USB protocol specification is not met, the enumeration of the USB equipment to be tested fails; mode 2) the USB device under test sends data to the USB host device; the analysis reporting module detects whether the content sent by the USB equipment to be tested meets the USB protocol standard; if the USB protocol specification is met, the USB equipment to be tested is enumerated successfully; if the USB protocol specification is not met, the enumeration of the USB equipment to be tested fails; mode 3) analyzes the whole enumeration process, detects whether the process has errors or hidden dangers, and accordingly judges whether the USB equipment to be tested is enumerated successfully.
In an embodiment of the present invention, the screening backup module intercepts a data packet of a specific endpoint for implementing enumeration operation in each data stream port, where the data stream port includes an upstream data stream port connected to the USB host device and a downstream data stream port connected to the USB device under test.
To achieve the above and other related objects, the present invention provides a method for detecting enumeration exception of a USB device, including: intercepting a data packet of a specific endpoint for realizing enumeration operation in each data stream port; screening USB equipment to be tested corresponding to a specific endpoint of which the data packet is not intercepted within a preset time; backing up the data packets sent or received by the screened USB equipment to be tested; analyzing the data packet backed up by the screening backup module and generating analysis result information of the enumeration success or failure of the USB equipment to be tested; and transmitting the analysis result information to an external display device.
In an embodiment of the present invention, the method includes: the method for analyzing the data packets backed up by the screening backup module comprises the following steps: and combing the enumeration process, detecting whether the request sent by the USB host equipment and the reply sent by the USB equipment to be tested are reasonable according to the USB protocol specification, and accordingly judging whether the enumeration of the USB equipment to be tested is successful or failed.
In an embodiment of the present invention, the manner of detecting whether the request sent by the USB host device and the reply sent by the USB device under test are reasonable includes any one of the following manners or a combination of a plurality of manners: mode 1) a request is sent by USB host equipment, and USB equipment to be tested responds; the analysis reporting module detects whether the content responded by the USB equipment to be tested meets the USB protocol specification; if the USB protocol specification is met, the USB equipment to be tested is enumerated successfully; if the USB protocol specification is not met, the enumeration of the USB equipment to be tested fails; mode 2) the USB device under test sends data to the USB host device; the analysis reporting module detects whether the content sent by the USB equipment to be tested meets the USB protocol standard; if the USB protocol specification is met, the USB equipment to be tested is enumerated successfully; if the USB protocol specification is not met, the enumeration of the USB equipment to be tested fails; mode 3) analyzes the whole enumeration process, detects whether the process has errors or hidden dangers, and accordingly judges whether the USB equipment to be tested is enumerated successfully.
To achieve the above and other related objects, the present invention provides a computer-readable storage medium having stored thereon a computer program, which, when executed by a processor, implements the USB device enumeration exception detection method.
As described above, the USB hub, the USB device enumeration exception detection method, and the computer storage medium according to the present invention have the following advantageous effects: the invention is compatible with the function of a common concentrator and is additionally provided with an enumeration detection submodule, and can automatically execute enumeration detection and judge the result of enumeration detection on the basis of not depending on an expensive USB protocol analyzer, thereby greatly reducing the labor cost brought by manual enumeration detection of engineers, improving the efficiency of enumeration detection and avoiding errors or errors brought by human factors. In addition, the USB concentrator adopts a serial interface for output, so that large-scale test and problem recording are facilitated. Therefore, the invention effectively overcomes various defects in the prior art and has high industrial utilization value.
Drawings
Fig. 1 is a schematic structural diagram of a USB hub according to an embodiment of the present invention.
Fig. 2 is a schematic structural diagram of a hub submodule according to an embodiment of the present invention.
Fig. 3 is a schematic structural diagram of a USB hub according to an embodiment of the present invention.
Fig. 4 is a schematic structural diagram of a USB hub according to an embodiment of the present invention.
Fig. 5 is a flowchart illustrating a method for detecting enumeration exception of a USB device according to an embodiment of the present invention.
Description of the element reference numerals
2 hub submodule
21 hub forwarding module
22 hub control module
23 Power supply module
3 USB concentrator
31 USB3.1 hub forwarding module
32 USB3.1 hub control module
33 USB2.0 hub forwarding module
34 USB2.0 hub control module
35 Vbus power supply logic control unit
36 upstream port
37 downstream port
401 USB3.1 hub forwarding module
402 USB3.1 hub control module
403 USB2.0 hub forwarding module
404 USB2.0 hub control module
405 Vbus power supply logic control unit
406 upstream port
407 downstream port
408 screening backup module
409 analysis reporting module
410 transceiving transmission module
Method flows from S51 to S55
Detailed Description
The embodiments of the present invention are described below with reference to specific embodiments, and other advantages and effects of the present invention will be easily understood by those skilled in the art from the disclosure of the present specification. The invention is capable of other and different embodiments and of being practiced or of being carried out in various ways, and its several details are capable of modification in various respects, all without departing from the spirit and scope of the present invention. It is to be noted that the features in the following embodiments and examples may be combined with each other without conflict.
It should be noted that the drawings provided in the following embodiments are only for illustrating the basic idea of the present invention, and the components related to the present invention are only shown in the drawings rather than drawn according to the number, shape and size of the components in actual implementation, and the type, quantity and proportion of the components in actual implementation may be changed freely, and the layout of the components may be more complicated.
The invention provides a USB hub, a USB device enumeration exception detection method and a computer storage medium, which are applied to enumeration detection of USB devices. The invention realizes enumeration detection without depending on an expensive USB protocol analyzer, greatly reduces the cost caused by manual detection of engineers, has high detection accuracy, and is convenient for large-scale enumeration test by a mode of outputting a result through a serial port, thereby greatly improving the efficiency of the USB enumeration detection.
The USB Hub is also called a USB Hub, and is a device that can extend one USB interface to multiple interfaces and make these interfaces usable simultaneously. The USB hub may be divided into a USB2.0 hub, a USB3.0 hub, and a USB3.1 hub according to the USB protocol, and the structure of the USB hub, the flow steps of the USB device enumeration exception detection method, and the computer storage medium will be explained below.
Fig. 1 shows a schematic structural diagram of a USB hub according to an embodiment of the present invention. The USB concentrator is connected with a plurality of USB devices to be tested in a downlink mode and connected with the USB host device in an uplink mode. The USB hub comprises a hub submodule and an enumeration detection submodule, wherein the hub submodule is used for establishing communication connection between USB host equipment and USB equipment to be tested, and the enumeration detection submodule is used for enumerating the USB equipment to be tested.
In an embodiment of the present invention, the USB hub is provided with a plurality of downstream ports, not shown, for accessing a USB device under test, which is actually connected to the hub sub-module of the USB hub. The USB concentrator is also provided with 2 uplink data flow ports which are not shown in the figure and are respectively led out by an enumeration detection submodule and a concentrator submodule, and connecting wires led out by the uplink data flow ports are all connected into USB host equipment. Specifically, the enumeration detection submodule is connected with a serial port module of the USB host device, and the hub submodule is connected with a USB host controller of the USB host device. On the USB host device side, a USB hub and one or more USB devices under test are identified. Those skilled in the art should know that the USB device to be tested can normally operate by installing a matching driver, where the driver is mainly used to report the detection result to the USB host device, and the USB host device displays the detection result as needed.
Fig. 2 is a schematic structural diagram of a hub submodule according to an embodiment of the present invention. The hub sub-module 2 includes a hub forwarding module 21, a hub control module 22, and a power supply module 23. The hub forwarding module 21 is configured to establish a communication connection between the USB host device and the USB device under test and handle bus exception, for example: the method comprises the following steps of detecting bus abnormality, recovering bus abnormality, detecting plugging and unplugging of equipment and the like. The hub control module 22 interfaces with the USB host controller of the USB host device for the USB host device to configure the USB hub, e.g., the hub supports a specific state, supports control commands so that the USB host device can configure the hub, and monitor and control each individual data stream port. The power module 23 is electrically connected to the hub forwarding module 21 and the hub control module 22 to provide power. The power module 23 is, for example, a Vbus power supply, which is usually set to a voltage of 5V.
Taking a universal USB3.1 hub as an example, the structure is shown in fig. 3. The USB3.1 hub 3 includes 1 USB3.1 hub forwarding module 31, 1 USB3.1 hub control module 32, 1 USB2.0 hub forwarding module 33, 1 USB2.0 hub control module 34, 1 Vbus power logic control unit 35, 1 upstream port 36 for connecting to a USB host device, and a plurality of downstream ports 37 for connecting to a USB device under test.
The Vbus power supply supplies power to the USB3.1 hub forwarding module 31 and the USB3.1 hub control module 32, and also supplies power to the USB2.0 hub forwarding module 33 and the USB2.0 hub control module 34. In addition, the USB3.1 hub forwarding module 31 and the USB3.1 hub control module 32 are used in cooperation, the USB2.0 hub forwarding module 33 and the USB2.0 hub control module 34 are used in cooperation, and the two hub modules operate independently according to different types of the inserted USB device to be tested.
It is worth noting that the USB protocol usually requires the USB hub to have a function of being compatible downward, so the USB hub provided by the present invention not only supports super-high-speed hub sub-modules, such as a USB3.1 hub forwarding module and a USB3.1 hub control module, but also is compatible with common hub sub-modules, such as a USB2.0 hub forwarding module and a USB2.0 hub control module, thereby effectively improving the compatibility of the hub and providing different options for users to increase user experience.
Fig. 4 is a schematic structural diagram of a USB hub according to an embodiment of the present invention. In this embodiment, still taking the USB3.1 hub as an example, the USB3.1 hub includes a USB3.1 hub forwarding module 401, a USB3.1 hub control module 402, a USB2.0 hub forwarding module 403, a USB2.0 hub control module 404, a Vbus power logic control unit 405, an upstream port 406, and a downstream port 407; the USB3.1 hub further includes a screening backup module 408, an analysis reporting module 409, and a transceiving module 410.
The screening backup module 408 is configured to intercept a data packet of a specific endpoint used for implementing enumeration operation in each data stream port of the USB hub, screen a USB device to be tested corresponding to the specific endpoint where the data packet is not intercepted within a preset time, and backup the data packet sent or received by the screened USB device to be tested; the analysis reporting module 409 is configured to receive the notification from the screening backup module 408, and accordingly analyze the data packet backed up by the screening backup module 408 and generate analysis result information indicating that enumeration of the USB device under test is successful or failed; the transceiving module 410 is configured to receive the analysis result information from the analysis reporting module 409 and transmit the analysis result information to an external display device.
The external display device refers to an intelligent device having a display function and an information transmission function, such as a notebook computer, a pad computer, a desktop computer, and a mobile terminal. In an embodiment, the external display device and the USB host device are integrated into a single device. In another embodiment, the external display device and the USB host device are two different devices, which can be implemented in both embodiments, and the invention is not limited thereto.
Specifically, during the transceiving of the up and down data packets, the screening backup module 408 intercepts the data of the specific endpoint 0 of each data stream port, where the specific endpoint 0 is the endpoint that processes the USB request during the enumeration detection process. Whether the data packet is an uplink data packet or a downlink data packet, the hub forwarding module in the hub sub-module determines to which downlink data stream port the data packet is to be transmitted and received according to the routing field routing string in the transmission packet TP.
If the screening backup module 408 does not capture the data packet of the specific endpoint 0 of a certain data stream port within the preset time, it indicates that the USB device under test corresponding to the data stream port is performing enumeration detection, and the enumeration result is either successful or failed. The preset time may be set to 5 seconds, for example, and the screening backup module 408 screens out the USB device to be tested corresponding to the specific endpoint that does not intercept the data packet within 5 seconds.
After the screening backup module 408 screens out the USB devices to be tested, the data packets sent or received by the screened USB devices to be tested are backed up. For example, the data packet is backed up to a flash memory inside the screening backup module 408 and stored according to a preset rule. Preferably, the screening backup module 408 stores the data packets in a concurrent enumeration backup manner, thereby greatly improving the efficiency of backup and enumeration detection. When the enumeration detection process is stopped and the screening backup module 408 completes the backup of the data packet, the screening backup module 408 notifies the analysis reporting module 409, and the screening backup module enters a suspended state.
The analysis reporting module 409 receives the notification from the screening backup module 408, so as to start analyzing the data packet backed up by the screening backup module 408 and generate analysis result information of enumeration success or enumeration failure of the USB device to be tested. Specifically, the analysis reporting module 409 combs an enumeration process, and detects whether a request sent by the USB host device and a reply sent by the USB device to be tested are reasonable according to the USB protocol specification, so as to determine whether enumeration of the USB device to be tested is successful or failed.
The method for detecting whether the request sent by the USB host device and the reply sent by the USB device to be tested are reasonable by the analysis reporting module 409 includes: mode 1) a request is sent by USB host equipment, and USB equipment to be tested responds; the analysis reporting module 409 detects whether the content of the response of the USB device to be tested meets the USB protocol specification; if the USB protocol specification is met, the USB equipment to be tested is enumerated successfully; if the USB protocol specification is not met, the enumeration of the USB equipment to be tested fails; mode 2) the USB device under test sends data to the USB host device; the analysis reporting module 409 detects whether the content sent by the USB device to be tested meets the USB protocol specification; if the USB protocol specification is met, the USB equipment to be tested is enumerated successfully; if the USB protocol specification is not met, the enumeration of the USB equipment to be tested fails; mode 3) analyzes the whole enumeration process, detects whether the process has errors or hidden dangers, and accordingly judges whether the USB equipment to be tested is enumerated successfully.
It should be noted that, the analysis reporting module 409 may adopt any one of the above 3 detection modes to detect whether the request sent by the USB host device and the reply sent by the USB device to be tested are reasonable, may also adopt a mode of combining 3 modes two by two to perform detection, and certainly may also adopt the 3 modes to perform detection at the same time to obtain the optimal and most accurate detection result.
After the analysis reporting module 409 analyzes and generates the analysis result information of the enumeration success or failure of the USB device under test, the operation of reporting to the transceiving transmission module 410 is executed. The transceiving module 410 transmits the analysis result information to an external display device, so as to display the enumeration detection result through the external display device.
Optionally, the transceiving module 410 is, for example, a UART chip, and is configured to send the enumeration detection result to an external display device through a serial port. The UART chip is called Universal Asynchronous Receiver/Transmitter in all, and means a Universal Asynchronous Receiver/Transmitter; the UART chip is mainly used for converting data to be transmitted between serial communication and parallel communication, and is a chip capable of converting a parallel input signal into a serial output signal.
In summary, the description contents of the USB hub in the above text show that the USB hub provided by the present invention is compatible with the function of a common hub, and further has an enumeration detection sub-module, and can automatically execute enumeration detection and determine the result of enumeration detection without depending on an expensive USB protocol analyzer, thereby greatly reducing the labor cost caused by manual enumeration detection of engineers, improving the efficiency of enumeration detection, and avoiding errors or errors caused by human factors. In addition, the USB concentrator adopts a serial interface for output, so that large-scale test and problem recording are facilitated.
Fig. 5 is a schematic flow chart showing a method for detecting enumeration exception of a USB device according to an embodiment of the present invention. The method comprises the following steps:
s51: intercepting a data packet of a specific endpoint for realizing enumeration operation in each data stream port;
s52: screening USB equipment to be tested corresponding to a specific endpoint of which the data packet is not intercepted within a preset time;
s53: backing up the data packets sent or received by the screened USB equipment to be tested;
s54: analyzing the data packet backed up by the screening backup module and generating analysis result information of the enumeration success or failure of the USB equipment to be tested;
s55: and transmitting the analysis result information to an external display device.
The method for analyzing the data packets backed up by the screening backup module comprises the following steps: and combing the enumeration process, detecting whether the request sent by the USB host equipment and the reply sent by the USB equipment to be tested are reasonable according to the USB protocol specification, and accordingly judging whether the enumeration of the USB equipment to be tested is successful or failed.
The method for detecting whether the request sent by the USB host equipment and the reply sent by the USB equipment to be tested are reasonable comprises the following steps: mode 1) a request is sent by USB host equipment, and USB equipment to be tested responds; the analysis reporting module detects whether the content responded by the USB equipment to be tested meets the USB protocol specification; if the USB protocol specification is met, the USB equipment to be tested is enumerated successfully; if the USB protocol specification is not met, the enumeration of the USB equipment to be tested fails; mode 2) the USB device under test sends data to the USB host device; the analysis reporting module detects whether the content sent by the USB equipment to be tested meets the USB protocol standard; if the USB protocol specification is met, the USB equipment to be tested is enumerated successfully; if the USB protocol specification is not met, the enumeration of the USB equipment to be tested fails; mode 3) analyzes the whole enumeration process, detects whether the process has errors or hidden dangers, and accordingly judges whether the USB equipment to be tested is enumerated successfully. It should be noted that the embodiment of the USB device enumeration exception detection method is similar to the embodiment of the USB hub, and therefore, the detailed description thereof is omitted.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the above method embodiments may be performed by hardware associated with a computer program. The aforementioned computer program may be stored in a computer readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
In summary, the USB hub, the USB device enumeration exception detection method, and the computer storage medium provided by the present invention are compatible with the function of a common hub, and an enumeration detection submodule is further added, so that enumeration detection can be automatically performed and an enumeration detection result can be determined without relying on an expensive USB protocol analyzer, thereby greatly reducing the labor cost caused by manual enumeration detection of engineers, improving the efficiency of enumeration detection, and avoiding errors or errors caused by human factors. In addition, the USB concentrator adopts a serial interface for output, so that large-scale test and problem recording are facilitated. Therefore, the invention effectively overcomes various defects in the prior art and has high industrial utilization value.
The foregoing embodiments are merely illustrative of the principles and utilities of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or change the above-mentioned embodiments without departing from the spirit and scope of the present invention. Accordingly, it is intended that all equivalent modifications or changes which can be made by those skilled in the art without departing from the spirit and technical spirit of the present invention be covered by the claims of the present invention.

Claims (10)

1. A USB concentrator is characterized in that one end of the USB concentrator is connected with USB host equipment, and the other end of the USB concentrator is connected with one or more USB devices to be tested; the USB hub includes an enumeration detection submodule comprising:
the screening backup module is used for intercepting data packets of a specific endpoint used for realizing enumeration operation in each data stream port of the USB concentrator, screening USB equipment to be tested corresponding to the specific endpoint of which the data packets are not intercepted within preset time, and backing up the data packets sent or received by the screened USB equipment to be tested;
the analysis reporting module is used for receiving the notification from the screening backup module, analyzing the data packet backed up by the screening backup module and generating analysis result information of enumeration success or failure of the USB equipment to be tested;
and the transceiving transmission module is used for receiving the analysis result information from the analysis reporting module and transmitting the analysis result information to the external display equipment.
2. The USB hub according to claim 1, wherein the USB hub further comprises a hub sub-module comprising:
the hub forwarding module is used for establishing communication connection between the USB host equipment and the USB equipment to be tested and processing bus exception;
the hub control module is connected with a USB host controller of the USB host equipment so as to enable the USB host equipment to configure the USB hub;
and the power supply module is electrically connected with the hub forwarding module and the hub control module to provide power supply.
3. The USB hub according to claim 2, wherein the hub forwarding module comprises a high speed transceiver module and a superspeed transceiver module; the hub control module comprises a high-speed control module and an ultra-high-speed control module.
4. The USB hub according to claim 1, wherein the analysis reporting module combs an enumeration process, and detects whether a request sent by the USB host device and a reply sent by the USB device under test are reasonable according to a USB protocol specification, thereby determining whether enumeration of the USB device under test succeeds or fails.
5. The USB hub according to claim 4, wherein the means for the analysis reporting module to detect whether the request sent by the USB host device and the reply sent by the USB device under test are reasonable includes any one or a combination of the following means:
mode 1) a request is sent by USB host equipment, and USB equipment to be tested responds; the analysis reporting module detects whether the content responded by the USB equipment to be tested meets the USB protocol specification; if the USB protocol specification is met, the USB equipment to be tested is enumerated successfully; if the USB protocol specification is not met, the enumeration of the USB equipment to be tested fails;
mode 2) the USB device under test sends data to the USB host device; the analysis reporting module detects whether the content sent by the USB equipment to be tested meets the USB protocol standard; if the USB protocol specification is met, the USB equipment to be tested is enumerated successfully; if the USB protocol specification is not met, the enumeration of the USB equipment to be tested fails;
mode 3) analyzes the whole enumeration process, detects whether the process has errors or hidden dangers, and accordingly judges whether the USB equipment to be tested is enumerated successfully.
6. The USB hub according to claim 1, wherein the screening backup module intercepts packets of a specific endpoint of each data stream port for performing enumeration operations, wherein the data stream ports comprise an upstream data stream port connected to the USB host device and a downstream data stream port connected to the USB device under test.
7. A method for detecting enumeration exception of a USB device is characterized by comprising the following steps:
intercepting a data packet of a specific endpoint for realizing enumeration operation in each data stream port;
screening USB equipment to be tested corresponding to a specific endpoint of which the data packet is not intercepted within a preset time;
backing up the data packets sent or received by the screened USB equipment to be tested;
analyzing the data packet backed up by the screening backup module and generating analysis result information of the enumeration success or failure of the USB equipment to be tested;
and transmitting the analysis result information to an external display device.
8. The method according to claim 7, wherein analyzing the data packets backed up by the screening backup module comprises: and combing the enumeration process, detecting whether the request sent by the USB host equipment and the reply sent by the USB equipment to be tested are reasonable according to the USB protocol specification, and accordingly judging whether the enumeration of the USB equipment to be tested is successful or failed.
9. The method for detecting enumeration exception of a USB device as claimed in claim 8, wherein the manner of detecting whether the request from the USB host device and the reply from the USB device under test are reasonable comprises any one or a combination of the following manners:
mode 1) a request is sent by USB host equipment, and USB equipment to be tested responds; the analysis reporting module detects whether the content responded by the USB equipment to be tested meets the USB protocol specification; if the USB protocol specification is met, the USB equipment to be tested is enumerated successfully; if the USB protocol specification is not met, the enumeration of the USB equipment to be tested fails;
mode 2) the USB device under test sends data to the USB host device; the analysis reporting module detects whether the content sent by the USB equipment to be tested meets the USB protocol standard; if the USB protocol specification is met, the USB equipment to be tested is enumerated successfully; if the USB protocol specification is not met, the enumeration of the USB equipment to be tested fails;
mode 3) analyzes the whole enumeration process, detects whether the process has errors or hidden dangers, and accordingly judges whether the USB equipment to be tested is enumerated successfully.
10. A computer-readable storage medium on which a computer program is stored, the program, when executed by a processor, implementing the USB device enumeration exception detection method of any one of claims 7 to 9.
CN201810796087.6A 2018-07-19 2018-07-19 USB hub, USB device enumeration exception detection method and computer storage medium Active CN109254937B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810796087.6A CN109254937B (en) 2018-07-19 2018-07-19 USB hub, USB device enumeration exception detection method and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810796087.6A CN109254937B (en) 2018-07-19 2018-07-19 USB hub, USB device enumeration exception detection method and computer storage medium

Publications (2)

Publication Number Publication Date
CN109254937A CN109254937A (en) 2019-01-22
CN109254937B true CN109254937B (en) 2021-08-06

Family

ID=65048936

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810796087.6A Active CN109254937B (en) 2018-07-19 2018-07-19 USB hub, USB device enumeration exception detection method and computer storage medium

Country Status (1)

Country Link
CN (1) CN109254937B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112269707A (en) * 2020-11-17 2021-01-26 深兰科技(上海)有限公司 USB enumeration detection method, USB host device and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101059769A (en) * 2007-06-13 2007-10-24 威盛电子股份有限公司 Universal serial bus device test system and its method
CN103154922A (en) * 2010-08-30 2013-06-12 高通股份有限公司 Virtual USB compound device enumeration
CN104142876A (en) * 2013-05-06 2014-11-12 上海华虹集成电路有限责任公司 Function verification method and verification environmental platform for USB (universal serial bus) equipment controller modules

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6795872B2 (en) * 2002-05-09 2004-09-21 Renesas Technology America, Inc. Maintaining at least partial functionality of a device as defined by a hardware configuration at a USB bus enumeration while the device memory is programmed

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101059769A (en) * 2007-06-13 2007-10-24 威盛电子股份有限公司 Universal serial bus device test system and its method
CN103154922A (en) * 2010-08-30 2013-06-12 高通股份有限公司 Virtual USB compound device enumeration
CN104142876A (en) * 2013-05-06 2014-11-12 上海华虹集成电路有限责任公司 Function verification method and verification environmental platform for USB (universal serial bus) equipment controller modules

Also Published As

Publication number Publication date
CN109254937A (en) 2019-01-22

Similar Documents

Publication Publication Date Title
US7231560B2 (en) Apparatus and method for testing motherboard having PCI express devices
CN108475227B (en) Test functional assembly and data debugging method
US20170337069A1 (en) Concurrent testing of pci express devices on a server platform
US11048826B2 (en) FPGA device and cloud system based on FPGA device
JP6594972B2 (en) Embedded universal serial bus (USB) debugging (EUD) for multi-interface debugging in electronic systems
US9026687B1 (en) Host based enumeration and configuration for computer expansion bus controllers
CN115210589A (en) Chip testing device and testing method
CN111289922B (en) Cable plugging detection method and related equipment
CN104077203A (en) Method and device for diagnosing computer hardware through USB interface
WO2021248788A1 (en) Methods for implementing multi-device compatibility testing, apparatuses for implementing multi-device compatibility testing, system for implementing multi-device compatibility testing, and electronic device
CN109254937B (en) USB hub, USB device enumeration exception detection method and computer storage medium
CN109710479B (en) Processing method, first device and second device
CN109407655B (en) Method and device for debugging chip
CN102426548A (en) Debugging method, debugger and debugging system for embedded system
WO2016184170A1 (en) Smi interface device debugging apparatus and method, and storage medium
CN102455965A (en) Electronic device test system and method
WO2014000299A1 (en) Serial port redirection processing method, device, and system
US11334506B2 (en) Interface connection device, system and method thereof
CN101377753A (en) Accessory test device and method
CN108681497B (en) CPCI bus testing device and method
CN112162894B (en) Chip and debugging subassembly, debug system thereof
CN104062530A (en) Mobile terminal hardware fault detecting device and method
CN211787062U (en) MCTP equipment testing arrangement
US10120828B2 (en) Bridge for bus-powered peripheral device power management
US9424161B2 (en) Trace capture device with common structure and related trace capture method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant