Debugging method and device of serializer and deserializer, electronic equipment and storage medium

By parsing debugging command information through the empty shell driver of the serial deserializer, the problems of low debugging efficiency and poor stability of the serial deserializer are solved, and an efficient and stable debugging process is achieved.

CN120929356APending Publication Date: 2025-11-11FULSCIENCE AUTOMOTIVE ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510822491.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-19
Publication Date
2025-11-11

AI Technical Summary

Technical Problem

In the existing technology, serial deserializers have low debugging efficiency and poor stability, require frequent recompilation of the driver, and are prone to register configuration errors that cause malfunctions.

Method used

The target device is connected via the empty shell driver corresponding to the serial deserializer. The debugging command information in the configuration file is parsed, and the serial deserializer is debugged based on the debugging command information. It is then switched to the debugging working state and debugged.

Benefits of technology

This improves the debugging efficiency and stability of the serial deserializer, reduces the risk of misconfiguration, and ensures efficient and stable operation during the debugging process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120929356A_ABST
    Figure CN120929356A_ABST
Patent Text Reader

Abstract

The invention provides a debugging method and device for a serial deserializer, electronic equipment and a storage medium, and the debugging method comprises the steps: obtaining a configuration file used for debugging the serial deserializer in response to an external instruction which is received by the serial deserializer and represents the start of debugging, and analyzing the configuration file, determining debugging command information in the configuration file; in response to the fact that the debugging command information is determined, performing debugging configuration on the serial deserializer so as to convert the running state of the serial deserializer into a debugging working state; and in response to the condition that the serial deserializer is in the debugging working state, debugging the serial deserializer based on the debugging command information to obtain a debugging result of the serial deserializer. Through the method, the debugging efficiency of the serial deserializer is improved, and the debugging stability of the serial deserializer is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of serial deserializer technology, and in particular to a debugging method, apparatus, electronic device and storage medium for a serial deserializer. Background Technology

[0002] Currently, debugging of serial deserializers is based on the driver program of the device connected to the serial deserializer. However, the debugging program needs to be recompiled every time it is modified and verified, and then embedded into the board for verification or re-programmed, which reduces the efficiency of debugging the serial deserializer.

[0003] Furthermore, during the debugging process of the serial deserializer, errors are prone to occur when adapting the serial deserializer due to the complexity of the driver. The serial deserializer requires the configuration of too many registers. If a register is misconfigured during debugging, the serial deserializer will malfunction, reducing the stability of debugging the serial deserializer. Summary of the Invention

[0004] In view of this, the purpose of this application is to provide a debugging method, apparatus, electronic device, and storage medium for a serial deserializer. The method involves driving the target device connected to the serial deserializer through a shell driver program, parsing the configuration file used for debugging, determining the debugging command information in the configuration file, and debugging the serial deserializer based on the debugging command information when the serial deserializer is configured to debug. This improves the efficiency and stability of debugging the serial deserializer.

[0005] This application provides a debugging method for a serial deserializer, wherein the serial deserializer includes a serializer and a deserializer; wherein the serializer is connected to a target processor, and the deserializer is connected to a target device corresponding to the target processor; the debugging method includes:

[0006] In response to an external command received by the serial deserializer indicating the start of debugging, a configuration file for debugging the serial deserializer is obtained, and the configuration file is parsed to determine the debugging command information in the configuration file;

[0007] In response to the determination of the debugging command information, the serial deserializer is configured for debugging to change the running state of the serial deserializer to the debugging working state;

[0008] In response to the serial deserializer being in the debugging working state, the serial deserializer is debugged based on the debugging command information to obtain the debugging result of the serial deserializer.

[0009] Furthermore, the debugging method also includes:

[0010] In response to the serial deserializer receiving an update and debug command in terminal mode, the serial deserializer is debugged based on the update and debug command to obtain the update and debug result of the serial deserializer.

[0011] Furthermore, the target device operates normally based on the empty shell driver program corresponding to the serial deserializer; wherein, the empty shell driver program does not debug the serial deserializer.

[0012] Furthermore, the debugging method also includes:

