Hardware debugging method
By scanning the connection ports of the hardware interface using the serial communication interface during BIOS operation, judging the number of entities and connected devices, the problem of difficulty in detecting the number and status of hardware devices is solved, real-time detection and status confirmation of hardware devices is realized, and the improvement of the real-time detection and status confirmation of hardware devices is achieved. User experience.
Patent Information
- Application Number
- CN202310665801.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-06
- Publication Date
- 2024-12-06
AI Technical Summary
It is difficult for computers to accurately detect the number and status of hardware devices while the BIOS or operating system is running, resulting in the hardware device being damaged or driver errors that cannot be discovered in time. It needs to be restarted to solve the problem and affect the user experience.
When the processor executes the basic input and output system, it uses the serial communication interface to scan the connection ports of the hardware interface one by one, determine whether the number of physical devices and the number of connected devices are the same, and generates a warning signal to notify the user that the hardware device may be damaged or driver errors. Allows early confirmation of hardware status during POST.
Real-time detection and status confirmation of hardware devices are realized, avoiding the hassle of restarting, improving the convenience of users to use the computer, and ensuring the normal operation of the hardware devices.
Smart Images

Figure CN119088626A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to an electronic device, and in particular to a hardware error detection method. Background Art
[0002] Modern computers are usually installed with a variety of hardware devices with various functions, such as hard disks or display adapters. How the computer determines whether the installed hardware devices themselves are functioning properly and whether multiple hardware devices can coordinate with each other is an important issue. In this regard, the computer scans and detects the hardware devices during the Power On Self Test (POST) process of the Basic Input / Output System (BIOS) program, and performs a series of self-tests and troubleshooting to ensure that the hardware devices can be correctly accessed and used. In the operating system state, the computer can also ensure the normal operation of the hardware devices by executing the driver. The aforementioned driver is usually provided by the hardware manufacturer and needs to be matched and installed with the operating system to ensure its normal operation. However, whether through the basic input and output system or the operating system, the computer can only access the hardware devices that the driver can scan, and cannot determine the number of hardware devices actually installed on the computer.
[0003] A common problem is that the computer is equipped with multiple hardware devices, but the user does not find out that the specific hardware device cannot be accessed until the user wants to access it. For example, there are 10 NVMe hardware devices installed on the computer motherboard, but the user does not find out that the computer only reads 9 of them until the operating system is running. At this time, the computer needs to be restarted to solve the above problem, which is very troublesome.
[0004] The above problems may be caused by damage to the hardware device itself, or the driver version used to drive the hardware device is wrong or not executed correctly. Although the computer will scan hardware devices such as SATA or NVMe when executing the BIOS POST program, and display the scanned hardware devices. However, BIOS can only scan and check the hardware device through the driver of the hardware device; when the hardware device is damaged or the driver is wrong, BIOS cannot scan the hardware device. As in the above example, when the driver version of one of the 10 NVMe hardware devices is wrong, BIOS determines that only 9 NVMe hardware devices are installed on the computer and continues to execute the boot process.
[0005] Therefore, it is necessary to establish a method for quickly and accurately detecting access problems of hardware devices, so as to solve the hardware device problems in real time and improve the convenience of users in using computers. Summary of the invention
[0006] In view of this, the applicant proposes a variety of hardware debugging methods. One of the hardware debugging methods is applicable to a computer, the computer includes a processor and a hardware interface, the processor is suitable for running a basic input and output system, the hardware interface is used to connect at least one hardware device, the method includes: the processor reads the hardware interface through a serial communication interface when executing the basic input and output system, selects the at least one hardware device as a slave end one by one, so as to determine the number of physical devices of the at least one hardware device physically connected to the hardware interface; the processor scans the at least one hardware device one by one according to a driver program used to drive the at least one hardware device, so as to determine the number of connected devices of the at least one hardware device accessible by the processor; the processor determines whether the number of physical devices and the number of connected devices are the same; when the processor determines that the number of physical devices and the number of connected devices are different, a warning signal is generated.
[0007] Particularly, the serial communication interface is an Inter-Integrated Circuit interface.
[0008] In particular, the computer further includes a backplane control chip, the hardware interface includes at least one hardware connection port coupled to the backplane control chip, and the processor controls the backplane control chip to select each of the hardware connection ports one by one according to the integrated bus circuit interface to determine the number of connection devices of the at least one hardware device physically connected to the hardware interface.
[0009] In particular, the at least one hardware connection port includes a present pin, and the processor controls the backplane control chip to read the default pin of each hardware connection port one by one according to the integrated bus circuit interface; when the default pin of any hardware connection port is a high voltage, the processor determines that the hardware connection port is not counted in the number of physical devices.
[0010] Particularly, the processor scans the number of connected devices of the at least one hardware device according to the driver program for driving the at least one hardware device during a boot device selection phase of running a power on self-test program.
[0011] Particularly, the computer further comprises a display. After the processor determines that the number of the physical devices and the number of the connected devices are different, the processor pauses the power-on self-test program and controls the display to display the warning signal.
[0012] Particularly, the hardware interface is selected from the group consisting of Serial Advanced Technology Attachment, Non-Volatile Memory Express, Peripheral Component Interconnect and Peripheral Component Interconnect Express.
[0013] In particular, the hardware device is a hard disk device that is adapted for Serial Advanced Technology Attachment or Non-Volatile Memory communication protocol.
[0014] The applicant also proposed another hardware debugging method, which is applicable to a computer, the computer comprising a processor, a baseboard management controller and a hardware interface, the processor being suitable for running a basic input and output system, the baseboard management controller being suitable for coupling to the hardware interface, the hardware interface being used to connect at least one hardware device, the method comprising: the baseboard management controller reading the hardware interface through a serial communication interface, selecting the at least one hardware device as a slave end one by one, so as to determine the number of physical devices of the at least one hardware device physically connected to the hardware interface; the processor acquiring the number of physical devices generated by the baseboard management controller when executing the basic input and output system; the processor scanning the at least one hardware device one by one according to a driver program used to drive the at least one hardware device when executing the basic input and output system, so as to determine the number of connected devices of the at least one hardware device accessible to the processor; the processor determining whether the number of physical devices is the same as the number of connected devices; and generating a warning signal when the processor determines that the number of physical devices is different from the number of connected devices.
[0015] In particular, the computer further includes a backplane control chip, the hardware interface includes at least one hardware connection port coupled to the backplane control chip, the baseboard management controller is further coupled to a remote device, and the hardware debugging method further includes: the baseboard management controller controls the backplane control chip to select each of the hardware connection ports one by one according to an integrated bus circuit interface to determine the number of connected devices of the at least one hardware device physically connected to the hardware interface; and the baseboard management controller receives the warning signal from the processor and sends the warning signal to the remote device.
[0016] Compared with the prior art, the hardware debugging method of the present invention allows the computer to determine the hardware connection status between the hardware device and the hardware interface to obtain the number of physical devices of the hardware device currently connected to the hardware interface, and allows the computer to determine the software connection status between the hardware device and the computer to obtain the number of connected devices that can be accessed at present, thereby confirming whether the hardware device installed in the hardware interface is unusable and needs to be repaired. In some embodiments, the hardware debugging method is executed during the computer running POST, so as to confirm the status of the hardware device early, without having to wait until the operating system is running to find that it cannot be driven and must re-execute the complete boot program. In some embodiments, the hardware debugging method can be executed by the baseboard management controller of the computer, and the baseboard management controller can send a warning signal of an error in the hardware device to a remote device. Thus, the remote device can monitor the status of the hardware devices installed on one or more computers. In addition, the remote device can manage the status of each computer through a graphical interface running in the operating system state. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Other features and effects of the present invention will be clearly presented in the embodiments with reference to the accompanying drawings, in which: Figure 1 A block diagram of a computer disclosed according to some embodiments of the present invention; and Figure 2 The flowchart is a hardware debugging method disclosed according to some embodiments of the present invention. DETAILED DESCRIPTION
[0018] Before the present invention is described in detail, it should be noted that similar elements are denoted by the same reference numerals in the following description.
[0019] Figure 1 The block diagram of the computer disclosed in some embodiments of the present invention is shown in FIG. Figure 1 In this embodiment, the computer 10 includes a processor 101, a backplane control chip 102, a hardware interface 103 and a memory 104, and the hardware interface 103 includes a hardware connection port 103A, a hardware connection port 103B and a hardware connection port 103C. The computer 10 can be, but is not limited to, a personal computer, a notebook computer, a server or an embedded circuit. In some embodiments, the computer 10 includes a baseboard management controller (BMC) 105, and the baseboard management controller 105 is suitable for coupling to a remote device 20, for example, through a network.
[0020] The processor 101 may be, but is not limited to, a SoC chip, a central processing unit (CPU), a micro-control unit (MCU), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or a logic circuit.
[0021] The backplane control chip 102 may be, but is not limited to, a SoC chip, a microcontroller unit (MCU), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or a logic circuit. In some embodiments, the backplane control chip 102 may be disposed in an I / O path controller (I / O Controller Hub, ICH) or a platform path controller (Platform Controller Hub, PCH) of the backplane of the computer 10, coupling the central processing unit and the peripheral device (Peripherals) interface. The central processing unit may be coupled to the platform path controller via a direct media interface (DMI). In other embodiments, the backplane control chip 102 is a single chip or integrated circuit independent of the ICH or PCH. In some embodiments, the processor 101 is coupled to the backplane control chip 102 via a serial communication interface. The serial communication interface may be, but is not limited to, a communication interface using a transmission protocol such as a serial peripheral interface (SPI), an inter-integrated circuit (I²C), a transistor-transistor logic (TTL), a DMI, or a peripheral component interconnect express (PCIe). For example, the processor 101 transmits a signal to the processor 101 through an inter-integrated circuit (IC). 2C) interface coupled to the backplane control chip 102, the processor 101 and the backplane control chip 102 respectively include a serial data pin (Serial data, SDA) and a serial clock pin (Serial clock, SCL), and are connected through two wires connected to the SDA and SCL pins respectively. Among them, the backplane control chip 102 is set at the slave end (Slave). In some embodiments, there are multiple backplane control chips 102 and they are all coupled to the processor 101 as slaves. Each backplane control chip 102 includes an independent address to avoid transmission conflicts.
[0022] The hardware interface 103 is used to connect at least one hardware device, which may be, but is not limited to, a hard disk, a display adapter, a sound card, and a network card. Figure 1 In the embodiment shown, the hardware interface 103 includes three hardware connection ports, namely hardware connection port 103A, hardware connection port 103B and hardware connection port 103C, each of which is used to connect a hardware device (the hardware interface 103 can connect a total of three hardware devices). The data transmission specifications of the hardware connection ports can adopt Serial Advanced Technology Attachment (SATA), Non-Volatile Memory Express (NVMe), Peripheral Component Interconnect (PCI), and Peripheral Component Interconnect Express (PCIe) protocols. The size specifications of the hardware connection ports can adopt standards such as M.2 or U.2. In some embodiments, there are multiple hardware connection ports, and the specifications of each hardware connection port can be the same or different. For example, in Figure 1 In the embodiment shown, the hardware connection port 103A adopts SATA, and the hardware connection port 103B and the hardware connection port 103C adopt NVMe. Alternatively, there are multiple backplane control chips 102, each of which is connected to one or more hardware connection ports, and the specifications of the hardware connection ports to which each backplane control chip 102 is respectively connected can be the same or different. For example, the processor 101 is connected to three backplane control chips 102, each of which is connected to a hardware connection port, one of which adopts SATA, and the remaining two hardware connection ports adopt NVMe.
[0023] In some embodiments, the hardware connection port includes a present pin. For example, a SATA solid-state drive interface using the U.2 specification uses a present pin to identify the connection status. When the present pin is high, it indicates that the solid-state drive is not connected; when the present pin is low, it indicates that the interface is currently connected to the solid-state drive. Thus, the backplane control chip 102 can identify the number of physical devices of the hardware device connected to the hardware interface 103 through the present pin. For example, Figure 1 In the embodiment shown, when the hardware connection port 103A and the hardware connection port 103C are connected to hardware and the hardware connection port 103B is vacant, the backplane control chip 102 reads the hardware connection port 103A as a low potential, the hardware connection port 103B as a high potential, and the hardware connection port 103C as a low potential. In some embodiments, the backplane control chip 102 includes a multiplexer to switch the in-position pins of the multiple hardware connection ports connected to the backplane control chip 102. Thus, the backplane control chip 102 reads the potential of each in-position pin one by one. In some embodiments, the processor 101 is connected to multiple backplane control chips 102, each backplane control chip 102 is connected to a hardware connection port, and the processor 101 controls each backplane control chip 102 one by one to read the potential of the in-position pin of the hardware connection port connected to each backplane control chip 102.
[0024] The memory 104 may be, but is not limited to, a phase-change memory (PRAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), other types of RAM, ROM, flash memory, and an electrically-erasable programmable read-only memory (EEPROM). The memory 104 is coupled to the processor 101 and is used to store a program code of a basic input / output system (BIOS). After the computer 10 is turned on, the processor 101 reads the BIOS program code stored in the memory 104 and executes it. The memory 104 may also store a hardware debugging method. In some embodiments, there are multiple memories 104 and they are all coupled to the processor 101. One memory 104 is used to store the BIOS program code, and another memory 104 is used to store the hardware debugging method. Here, the other memory 104 is a non-transient computer-readable recording medium. The non-transitory computer readable recording medium stores a computer program and includes a plurality of instructions executable by the computer program computer 10. The non-transitory computer readable recording medium may be a built-in memory of the computer 10, or an external storage device such as RAM, ROM, EEPROM, flash memory or other storage technology, CD-ROM, DVD, disk, tape, USB flash drive, hard disk, memory card, or cloud storage space.
[0025] Figure 2 This is a flowchart of a hardware debugging method disclosed in some embodiments of the present invention. Please refer to Figure 2 . The computer 10 reads the hardware interface 103 through the serial communication interface, and selects the hardware devices as slaves one by one to determine the number of physical devices of the hardware devices physically connected to the hardware interface (step S101). In some embodiments, the processor 101 runs the BIOS program code to perform a power-on self-test (Power On Self Test, POST) and a hardware debugging method. The processor 101 can read the hardware interface 103 through the serial communication interface during the Pre-EFI Initialization (PEI) or Driver Execution Environment (DXE) phase of POST, for example, reading the potential of the in-place pin of the hardware connection port through I²C. Thus, the processor 101 is sufficient to determine the number of physical devices of the hardware device connected to the hardware interface 103. For example, in Figure 1In the embodiment shown, the backplane control chip 102 reads that the hardware connection port 103A is low, the hardware connection port 103B is high, and the hardware connection port 103C is low, and the number of physical devices is 2 (ie, the hardware connection port 103A and the hardware connection port 103C).
[0026] Reference Figure 2 , the computer 10 scans the hardware devices one by one according to the driver program to determine the number of connected devices of the accessible hardware devices (step S102). The driver program is used to drive the hardware device. The driver program can be a hardware driver instruction built into the BIOS, or a driver program installed separately in the computer 10. The driver program scans the hardware device to confirm the number of connected devices of the hardware device currently accessible to the computer 10. For example, in Figure 1 In the embodiment shown, the driver scans the hardware device connected to the hardware connection port 103A and finds that it can be accessed, the hardware device connected to the hardware connection port 103B cannot be accessed, and the hardware device connected to the hardware connection port 103C cannot be accessed, then the number of connected devices is 1 (i.e., the hardware connection port 103A). Here, the number of physical devices is at least related to whether the hardware device is installed in the hardware interface 103 and whether the hardware device is damaged, while the number of connected devices is at least related to whether the hardware device is installed in the hardware interface 103, whether the hardware device is damaged, and whether there is an error in the driver. In some embodiments, damage to the hardware device may occur when the number of physical devices is different from the number of connected devices. For example, the backplane control chip 102 reads the hardware connection port and determines that the hardware device exists, which only means that the potential of the in-position pin is functional; however, other parts of the hardware device may be damaged, resulting in the computer 10 being unable to access the hardware device.
[0027] Reference Figure 2, the computer 10 determines whether the number of physical devices and the number of connected devices are the same (step S103). Here, when the hardware connection port is empty, it is not counted in the number of physical devices and the number of connected devices. When the hardware device of the hardware connection port is in place, but the computer 10 cannot access the hardware device of the hardware connection port, it will cause the number of physical devices and the number of connected devices to be different. Therefore, when the computer 10 determines that the number of physical devices and the number of connected devices are not the same (step S103, the judgment result is "no"), a warning signal is generated (step S104). In some embodiments, the computer 10 includes a display, and during the POST stage, a warning signal is displayed on the display through a user interface to notify the user that the currently installed hardware device may be damaged. In some embodiments, the processor 101 executes a driver to scan hardware devices one by one during the Boot Device Selection (BDS) phase of POST to determine the number of connected devices of the accessible hardware devices (step S102), and determines whether the number of physical devices and the number of connected devices are the same (step S103), so that the computer 10 does not need to complete POST to confirm the error problem of the hardware device, allowing the user to confirm whether to repair the hardware device problem early.
[0028] When the computer 10 determines that the number of physical devices and the number of connected devices are the same (step S103, the determination result is "yes"), the POST is continued (step S105). Therefore, in some embodiments, the hardware debugging method allows the computer 10 to complete the verification of the number of physical devices and the number of connected devices during the POST process, so that the user will not encounter the problem of being unable to connect to the hardware device during the operation of the operating system and must perform repairs and restart.
[0029] The aforementioned steps S101 to S105 may be executed by the processor 101 or the baseboard management controller 105 of the computer 10. In other embodiments, the computer 10 includes a processor 101, a backplane control chip 102, a hardware interface 103, a memory 104, and a baseboard management controller 105. In this embodiment, the baseboard management controller 105 is connected to the backplane control chip 102 via a serial communication interface, and reads the hardware interface 103 to determine the number of physical devices of the hardware device connected to the hardware interface 103 (step S101). The processor 101 may execute a driver in a power-on self-test program, and scan the hardware devices one by one to determine the number of connected devices of the accessible hardware device (step S102). Here, in some embodiments, the baseboard management controller 105 sends the number of physical devices to the processor 101, and the processor 101 determines whether the number of physical devices and the number of connected devices are the same (step S103). In other embodiments, the baseboard management controller 105 sends the number of physical devices to the memory 104 through the backplane control chip 102, and the processor 101 reads the number of physical devices from the memory 104 and determines whether the number of physical devices and the number of connected devices are the same (step S103). In this embodiment, the baseboard management controller 105 can be connected to a remote device 20 through a network. When the baseboard management controller 105 determines that the number of physical devices and the number of connected devices are not the same (step S103, the judgment result is "no"), it sends a warning signal to the remote device 20 (step S104), and the remote device 20 can use a display to display the warning signal.
[0030] In summary, the hardware debugging method allows the computer 10 to determine the hardware connection status between the hardware device and the hardware interface 103 to obtain the number of physical devices of the hardware device currently connected to the hardware interface 103, and allows the computer 10 to determine the software connection status between the hardware device and the computer 10 to obtain the number of connected devices that can be accessed currently, thereby confirming whether the hardware device installed in the hardware interface 103 is unusable and needs to be repaired. In some embodiments, the hardware debugging method is executed during the POST process of the computer 10, so as to confirm the status of the hardware device early, without having to wait until the operating system is running to find that it cannot be driven and must re-execute the complete boot process. In some embodiments, the hardware debugging method can be executed by the baseboard management controller 105 of the computer 10, and the baseboard management controller 105 can send a warning signal of an error in the hardware device to the remote device 20. Therefore, the remote device 20 can monitor the status of the hardware devices installed in one or more computers 10. In addition, the remote device 20 can manage the status of each computer 10 through a graphical interface running in the operating system state.
[0031] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A hardware debugging method, applicable to a computer, the computer comprising a processor and a hardware interface, the processor is suitable for running a basic input and output system, the hardware interface is used to connect at least one hardware device, It is characterized in that The method includes: The processor reads the hardware interface through a serial communication interface when executing the basic input and output system, selects the at least one hardware device as a slave end one by one, and determines the number of physical devices of the at least one hardware device physically connected to the hardware interface; The processor scans the at least one hardware device one by one according to a driver program for driving the at least one hardware device to determine the number of connected devices of the at least one hardware device accessible by the processor; The processor determines whether the number of the physical devices is the same as the number of the connected devices; and When the processor determines that the number of the physical devices is different from the number of the connected devices, a warning signal is generated.
2. The hardware debugging method according to claim 1, It is characterized in that The serial communication interface is an Inter-Integrated Circuit interface.
3. The hardware debugging method according to claim 2, It is characterized in that The computer further includes a backplane control chip, the hardware interface includes at least one hardware connection port coupled to the backplane control chip, and the processor controls the backplane control chip to select each of the hardware connection ports one by one according to the integrated bus circuit interface to determine the number of connection devices of the at least one hardware device physically connected to the hardware interface.
4. The hardware debugging method according to claim 3, It is characterized in that The at least one hardware connection port includes a present pin, and the processor controls the backplane control chip to read the default pin of each hardware connection port one by one according to the integrated bus circuit interface; when the default pin of any hardware connection port is a high voltage, the processor determines that the hardware connection port is not counted in the number of physical devices.
5. The hardware debugging method according to claim 1, It is characterized in that The processor scans the number of connected devices of the at least one hardware device according to the driver program used to drive the at least one hardware device during the boot device selection phase of running a power on self-test program.
6. The hardware debugging method according to claim 5, It is characterized in that The computer further comprises a display. After the processor determines that the number of the physical device and the number of the connected device are different, the processor suspends the power-on self-test program and controls the display to display the warning signal.
7. The hardware debugging method according to claim 1, It is characterized in that The hardware interface is selected from the group consisting of Serial Advanced Technology Attachment, Non-Volatile Memory Express, Peripheral Component Interconnect, and Peripheral Component Interconnect Express.
8. The hardware debugging method according to claim 1, It is characterized in that The hardware device is a hard disk device that is suitable for the Serial Advanced Technology Attachment or Non-Volatile Memory Communication Protocol.
9. A hardware debugging method, applicable to a computer, the computer comprising a processor, a baseboard management controller and a hardware interface, the processor is suitable for running a basic input and output system, the baseboard management controller is suitable for coupling the hardware interface, the hardware interface is used to connect at least one hardware device, It is characterized in that The method includes: The baseboard management controller reads the hardware interface through a serial communication interface, selects the at least one hardware device as a slave end one by one, and determines the number of physical devices of the at least one hardware device physically connected to the hardware interface; The processor obtains the physical device quantity generated by the baseboard management controller when executing the basic input and output system; The processor scans the at least one hardware device one by one according to a driver program for driving the at least one hardware device when executing the basic input and output system, so as to determine the number of connected devices of the at least one hardware device accessible by the processor; The processor determines whether the number of the physical devices is the same as the number of the connected devices; and When the processor determines that the number of the physical devices is different from the number of the connected devices, a warning signal is generated.
10. The hardware debugging method according to claim 9, It is characterized in that The computer further comprises a backplane control chip, the hardware interface comprises at least one hardware connection port coupled to the backplane control chip, the baseboard management controller is further coupled to a remote device, and the hardware debugging method further comprises: The baseboard management controller controls the backplane control chip to select each of the hardware connection ports one by one according to an integrated bus circuit interface to determine the number of the connection devices of the at least one hardware device physically connected to the hardware interface; and The baseboard management controller receives the warning signal from the processor and sends the warning signal to the remote device.
