Debugging method and hardware structure for multiplexing IRIG B function ports
By reusing the IRIGB function port and LED display device, the problem of needing to disassemble the machine for BIOS loading and debugging is solved, realizing online real-time detection and debugging, which is suitable for system debugging on-site by users.
Patent Information
- Application Number
- CN202411876441.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2044-12-18
AI Technical Summary
In existing technologies, CPU-based systems require disassembly and connection to JTAG or debugging interfaces when loading and debugging in the BIOS, making it impossible to perform effective debugging on the user panel. This results in a loss of opportunities to reproduce the problem and makes it impossible for users to effectively locate the problem on-site.
The IRIGB function port is reused. Debugging commands are received through the IRIGB interface to enter the debugging mode, and debugging data is obtained and displayed through the LED display device. Debugging without disassembly is achieved using IRIGB and LED.
It enables online real-time detection and debugging when the system fails to start normally, facilitating problem localization, avoiding disassembly operations, and is suitable for users' on-site debugging needs.
Smart Images

Figure CN121070760B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a debugging method and hardware structure for multiplexing IRIGB function ports. Background Technology
[0002] Currently, there are generally two debugging methods for processor-based systems (including CPUs, microcontrollers, and SoCs): one is the JTAG interface, and the other is debugging serial ports or other general or dedicated interfaces such as Ethernet ports. JTAG (Joint Test Action Group) is an international standard testing protocol (IEEE 1149.1 compliant), primarily used for internal chip testing. Most advanced devices now support the JTAG protocol, such as ARM, DSP, and FPGA devices. A standard JTAG interface has four lines: TMS, TCK, TDI, and TDO, representing mode selection, clock, data input, and data output, respectively. This is a low-level debugging method that can debug any processor problem. The second method, such as using a serial port, typically uses predefined parameters, such as a baud rate of 115200, 8 data bits, 1 stop bit, and no parity. The program directly prints output to or receives data from this serial port to complete system debugging.
[0003] In existing technologies, for CPU (Central Processing Unit) based systems, power-on operation involves three main processes: BIOS (Basic Input Output System) loading and running, Boot Loader loading and running, and finally OS (Operating System) loading and running. The latter two, after BIOS startup, already possess reliable device functionality and can be debugged via software. However, BIOS loading and debugging can only be accomplished through the CPU's JTAG (Joint Test Action Group) and debugging interface. JTAG and debugging interfaces are typically not present on the user panel of mass-produced products. If a problem occurs, the system must be disassembled, and the corresponding device connected to the debugging port to restart debugging. For some occasional problems, this debugging process misses the opportunity to reproduce the problem, thus prolonging the actual troubleshooting process. Furthermore, in some user sites where disassembly and installation of debugging equipment is not possible, it becomes impossible to effectively locate the problem. Summary of the Invention
[0004] In view of this, this application proposes a debugging method for reusing the IRIGB function port to solve the problems reflected in the background art.
[0005] This application provides a debugging method for reusing an IRIGB function port, characterized in that the machine under test has an IRIGB function port and an LED display device, and the debugging method includes:
[0006] After receiving the debugging command, the debugging device enters the debugging mode and obtains the preset debugging data.
[0007] Based on the debugging data, debugging information is output and displayed through the LED display device.
[0008] Optionally, the debugging method for the multiplexed IRIGB function port is characterized by further comprising:
[0009] After receiving the information, the IRIGB function port of the machine under test determines whether the received information is a debugging command.
[0010] When the IRIGB function port of the device under test receives a debugging command, the device under test enters the debugging mode and acquires the preset debugging data.
[0011] When the IRIGB function port of the machine under test does not receive a debugging command, the machine under test enters normal operation mode.
[0012] Optionally, the display via the LED display device includes:
[0013] Based on the debugging data, control the LED display device to turn on / off, flash, and maintain its duration;
[0014] The LED display device displays debugging data LEDs for debugging personnel to interpret. Optionally, the IRIGB function port includes:
[0015] The physical interface of the IRIGB is RS485, which is directly connected to the serial port function module.
[0016] The IRIGB can only receive data in one direction and cannot transmit data in two directions.
[0017] Optionally, the debug data LED includes:
[0018] The LED display device flashes 8 times in 4 seconds to display the first debugging data. If the first data is high, it remains on for 2 seconds; otherwise, it remains off for 2 seconds.
[0019] To display the next debugging data, the LED display device flashes 4 times every 2 seconds. If the first data is high, it remains on for 2 seconds; otherwise, it remains off for 2 seconds.
[0020] Optionally, the debugging instructions include:
[0021] To prevent errors in receiving debugging commands, each debugging command is designed to be 5 bytes long.
[0022] Optionally, the debugging method for the multiplexed IRIGB function port is characterized by further comprising:
[0023] After the LED display device finishes displaying the debugging data, the debugging machine sends a stop debugging command via IRIGB, and the device returns to normal working mode.
[0024] This application also provides a hardware structure for reusing IRIGB function ports, characterized in that it includes a serial port and an LED. The serial port configuration is a preset configuration of the debug serial port of the debugged machine. The debugged machine's IRIGB can be accessed through the serial port to send debug commands. The serial port is started using the method described in any one of claims 1-7.
[0025] Optionally, the hardware structure for the multiplexed IRIGB function port is characterized in that the LED is a semiconductor device capable of directly converting electrical energy into light energy, and the LED is activated using the method described in any one of claims 1-7.
[0026] This application also provides an electronic device, characterized in that it includes:
[0027] CPU:
[0028] A central processing unit (CPU) is the core of a computer system for computation and control; it is the final execution unit for information processing and program execution.
[0029] The CPU is configured to start the method according to any one of claims 1-7 when executing the executable instructions.
[0030] The beneficial effects of this application are: when the system fails to start normally, the system status can be detected online in real time, which facilitates debugging and problem location. Attached Figure Description
[0031] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the accompanying drawings required in the description of the embodiments or the prior art are briefly introduced below. Obviously, the accompanying drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0032] Figure 1 This application discloses a flowchart of a debugging method for reusing IRIGB function ports.
[0033] Figure 2 This application discloses a specific debug output flowchart;
[0034] Figure 3 This application discloses a specific example diagram of an AMI BIOS POST CODE.
[0035] Figure 4 This application discloses a specific flowchart for displaying LED debugging data. Detailed Implementation
[0036] Various exemplary embodiments, features, and aspects of this application will now be described in detail with reference to the accompanying drawings. The same reference numerals in the drawings denote elements that have the same or similar functions. Although various aspects of the embodiments are shown in the drawings, they are not necessarily drawn to scale unless specifically indicated otherwise.
[0037] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0038] The term “exemplary” as used herein means “serving as an example, embodiment, or illustration.” Any embodiment illustrated herein as “exemplary” is not necessarily to be construed as superior to or better than other embodiments.
[0039] Furthermore, to better illustrate this application, numerous specific details are provided in the following detailed embodiments. Those skilled in the art should understand that this application can be implemented without certain specific details. In some instances, methods, means, components, and circuits well-known to those skilled in the art have not been described in detail in order to highlight the main points of this application.
[0040] The BIOS (Basic Input / Output System) is the firmware program that runs first when a computer starts up. It is responsible for initializing hardware devices and booting the operating system. It is stored in EPROM or Flash ROM on the motherboard and does not require power supply. The main function of the BIOS is to provide the lowest-level and most direct hardware control for the computer, including self-test (POST), system setup, and operating system booting. The functions and roles of the BIOS include: POST: The BIOS contains a self-diagnostic program that reads the contents of CMOS RAM to identify hardware configuration and performs self-tests and initialization; System setup: During the boot process, users can use a special hotkey to launch the CMOS setup program, make settings, and store them in CMOS RAM; Operating system booting: The BIOS is responsible for loading the operating system and providing it with necessary system parameters.
[0041] In embedded operating systems, the bootloader runs before the operating system kernel. It initializes hardware devices and establishes a memory space mapping, bringing the system's hardware and software environment to a suitable state to prepare for the final call to the operating system kernel. Embedded systems typically lack firmware programs like the BIOS (note that some embedded CPUs may have a short embedded bootloader), so the entire system loading and boot process is handled entirely by the bootloader. In an embedded system based on the ARM7TDMI core, execution usually begins at address 0x00000000 upon power-on or reset, and the bootloader program is typically located at this address.
[0042] An operating system (OS) is a type of system software responsible for managing and controlling a computer's hardware and software resources, providing a user interface and resource management functions. The operating system is the interface between humans and computers and a core component of a computer system. An operating system (OS) is a built-in program that works with various computer hardware components to interact with the user. Its main functions include: resource management, managing computer hardware and software resources such as CPU, memory, and disk space; task scheduling, rationally organizing and allocating computer tasks and resources; and a user interface, providing a user interface so that users can easily use the computer.
[0043] JTAG (Joint Test Action Group) is an international standard testing protocol primarily used for chip testing and debugging. Initially used for chip testing, JTAG defines a TAP (Test Access Port) within the device, allowing dedicated JTAG testing tools to test internal nodes. Today, the JTAG interface is also commonly used to implement ISP (In-System Programmer), programming devices such as FLASH memory. JTAG is mainly used for the following aspects: chip testing, performing electrical characteristic tests on chips to detect problems; debugging, debugging various chips and their peripherals, accessing internal registers, bus devices, and built-in module registers; and in-system programming, implementing ISP functionality to program devices such as FLASH memory online, simplifying the engineering process.
[0044] This application applies to the BIOS loading and execution process during power-on of a CPU-based system, a process that can only be completed through the JTAG and debug interfaces provided by the CPU. JTAG and debug interfaces are typically not located on the user panel of the product and can only be accessed through disassembly and connection. This application provides a solution for debugging via the user interface without disassembling the system.
[0045] like Figure 1 The flowchart shown is a debugging method for reusing an IRIGB function port according to an embodiment of this application. The method includes the following steps:
[0046] S100, in this application, after the debugged machine receives the debug command on its IRIGB function port, the debugged machine enters the debug mode and obtains the preset debug data.
[0047] Specifically, the device under test has an IRIGB (RS485) and an LED. The IRIGB is used as the debugging input, and the LED is used as the debugging output. The debugging machine connects to the IRIGB of the device under test via a RS485 serial port, which is configured with the default settings for the debugging serial port of the device under test. After the connection is complete, the debugging machine will generate debugging commands.
[0048] The physical interface of the IRIGB is RS485, which is a standard serial port interface that can be directly connected to a serial port module. However, the IRIGB can only receive data in one direction and cannot transmit data in two directions.
[0049] Furthermore, the IRIG-B code is a time code standard developed by IRIG, primarily used for time synchronization. It has two types: IRIG-B(DC) code has a synchronization accuracy on the order of tens of nanoseconds, and its interface typically uses TTL and RS422 (V.11) interfaces; while IRIG-B(AC) code generally has a synchronization accuracy between 10ms and 20ms, and its interface uses a balanced interface. IRIG-B code has wide applications in many fields, especially in the power industry, where it is used as the standard time code encoding format for frequency calibration and time synchronization. The network port refers to the interface on a network device, mainly used to connect network devices such as routers and switches. The serial port refers to a serial interface, also known as a serial communication interface or serial communication interface (usually referring to a COM interface), which is an extended interface using serial communication. A serial interface transmits data bit by bit sequentially. Its characteristics include simple communication lines; only one pair of transmission lines is needed to achieve bidirectional communication (telephone lines can be used directly as transmission lines), thus greatly reducing costs. It is particularly suitable for long-distance communication, but the transmission speed is relatively slow.
[0050] Specifically, after the debug serial port receiving module of the machine being debugged receives the command via IRIGB, it judges the command. If the command is confirmed to be a debug command, it enters debug mode and selects the debug data to be output from various debug data according to the debug options. If the command is not a debug command, it enters normal operation mode. In debug mode, the data in IRIGB can be correctly parsed by the debug serial port module.
[0051] The determination of debugging instructions is achieved by comparing the bytes inside the debugging instructions. To prevent the incorrect activation of debugging mode due to the same bytes found in other instructions, the debugging instructions will be designed to be longer, for example, 5 bytes to represent one instruction. This will greatly reduce the possibility of all 5 bytes being incorrect at the same time.
[0052] Furthermore, the debug data here includes, but is not limited to, BIOS debug information, as well as any readable information. In x86 systems, the most important BIOS debug information comes from port 80, commonly known as POST CODE (Power-On Self Test Code). This is the debug code written by the BIOS to port 80 during operation, which can represent different stages and states of BIOS operation.
[0053] like Figure 3 As shown, the AMI BIOS POST CODE includes:
[0054] Status Code:
[0055] 0x00, Not used.
[0056] Progress Code:
[0057] 0x01, Power on. Reset type detection (soft / hard).
[0058] 0x02, AP initialization before microcode loading;
[0059] 0x03, North Bridge initialization before microcode loading;
[0060] 0x04, South Bridge initialization before microcode loading;
[0061] 0x05, OEM initialization before microcode loading;
[0062] 0x06, Microcode loading;
[0063] 0x07, AP initialization after microcode loading;
[0064] 0x08, North Bridge initialization after microcode loading;
[0065] 0x09, South Bridge initialization after microcode loading;
[0066] 0x0A, OEM initialization after microcode loading;
[0067] 0x0B, Cache initialization.
[0068] S200, this application outputs debugging information based on the debugging data and displays it through an LED display device.
[0069] Specifically, the LED display control of the debugged machine displays debug data according to a preset display method, including the LED's on / off state, blinking, and duration. Outputting LED display information means that the debug data LED display information is output to the LEDs on the panel for interpretation by the debugger. After debugging is complete, the debugger sends a stop debugging command via serial port, and the debugged machine returns to normal operating mode.
[0070] like Figure 4 As shown in the diagram, the LED debugging data display flowchart includes the following content. To facilitate the interpretation of LED data, the LED display can be presented in the following ways:
[0071] Step 1: Flash 8 times in 4 seconds to display the first debugging data. If the first data is high, keep it on for 2 seconds; if the first data is low, keep it off for 2 seconds.
[0072] Step 2: Flash 4 times in 2 seconds to display the next bit of debugging data. If the data is high, keep it on for 2 seconds; if the data is low, keep it off for 2 seconds.
[0073] Step 3: Determine if all debug data bits have been displayed. If not, repeat step 2. If all data bits have been displayed, repeat step 1.
[0074] Specifically, after debugging is complete, the debugging machine will send a stop debugging command to the machine being debugged via serial port. Upon receiving the command, the machine being debugged will return to normal operating mode. In normal operating mode, IRIGB data will not be correctly parsed by the debugging serial port module, but this will not affect normal functionality when debugging is not in progress.
[0075] like Figure 2 As shown, the debug output flowchart includes the following:
[0076] The prompts sent by the debugger are transmitted to the IRIGB function module and the debug serial port receiver via the RS485 port of the debugged IRIGB.
[0077] After receiving a debugging command through the debugging serial port, the system enters debugging mode, acquires preset debugging data, and selects the output debugging data.
[0078] After selecting the debugging data, the LED display of the debugging data is generated based on the LED display control of the debugging data;
[0079] The machine being debugged selects to display debug data LEDs, which are then output through an LED display device for interpretation by the debugging personnel.
[0080] The specific implementation process of this application is as follows:
[0081] The existing user functions of the device being debugged include IRIGB (RS485) and LED. IRIGB is used as the debug input, and LED is used as the debug output.
[0082] 1. The debugging machine connects to the IRIGB of the machine being debugged via a 485 serial port. This serial port configuration is the default configuration of the debugging serial port on the machine being debugged.
[0083] 2. The debugging machine sends debugging commands to the machine being debugged via the serial port.
[0084] 3. After receiving the debugging command, the debugging serial port receiving module of the machine being debugged enters the debugging mode and selects the output debugging data from various debugging data according to the debugging options.
[0085] 4. The LED display control of the debugged machine displays the debug data according to the preset display mode, such as on, off, flashing, and the duration of the display.
[0086] 5. The LED on the machine being debugged displays the debug data.
[0087] 6. The LED display output of the machine being debugged outputs the debugging LED display onto the LEDs on the panel for debugging personnel to interpret.
[0088] 7. After debugging is complete, the debugging machine sends a stop debugging command to the machine being debugged via the serial port and returns to normal working mode.
[0089] 8. In normal function mode, IRIGB data cannot be correctly parsed by the debug serial port module.
[0090] To prevent errors in receiving debugging commands, the commands can be designed to be longer. For example, five bytes can represent one command, thus reducing the possibility of all five bytes being incorrect simultaneously to a very low level.
[0091] To facilitate the interpretation of LED data, the following methods can be used.
[0092] The indicator flashes 8 times in 1.4 seconds to display the first debugging data. If the first data is high, it remains lit for 2 seconds; otherwise, it remains off for 2 seconds.
[0093] The indicator flashes 4 times every 2.2 seconds to display the next digit of the debugging data. If the data digit is high, it remains lit for 2 seconds; otherwise, it remains off for 2 seconds.
[0094] 3. Repeat step 2 until all debug data bits are displayed.
[0095] 4. Repeat steps 1-3
[0096] The debug data here includes, but is not limited to, BIOS debug information, as well as any readable information. In x86 systems, the most important BIOS debug information comes from port 80, commonly known as the POST CODE (Power-OnSelf Test Code). This is the debug code written by the BIOS to port 80 during operation, representing different stages and states of BIOS operation. An example of an AMI BIOS POST CODE is shown below. Figure 3 As shown.
[0097] The beneficial effect of this application is that it enables real-time online monitoring of system status when the system fails to start normally, facilitating debugging and problem localization.
[0098] The various embodiments of this application have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or improvement of the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A debugging method for reusing IRIGB function ports, applied to a CPU-based system, during the BIOS loading and running process upon power-on, characterized in that... The device being debugged has an IRIGB function port and an LED display device. The debugging method includes: After receiving the debugging command, the debugging device enters the debugging mode and obtains the preset debugging data. The debugging instructions include: to prevent errors in receiving debugging instructions, each debugging instruction is designed to be 5 bytes long to represent one instruction; Based on the debugging data, debugging information is output and displayed through the LED display device; The above-mentioned display via the LED display device includes: controlling the LED display device to turn on / off, flash, and maintain duration based on debugging data; The LED display device displays debugging data LEDs for debugging personnel to interpret.
2. The debugging method for multiplexing IRIGB function ports as described in claim 1, characterized in that, Also includes: After receiving the information, the IRIGB function port of the machine under test determines whether the received information is a debugging command. When the IRIGB function port of the device under test receives a debugging command, the device under test enters the debugging mode and acquires the preset debugging data. When the IRIGB function port of the machine under test does not receive a debugging command, the machine under test enters normal operation mode.
3. The debugging method for multiplexing IRIGB function ports as described in claim 1, characterized in that, The IRIGB function port includes: The physical interface of the IRIGB is RS485, which is directly connected to the serial port function module. The IRIGB can only receive data in one direction and cannot transmit data in two directions.
4. The debugging method for multiplexing IRIGB function ports as described in claim 1, characterized in that, The debug data LED includes: The LED display device flashes 8 times in 4 seconds to display the first debugging data. If the first data is high, it remains on for 2 seconds; otherwise, it remains off for 2 seconds. To display the next debugging data, the LED display device flashes 4 times every 2 seconds. If the first data is high, it remains on for 2 seconds; otherwise, it remains off for 2 seconds.
5. The debugging method for multiplexing IRIGB function ports as described in claim 1, characterized in that, Also includes: After the LED display device finishes displaying the debugging data, the debugging machine sends a stop debugging command via IRIGB, and the device returns to normal working mode.
6. A hardware structure for multiplexing IRIGB function ports, characterized in that, It includes a serial port and an LED. The serial port configuration is a preset configuration of the debug serial port of the machine being debugged. The machine can be connected to the IRIGB of the machine being debugged through the serial port to send debugging commands. The serial port is started using the method described in any one of claims 1-5.
7. The hardware structure for multiplexing IRIGB function ports according to claim 6, characterized in that, An LED is a semiconductor device that can directly convert electrical energy into light energy, and the LED is activated using the method described in any one of claims 1-5.
8. An electronic device, characterized in that, include: CPU: A central processing unit (CPU) is the core of a computer system for computation and control. It is the final execution unit for information processing and program execution. The CPU is configured to implement the debugging method described in any one of claims 1-5.
Citation Information
Patent Citations
Debugging method, electronic product applying debugging method and debugging card
CN105701011A
Universal JTAG (Joint Test Action Group) debugging method and system with extensible interface
CN114064458A