[0013] In response to the debugging result indicating that the registers in the serializer have been configured, the running driver corresponding to the target device is obtained based on the empty shell driver and the debugging command information.

[0014] Furthermore, the serializer and the deserializer are connected at least via an I2C bus and a GPIO interface;

[0015] The process of debugging the serial deserializer based on the debugging command information to obtain the debugging result of the serial deserializer includes:

[0016] Based on the GPIO control command information in the debugging command information, the GPIO interface is controlled and debugged to obtain the first debugging result of the GPIO interface.

[0017] Based on the I2C control command information in the debugging command information, the I2C bus is controlled and debugged to obtain the second debugging result of the I2C bus.

[0018] Based on the debugging command information in the debugging command information, the registers in the serial deserializer and the connection status of the serial deserializer are debugged respectively to obtain the third debugging result of the serial deserializer.

[0019] Furthermore, the step of controlling and debugging the GPIO interface based on the GPIO control command information in the debugging command information to obtain the first debugging result of the GPIO interface includes:

[0020] Execute the GPIO control debugging program corresponding to the GPIO control command information to export the pins of the GPIO interface and set the input or output direction of the pins;

[0021] In response to the setting of the input direction or the output direction of the pin, read debugging or write debugging is performed on the pin to obtain the first debugging result of the GPIO interface;

[0022] In response to obtaining the first debugging result, the pin of the GPIO interface is unexported to complete the control and debugging of the GPIO interface.

[0023] Furthermore, the step of controlling and debugging the I2C bus based on the I2C control command information in the debugging command information to obtain a second debugging result of the I2C bus includes:

[0024] Execute the I2C control debugging program corresponding to the I2C control command information to open the device file of the I2C bus and configure the communication address of the I2C bus;

[0025] Based on the communication address, the I2C bus is read and debugged or written and debugged to obtain the second debugging result of the I2C bus;

[0026] In response to obtaining the second debugging result, the device file of the I2C bus is closed to complete the control and debugging of the I2C bus.

[0027] This application embodiment also provides a debugging device for a serial deserializer, the debugging device comprising:

[0028] The file parsing module is used to respond to an external command received by the serial deserializer indicating the start of debugging, obtain the configuration file for debugging the serial deserializer, parse the configuration file, and determine the debugging command information in the configuration file.

[0029] The debugging configuration module is used to configure the serial deserializer in response to the determination of the debugging command information, so as to change the running state of the serial deserializer to the debugging working state.

[0030] The debugging control module is used to debug the serial deserializer based on the debugging command information in response to the serial deserializer being in the debugging working state, and to obtain the debugging result of the serial deserializer.

[0031] Furthermore, the debugging device also includes a debugging update module, which is used for:

[0032] In response to the serial deserializer receiving an update and debug command in terminal mode, the serial deserializer is debugged based on the update and debug command to obtain the update and debug result of the serial deserializer.

[0033] Furthermore, the debugging device also includes a driver generation module, which is used for:

[0034] In response to the debugging result indicating that the registers in the serializer have been configured, the running driver corresponding to the target device is obtained based on the empty shell driver and the debugging command information.

[0035] Furthermore, when the debugging control module debugs the serial deserializer based on the debugging command information to obtain the debugging result of the serial deserializer, the debugging control module is used to:

[0036] Based on the GPIO control command information in the debugging command information, the GPIO interface is controlled and debugged to obtain the first debugging result of the GPIO interface.

[0037] Based on the I2C control command information in the debugging command information, the I2C bus is controlled and debugged to obtain the second debugging result of the I2C bus.

[0038] Based on the debugging command information in the debugging command information, the registers in the serial deserializer and the connection status of the serial deserializer are debugged respectively to obtain the third debugging result of the serial deserializer.

[0039] Furthermore, when the debugging control module controls and debugs the GPIO interface based on the GPIO control command information in the debugging command information to obtain the first debugging result of the GPIO interface, the debugging control module is used to:

[0040] Execute the GPIO control debugging program corresponding to the GPIO control command information to export the pins of the GPIO interface and set the input or output direction of the pins;

[0041] In response to the setting of the input direction or the output direction of the pin, read debugging or write debugging is performed on the pin to obtain the first debugging result of the GPIO interface;

[0042] In response to obtaining the first debugging result, the pin of the GPIO interface is unexported to complete the control and debugging of the GPIO interface.

[0043] Furthermore, when the debugging control module controls and debugs the I2C bus based on the I2C control command information in the debugging command information to obtain a second debugging result of the I2C bus, the debugging control module is used to:

[0044] Execute the I2C control debugging program corresponding to the I2C control command information to open the device file of the I2C bus and configure the communication address of the I2C bus;

[0045] Based on the communication address, the I2C bus is read and debugged or written and debugged to obtain the second debugging result of the I2C bus;

[0046] In response to obtaining the second debugging result, the device file of the I2C bus is closed to complete the control and debugging of the I2C bus.

[0047] This application also provides an electronic device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, the steps of the debugging method for the serializer described above are performed.

[0048] This application also provides a computer-readable storage medium storing a computer program, which, when run by a processor, executes the steps of the debugging method for a serializer described above.

[0049] This application provides a debugging method, apparatus, electronic device, and storage medium for a serial deserializer. The serial deserializer includes a serializer and a deserializer. The serializer is connected to a target processor, and the deserializer is connected to a target device corresponding to the target processor. The debugging method includes: in response to an external instruction received by the serial deserializer indicating the start of debugging, obtaining a configuration file for debugging the serial deserializer and parsing the configuration file to determine debugging command information in the configuration file; in response to the determination of the debugging command information, configuring the serial deserializer for debugging to change the running state of the serial deserializer to a debugging working state; and in response to the serial deserializer being in the debugging working state, debugging the serial deserializer based on the debugging command information to obtain the debugging result of the serial deserializer.

[0050] Compared with existing methods that rely on drivers for debugging devices connected to the serial deserializer, this method uses a shell driver corresponding to the serial deserializer to drive the target device to operate normally. It then parses the configuration file used for debugging, determines the debugging command information in the configuration file, and debugs the serial deserializer based on the debugging command information when the serial deserializer is configured to debug. This improves the efficiency and stability of debugging the serial deserializer.

[0051] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0052] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0053] Figure 1 This is a schematic diagram of the structure of a serial deserializer provided in an embodiment of this application;

[0054] Figure 2 This is one of the flowcharts for a debugging method of a serial deserializer provided in an embodiment of this application;

[0055] Figure 3 A second flowchart illustrating a debugging method for a serial deserializer provided in this application embodiment;

[0056] Figure 4 This is one of the structural schematic diagrams of a debugging device for a serial deserializer provided in an embodiment of this application;

[0057] Figure 5 This is a second schematic diagram of the structure of a debugging device for a serial deserializer provided in an embodiment of this application;

[0058] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0059] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. Based on the embodiments of this application, every other embodiment obtained by those skilled in the art without inventive effort falls within the scope of protection of this application.

[0060] Research has revealed that current debugging of serial deserializers is based on the driver program of the device connected to the serial deserializer. In this case, the debugging program needs to be recompiled every time it is modified and verified, and then embedded into the board for verification or re-programmed, which reduces the efficiency of debugging the serial deserializer.

[0061] Here, debugging the serial deserializer using the driver of the device connected to the serial deserializer requires modification in different locations, which can lead to a scattered functional modification module and may cause system abnormalities or crashes during driver installation and uninstallation.

[0062] Furthermore, during the debugging process of the serial deserializer, errors are prone to occur when adapting the driver due to its complexity. The serial deserializer requires the configuration of numerous registers, and if a single register is misconfigured during debugging, the serial deserializer will malfunction. In the early stages of the serial deserializer driver development, a single misconfigured register can cause the system to malfunction, and most of the driver development work is focused on register configuration, which reduces the stability of debugging the serial deserializer.

[0063] Based on this, this application provides a debugging method for a serial deserializer. The target device connected to the serial deserializer is driven to run normally by the empty shell driver corresponding to the serial deserializer. The configuration file used for debugging is parsed to determine the debugging command information in the configuration file. When the serial deserializer is configured to debug and enter the debugging working state, the serial deserializer is debugged based on the debugging command information to obtain the debugging result of the serial deserializer. This improves the efficiency of debugging the serial deserializer and thus improves the stability of debugging the serial deserializer.

[0064] Please see Figure 1 , Figure 1 This is a schematic diagram of the structure of a serial deserializer provided in an embodiment of this application. Figure 1 As shown, the serial deserializer 10 includes a serializer 110 and a deserializer 120; wherein, the serializer 110 is connected to the target processor 20, and the deserializer 120 is connected to the target device 30 corresponding to the target processor 20.

[0065] Furthermore, the target processor 20 provides the serializer 110 with raw parallel data signals (e.g., clock CLK+ / - and data channels D0+ / - and D1+ / -), and sends the data to the serializer 110 in the form of differential signal pairs; the serializer 110 converts the parallel data into a high-speed serial data stream, transmits the data through differential line pairs (DOUT0+ / - and DOUT1+ / -), and uses transformer coupling to reduce electromagnetic interference (EMI) to enhance signal integrity, and sends the data to the deserializer 120; the deserializer 120 restores the received serial data stream to a parallel data format, generates a clock and data channels (CLK+ / -, D0+ / -, and D1+ / -) consistent with the original signals of the target processor 20, and sends them to the target device 30; the target device 30 drives operation or performs subsequent processing based on the received data.

[0066] The serializer 110 supports two independent channels, including an I2C bus pin (for configuration) and a GPIO (General Purpose Input / Output) interface pin; the deserializer 120 includes an I2C bus pin (for configuration) and a GPIO (General Purpose Input / Output) interface pin.

[0067] Here, the serializer is responsible for converting parallel data into serial data. In many applications, data is initially in parallel form, that is, multiple bits are transmitted simultaneously through multiple lines. However, parallel transmission encounters some problems at high speeds and long distances, such as signal interference and wiring complexity. The serializer can convert these parallel data streams into a continuous bit stream, so that data can be transmitted through a single path or fewer paths.

[0068] Furthermore, unlike serializers, deserializers convert received serial data back into parallel format. Once the serial data stream reaches its destination, the deserializer needs to be converted back to the original parallel data format so that the receiving device can process the information correctly.

[0069] Please see Figure 2 , Figure 2 This is one of the flowcharts illustrating a debugging method for a serial deserializer provided in an embodiment of this application. Figure 2 As shown in the embodiments of this application, the debugging method for the serial deserializer includes:

[0070] S101. In response to an external instruction received by the serial deserializer indicating the start of debugging, obtain the configuration file for debugging the serial deserializer, parse the configuration file, and determine the debugging command information in the configuration file.

[0071] In this step, in specific implementation, firstly, the serial deserializer receives an external instruction indicating the start of debugging; then, in response to receiving the external instruction, it obtains the configuration file used to debug the serial deserializer; finally, it parses the configuration file to determine the debugging command information in the configuration file.

[0072] In this embodiment of the application, the configuration file includes, but is not limited to, pin control, register configuration, connection status detection, and register cyclic reading corresponding to the serializer and deserializer.

[0073] The debugging command information in the configuration file includes, but is not limited to, log storage, GPIO control command information, I2C control command information, re-acquiring the configuration file, sleep control, loop commands, and terminal mode instructions.

[0074] S102. In response to the determination of the debugging command information, the serial deserializer is configured for debugging to change the running state of the serial deserializer to the debugging working state.

[0075] In this embodiment of the application, the serializer and the deserializer are connected at least through an I2C bus and a GPIO interface.

[0076] In this step, during implementation, firstly, when the parsed debugging command information is determined, the GPIO interface is initialized for input / output; then, the I2C bus is opened; next, the process, signal, and file information of the serial deserializer are debugged; finally, the running state of the serial deserializer is changed to the debugging working state, and then debugging is performed while the serial deserializer is in the debugging working state.

[0077] S103. In response to the serial deserializer being in the debugging working state, the serial deserializer is debugged based on the debugging command information to obtain the debugging result of the serial deserializer.

[0078] In this embodiment of the application, the target device operates normally based on the empty shell driver corresponding to the serial deserializer; wherein, the empty shell driver does not debug the serial deserializer.

[0079] For example, assuming the target device is an LVDS display screen, the LVDS signal output drives the display screen to display. The empty driver program corresponding to the serial deserializer does not implement the specific functions of the display screen. The role of the empty driver program is to make the graphics card driver of the LVDS display screen work normally, so that the entire link can work normally and output video display signals. In fact, the empty driver program does not participate in any serial deserializer configuration work. That is, all debugging work is performed by the debugging method described in the embodiments of this application to quickly read the configuration and perform rapid verification.

[0080] Here, the WHILE command in the debugging command information is used for loop execution. "end" means end. The loop command is mainly used to periodically read the register status. When a loop command is encountered, a thread is created without affecting the execution of subsequent commands.

[0081] In one embodiment of this application, step S103 may include:

[0082] S1031. Based on the GPIO control command information in the debugging command information, control and debug the GPIO interface to obtain the first debugging result of the GPIO interface.

[0083] In this embodiment of the application, when controlling the GPIO interface in the application layer of the operating system, it is achieved by accessing the GPIO directory in the system. There is no need to write a kernel module, and the GPIO interface can be controlled directly through the file system interface.

[0084] In one embodiment of this application, step S1031 may include:

[0085] S10311. Execute the GPIO control debugging program corresponding to the GPIO control command information to export the pins of the GPIO interface and set the input or output direction of the pins.

[0086] In this step, the GPIO control debugging program corresponding to the GPIO control command information is executed to debug the GPIO interface. First, the pins of the GPIO interface are exported using the "echo" command; then, the input or output direction of the GPIO pins is set using the "echo" command.

[0087] For example, you can export the pins of the GPIO interface using "export_gpio(gpio_pin)"; and set the output direction of the pins of the GPIO interface using "set_gpio_direction(gpio_pin,"out")".

[0088] S10312. In response to the setting of the input direction or the output direction of the pin, read debugging or write debugging is performed on the pin to obtain the first debugging result of the GPIO interface.

[0089] In this step, after the input or output direction of the pin is set, the "cat" or "echo" command is used to read or write to the pin of the GPIO interface to read and debug or write to debug the pin and obtain the first debugging result of the GPIO interface.

[0090] For example, you can set the pin of the GPIO interface as an input and perform read debugging by using "set_gpio_direction(gpio_pin,"in"); int value=read_gpio(gpio_pin); printf("GPIO%d value is%d\n",gpio_pin,value);".

[0091] S10313. In response to obtaining the first debugging result, cancel exporting the pin of the GPIO interface to complete the control debugging of the GPIO interface.

[0092] In this step, after obtaining the first debugging result, the pins of the GPIO interface are canceled by using the "echo" command.

[0093] For example, you can unexport the pins of the GPIO interface by using "unexport_gpio(gpio_pin)".

[0094] S1032. Based on the I2C control command information in the debugging command information, control and debug the I2C bus to obtain the second debugging result of the I2C bus.

[0095] In this embodiment of the application, when controlling the GPIO interface in the application layer of the operating system, it is achieved by accessing the I2C device file directory in the system. The I2C driver provides an I2C interface for accessing the I2C bus, and the application communicates through the I2C interface.

[0096] In one embodiment of this application, step S1032 may include:

[0097] S10321. Execute the I2C control debugging program corresponding to the I2C control command information to open the device file of the I2C bus and configure the communication address of the I2C bus.

[0098] For example, in a Linux system, the I2C device file is usually located in " / dev / i2c-X", where "X" is the I2C bus number. For example, " / dev / i2c-1" corresponds to I2C bus 1.

[0099] Furthermore, the communication address of the I2C bus is configured through the DEVAD address command. The range of the DEVAD address command is the intermediate execution range from the next DEVAD command, and it is mainly used to configure the dynamic address when the deserializer is configured.

[0100] In the I2C bus, devices include address identifiers, and the device address needs to be sent to the I2C bus for communication.

[0101] S10322. Based on the communication address, perform read debugging or write debugging on the I2C bus to obtain the second debugging result of the I2C bus.

[0102] In this step, the "ioctl()" command is used to set the device address, and the "read()" or "write()" command system is used to read or write data for debugging.

[0103] The WRITE command is used for writing to the I2C bus for debugging. Its format is "write reg val", and it also includes the length of the register address and the register length. The READ command is used for reading to the I2C bus for debugging. Its format is "read reg", and it also includes the length of the register address and the register length.

[0104] The WRITEARR command is used for debugging array writes on the I2C bus. It can write the values ​​of multiple registers and ends with the "end" command. The command format is "WRITEARR reg val...end", which also includes the length of the register address and the register length. The READARR command is used for debugging array reads on the I2C bus. It can read the values ​​of multiple registers and ends with the "end" command. The command format is "READARR reg val...end", which also includes the length of the register address and the register length.

[0105] S10323. In response to obtaining the second debugging result, close the device file of the I2C bus to complete the control and debugging of the I2C bus.

[0106] In this step, after obtaining the second debugging result, the device file of the I2C bus is closed to complete the control and debugging of the I2C bus.

[0107] S1033. Based on the debugging command information in the debugging command information, debug the registers in the serial deserializer and the connection status of the serial deserializer respectively, and obtain the third debugging result of the serial deserializer.

[0108] In this step, after completing the control debugging of the GPIO interface and I2C bus, the registers in the serial deserializer are debugged, and the connection status between the serial deserializer and the target device and the target processor is debugged to obtain the third debugging result of the serial deserializer.

[0109] Optional, please refer to Figure 3 , Figure 3 This is a second flowchart illustrating a debugging method for a serial deserializer provided in an embodiment of this application. Figure 3 As shown, in addition to the debugging method of the serial deserializer described in steps S101 to S103, the embodiments of this application also include steps S104 and S105. Specifically, step S104 is used to describe the debugging method when the deserializer receives update debugging command information in terminal mode, and step S105 is used to describe the method of obtaining the running driver corresponding to the target device when the debugging result indicates that the register in the serial deserializer has been configured, so as to improve the flexibility and applicability of configuring the serial deserializer.

[0110] S104. In response to the serial deserializer receiving update debugging command information in terminal mode, the serial deserializer is debugged based on the update debugging command information to obtain the update debugging result of the serial deserializer.

[0111] In this embodiment, a preset thread is used to detect the modification status of the configuration file, and based on the modification status of the configuration file, it is determined whether to re-execute the debugging command information to enable terminal mode for separate debugging command input and execution.

[0112] In this step, when the serial deserializer receives an update debugging command in terminal mode, it executes the debugging program corresponding to the update debugging command to debug the serial deserializer and obtain the update debugging result of the serial deserializer.

[0113] For example, the RESET command can be used to re-execute the reading of the configuration file; the TERMINAL command can be used to control the serial deserializer to enter terminal mode and execute in the foreground, and receive update debugging command information.

[0114] S105. In response to the debugging result indicating that the registers in the serial deserializer have been configured, the running driver corresponding to the target device is obtained based on the empty shell driver and the debugging command information.

[0115] In this step, when the debugging results indicate that the registers in the serial deserializer have been configured and the registers have been verified to meet the debugging requirements, the debugging command information is placed in the preset position in the shell driver to obtain the running driver corresponding to the target device.

[0116] The serial deserializer debugging method provided in this application embodiment drives the target device connected to the serial deserializer to run normally through the shell driver corresponding to the serial deserializer. It parses the configuration file used for debugging, determines the debugging command information in the configuration file, and debugs the serial deserializer based on the debugging command information when the serial deserializer is configured to debug working state, thereby obtaining the debugging result of the serial deserializer. This improves the efficiency of debugging the serial deserializer and thus improves the stability of debugging the serial deserializer.

[0117] Please see Figure 4 , Figure 5 , Figure 4 This is one of the structural schematic diagrams of a debugging device for a serial deserializer provided in an embodiment of this application. Figure 5 This is a second schematic diagram of the structure of a debugging device for a serial deserializer provided in an embodiment of this application. Figure 4 As shown, the debugging device 400 includes:

[0118] The file parsing module 410 is used to respond to an external instruction received by the serial deserializer indicating the start of debugging, obtain a configuration file for debugging the serial deserializer, parse the configuration file, and determine the debugging command information in the configuration file.

[0119] The debugging configuration module 420 is used to configure the serial deserializer in response to the determination of the debugging command information, so as to change the running state of the serial deserializer to the debugging working state.

[0120] The debugging control module 430 is used to debug the serial deserializer based on the debugging command information in response to the serial deserializer being in the debugging working state, and to obtain the debugging result of the serial deserializer.

[0121] Furthermore, such as Figure 5 As shown, the debugging device 400 further includes a debugging update module 440, which is used for:

[0122] In response to the serial deserializer receiving an update and debug command in terminal mode, the serial deserializer is debugged based on the update and debug command to obtain the update and debug result of the serial deserializer.

[0123] Furthermore, such as Figure 5 As shown, the debugging device 400 further includes a driver generation module 450, which is used for:

[0124] In response to the debugging result indicating that the registers in the serializer have been configured, the running driver corresponding to the target device is obtained based on the empty shell driver and the debugging command information.

[0125] Furthermore, when the debugging control module 430 debugs the serial deserializer based on the debugging command information to obtain the debugging result of the serial deserializer, the debugging control module 430 is used to:

[0126] Based on the GPIO control command information in the debugging command information, the GPIO interface is controlled and debugged to obtain the first debugging result of the GPIO interface.

[0127] Based on the I2C control command information in the debugging command information, the I2C bus is controlled and debugged to obtain the second debugging result of the I2C bus.

[0128] Based on the debugging command information in the debugging command information, the registers in the serial deserializer and the connection status of the serial deserializer are debugged respectively to obtain the third debugging result of the serial deserializer.

[0129] Furthermore, when the debugging control module 430 controls and debugs the GPIO interface based on the GPIO control command information in the debugging command information to obtain the first debugging result of the GPIO interface, the debugging control module 430 is used to:

[0130] Execute the GPIO control debugging program corresponding to the GPIO control command information to export the pins of the GPIO interface and set the input or output direction of the pins;

[0131] In response to the setting of the input direction or the output direction of the pin, read debugging or write debugging is performed on the pin to obtain the first debugging result of the GPIO interface;

[0132] In response to obtaining the first debugging result, the pin of the GPIO interface is unexported to complete the control and debugging of the GPIO interface.

[0133] Furthermore, when the debugging control module 430 controls and debugs the I2C bus based on the I2C control command information in the debugging command information to obtain a second debugging result of the I2C bus, the debugging control module 430 is used to:

[0134] Execute the I2C control debugging program corresponding to the I2C control command information to open the device file of the I2C bus and configure the communication address of the I2C bus;

[0135] Based on the communication address, the I2C bus is read and debugged or written and debugged to obtain the second debugging result of the I2C bus;

[0136] In response to obtaining the second debugging result, the device file of the I2C bus is closed to complete the control and debugging of the I2C bus.

[0137] The serial deserializer debugging device provided in this application embodiment drives the target device connected to the serial deserializer to operate normally through the shell driver corresponding to the serial deserializer. It parses the configuration file used for debugging, determines the debugging command information in the configuration file, and debugs the serial deserializer based on the debugging command information when the serial deserializer is configured to debug. This improves the efficiency of debugging the serial deserializer and thus improves the stability of debugging the serial deserializer.

[0138] Please see Figure 6 , Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 6As shown, the electronic device 600 includes a processor 610, a memory 620, and a bus 630.

[0139] The memory 620 stores machine-readable instructions executable by the processor 610. When the electronic device 600 is running, the processor 610 and the memory 620 communicate via the bus 630. When the machine-readable instructions are executed by the processor 610, they can perform the operations described above. Figure 2 as well as Figure 3 The steps of the debugging method for the serial deserializer in the method embodiment shown are described in detail in the method embodiment, and will not be repeated here.

[0140] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can perform the above-described actions. Figure 2 as well as Figure 3 The steps of the debugging method for the serial deserializer in the method embodiment shown are described in detail in the method embodiment, and will not be repeated here.

[0141] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0142] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the shown or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.

[0143] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0144] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0145] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0146] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The scope of protection of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A debugging method for a serial deserializer, characterized in that, The serial deserializer includes a serializer and a deserializer; wherein the serializer is connected to the target processor, and the deserializer is connected to the target device corresponding to the target processor; the debugging method includes: In response to an external command received by the serial deserializer indicating the start of debugging, a configuration file for debugging the serial deserializer is obtained, and the configuration file is parsed to determine the debugging command information in the configuration file; In response to the determination of the debugging command information, the serial deserializer is configured for debugging to change the running state of the serial deserializer to the debugging working state; In response to the serial deserializer being in the debugging working state, the serial deserializer is debugged based on the debugging command information to obtain the debugging result of the serial deserializer.

2. The method according to claim 1, characterized in that, The debugging method also includes: In response to the serial deserializer receiving an update and debug command in terminal mode, the serial deserializer is debugged based on the update and debug command to obtain the update and debug result of the serial deserializer.

3. The method according to claim 1, characterized in that, The target device operates normally based on the empty shell driver corresponding to the serial deserializer; wherein, the empty shell driver does not debug the serial deserializer.

4. The method according to claim 3, characterized in that, The debugging method also includes: In response to the debugging result indicating that the registers in the serializer have been configured, the running driver corresponding to the target device is obtained based on the empty shell driver and the debugging command information.

5. The method according to claim 1, characterized in that, The serializer and the deserializer are connected at least via an I2C bus and a GPIO interface; The process of debugging the serial deserializer based on the debugging command information to obtain the debugging result of the serial deserializer includes: Based on the GPIO control command information in the debugging command information, the GPIO interface is controlled and debugged to obtain the first debugging result of the GPIO interface. Based on the I2C control command information in the debugging command information, the I2C bus is controlled and debugged to obtain the second debugging result of the I2C bus. Based on the debugging command information in the debugging command information, the registers in the serial deserializer and the connection status of the serial deserializer are debugged respectively to obtain the third debugging result of the serial deserializer.

6. The method according to claim 5, characterized in that, The step of controlling and debugging the GPIO interface based on the GPIO control command information in the debugging command information to obtain the first debugging result of the GPIO interface includes: Execute the GPIO control debugging program corresponding to the GPIO control command information to export the pins of the GPIO interface and set the input or output direction of the pins; In response to the setting of the input direction or the output direction of the pin, read debugging or write debugging is performed on the pin to obtain the first debugging result of the GPIO interface; In response to obtaining the first debugging result, the pin of the GPIO interface is unexported to complete the control and debugging of the GPIO interface.

7. The method according to claim 5, characterized in that, The step of controlling and debugging the I2C bus based on the I2C control command information in the debugging command information to obtain a second debugging result of the I2C bus includes: Execute the I2C control debugging program corresponding to the I2C control command information to open the device file of the I2C bus and configure the communication address of the I2C bus; Based on the communication address, the I2C bus is read and debugged or written and debugged to obtain the second debugging result of the I2C bus; In response to obtaining the second debugging result, the device file of the I2C bus is closed to complete the control and debugging of the I2C bus.

8. A debugging device for a serial deserializer, characterized in that, The debugging device includes: The file parsing module is used to respond to an external command received by the serial deserializer indicating the start of debugging, obtain the configuration file for debugging the serial deserializer, parse the configuration file, and determine the debugging command information in the configuration file. The debugging configuration module is used to configure the serial deserializer in response to the determination of the debugging command information, so as to change the running state of the serial deserializer to the debugging working state. The debugging control module is used to debug the serial deserializer based on the debugging command information in response to the serial deserializer being in the debugging working state, and to obtain the debugging result of the serial deserializer.

9. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. The machine-readable instructions are executed by the processor to perform the steps of the debugging method for a serializer as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the debugging method for a serializer as described in any one of claims 1 to 7.