Data acquisition debugging method and device, equipment and storage medium

By introducing MCU and USB interfaces into the debugging equipment, and utilizing USB enumeration operations and WebUSB transmission, the problem that existing tools cannot directly debug peripheral devices is solved, enabling direct debugging of embedded devices, improving the convenience and versatility of the debugging equipment, and increasing testing efficiency.

CN122064635APending Publication Date: 2026-05-19GUANGZHOU ZHOULIGONG SCM DEV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGZHOU ZHOULIGONG SCM DEV
Filing Date
2026-01-23
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Existing development and debugging tools cannot be directly used to debug peripheral devices. In particular, existing development and debugging tools cannot be directly used to debug data transmission between external devices and the host computer. Existing development tools cannot be directly used to debug devices.

Method used

By introducing MCU and USB interfaces into the debugging equipment, USB enumeration operations are implemented, a stable data transmission channel is built, and communication with the chip under debugging is achieved directly without the need to install drivers or host computer software. It supports interfaces such as IIC and SPI, and transmits data to the host computer via WebUSB and displays it on a webpage, simplifying the debugging process.

Benefits of technology

It enables direct debugging of embedded devices without an embedded processor, improving the convenience and versatility of debugging devices, simplifying the debugging work of development and testing personnel, and increasing testing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122064635A_ABST
    Figure CN122064635A_ABST
Patent Text Reader

Abstract

The invention provides a data acquisition debugging method and device, equipment and a storage medium, relates to the technical field of embedded development, solves the problem that a development debugging tool is difficult to be directly used for debugging a peripheral device in related technologies, can directly debug embedded equipment without a processor of the embedded equipment, and improves the debugging efficiency of the embedded equipment. According to the invention, the test data is effectively sent and received, the convenience and universality of the debugging equipment are improved, convenience is provided for the debugging work of development testers, and the test efficiency is favorably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of embedded development technology, and in particular to a data acquisition and debugging method, apparatus, device and storage medium. Background Technology

[0002] In the embedded systems field, the choice of development and debugging tools is crucial for improving development efficiency. Commonly used tools in this field include USB (Universal Serial Bus) to serial port modules and logic analyzers. USB to serial port modules convert TTL (Transistor-Transistor Logic) levels on embedded devices into USB CDC (Communication Device Class) standard signals, establishing a communication channel between the computer and the embedded device. However, this module only has TTL level conversion capabilities and cannot communicate with common interfaces such as IIC (Inter-Integrated Circuit) and SPI (Serial Peripheral Interface). Logic analyzers, on the other hand, possess strong signal acquisition and waveform analysis capabilities, but are relatively complex to use. Furthermore, they can only acquire and analyze signals and cannot actively send test data to directly debug peripheral devices. Summary of the Invention

[0003] This application provides a data acquisition and debugging method, apparatus, device, and storage medium, which solves the problem in related technologies that development and debugging tools are difficult to use directly for debugging peripheral devices. This solution can directly debug the embedded device without going through the embedded device's processor, effectively realizing the transmission and reception of test data, and providing convenience for the debugging work of development and testing personnel.

[0004] In a first aspect, this application provides a data acquisition and debugging method applied to a debugging device. The debugging device includes an MCU, a first serial communication interface, and a USB interface. The MCU is connected to both the first serial communication interface and the USB interface. The first serial communication interface is used to connect to the chip to be debugged in an embedded device, and the USB interface is used to connect to a host computer. The method includes: With the chip to be debugged connected to the first serial communication interface and the host computer connected to the USB interface, in response to the received power-on signal, the host computer performs a USB enumeration operation to allow the host computer to access the debugging device. Upon completion of the USB enumeration operation, the first transmission mode is determined to be used. The first transmission mode is used to provide a transmission path connecting the chip to be debugged and the host computer. In the first transmission mode, the first signal data of the chip to be debugged is acquired through the first serial communication interface during the sampling period, and the first signal data is sent to the host computer through the USB interface. In addition, in the first transmission mode, in response to receiving test data sent by the host computer via the USB interface, the test data is forwarded to the chip to be debugged via the first serial communication interface.

[0005] Secondly, this application also provides a data acquisition and debugging device for use in debugging equipment. The debugging equipment includes an MCU, a first serial communication interface, and a USB interface. The MCU is connected to both the first serial communication interface and the USB interface. The first serial communication interface is used to connect to the chip to be debugged in the embedded device, and the USB interface is used to connect to a host computer. The device includes: The device enumeration module is configured to, in the case that the chip to be debugged is connected to the first serial communication interface and the host computer is connected to the USB interface, respond to the received power-on signal and perform a USB enumeration operation with the host computer so that the host computer can access the debugging device. The mode configuration module is configured to determine the first transmission mode when the USB enumeration operation is completed. The first transmission mode is used to provide a transmission path connecting the chip to be debugged and the host computer. The data acquisition module is configured to acquire the first signal data of the chip under test through the first serial communication interface during the sampling period in the first transmission mode, and send the first signal data to the host computer through the USB interface. The data forwarding module is configured to, in the first transmission mode, respond to receiving test data sent by the host computer via the USB interface, forward the test data to the chip to be debugged via the first serial communication interface.

[0006] Thirdly, this application also provides an electronic device comprising: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, enable the one or more processors to implement the data acquisition and debugging method of this application.

[0007] Fourthly, this application also provides a storage medium for storing computer-executable instructions, which, when executed by a processor, are used to execute the data acquisition and debugging method of this application.

[0008] This application's solution is based on the connection structure between the debugging device and other external devices. By performing USB enumeration operations on the debugging device, a stable data transmission channel is established between the debugging device, the host computer, and the chip under test. No driver or host computer software installation is required. Data transmission can be achieved by directly debugging the chip under test even without an embedded processor. After data acquisition, the data is transmitted to the host computer via WebUSB and displayed on a webpage. Data can also be sent to the chip under test via the webpage for debugging, improving the convenience and versatility of the debugging device. It also facilitates the debugging work of development and testing personnel and helps to improve testing efficiency. Attached Figure Description

[0009] Figure 1 This is a schematic diagram of device connection for an embedded development and testing scenario provided in one embodiment of this application.

[0010] Figure 2 This is a schematic diagram illustrating the steps of a data acquisition and debugging method provided in an embodiment of this application.

[0011] Figure 3 This is a schematic diagram illustrating the steps of a debugging device performing a first enumeration operation according to an embodiment of this application.

[0012] Figure 4 This is a schematic diagram of an interactive page provided in an embodiment of this application.

[0013] Figure 5 This is a schematic diagram of the structure of a data acquisition and debugging device provided in an embodiment of this application.

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

[0015] The embodiments of this application will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the embodiments of this application and are not intended to limit the scope of this application. Furthermore, it should be noted that, for ease of description, the accompanying drawings only show the parts related to the embodiments of this application, not all structures. Those skilled in the art, after reading this specification, should be able to conceive that any combination of technical features can constitute an optional implementation method, provided that the technical features do not contradict each other.

[0016] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects, not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class, not limited in number; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship. In the description of this application, "multiple" means two or more, and "several" means one or more.

[0017] In the embedded systems field, the choice of development and debugging tools is crucial for improving development efficiency. Existing development and debugging tools often suffer from limitations: some are cost-driven and have limited functionality, while others only offer data acquisition and analysis capabilities and cannot be directly used to debug peripheral devices. Commonly used tools in related technologies include USB-to-serial modules and logic analyzers. USB-to-serial modules convert TTL levels on embedded devices into USB CDC standard signals, establishing a communication channel between the computer (or host computer) and the embedded device. Logic analyzers, on the other hand, possess strong signal acquisition and waveform analysis capabilities.

[0018] In embedded development, it's often necessary to use serial ports to print debugging information and input debugging test commands. Using a USB-to-serial module requires first installing the USB driver and then downloading the corresponding host computer software to achieve printing and input debugging. However, when debugging interfaces like IIC and SPI, a logic analyzer needs to be connected, along with the corresponding USB driver and host computer software. After capturing signals, sending test data can only be achieved by writing code on the MCU (Microcontroller Unit). But this USB-to-serial module only has TTL level conversion functionality and cannot communicate with common interfaces like IIC and SPI. Furthermore, the logic analyzer can only collect and analyze signals; it cannot actively send test data to directly debug peripheral devices.

[0019] It is conceivable that the relevant technology requires an additional logic analyzer to connect the touch chip and the host computer, and a USB-to-serial module to connect the embedded controller, which in turn connects to the host computer. The host computer then prints debugging information via the serial port and requires the corresponding serial debugging software to be opened. It should be noted that the corresponding driver needs to be installed upon first use. If simply printing debugging information is insufficient to locate the problem, a logic analyzer is needed to capture and analyze the specific waveform data. Using the logic analyzer also requires opening the corresponding host computer software and ensuring the driver is successfully installed. Therefore, it is evident that in this technical solution, the logic analyzer can only capture and decode the communication waveforms between the embedded controller and the touch chip, and the debugging information of the embedded controller needs to be converted via a USB-to-serial module. In other words, this technology not only requires the use of multiple devices, resulting in complex device composition and connections, but also necessitates the configuration of corresponding drivers and software programs to achieve data transmission.

[0020] To address this issue, this application provides a data acquisition and debugging method. This method is applied to a debugging device, which serves as an intermediate device to connect a host computer and an embedded device. The debugging device includes an MCU, a first serial communication interface, and a USB interface. The MCU is connected to both the first serial communication interface and the USB interface. The first serial communication interface is used to connect to the chip under test in the embedded device. Optionally, the first serial communication interface can be an IIC interface, an SPI interface, or a CAN interface. The type of the first serial communication interface is associated with the chip under test; for example, if the chip under test is a touch chip based on IIC bus communication, then the first serial communication interface is an IIC interface. The USB interface is used to connect to the host computer. Figure 1The figure shows a schematic diagram of device connections for an embedded development and testing scenario provided in one embodiment of this application. In one embodiment, to better illustrate the solution, the touch chip on the screen of the embedded device 103 is used as an example for debugging. In the scenario of debugging a touch chip based on IIC bus communication, capacitive touchscreens are commonly used in embedded development, and the touch chip on them communicates with the embedded control chip via the IIC bus. Therefore, the first serial communication interface is an IIC interface and is connected to the touch chip. It should be noted that this first serial communication interface can also be an SPI interface, meaning the touch chip uses the SPI bus for data transmission. Furthermore, the USB interface of the debugging device 101 is connected to the host computer 102 for data transmission. The embedded device 103 also includes an embedded controller, which is also connected to the touch chip via the IIC bus, enabling communication between the embedded controller and the touch chip. Furthermore, the debugging device 101 is equipped with a second serial communication interface, which is a TTL interface for connection with the embedded controller. This allows the MCU in the debugging device 101 and the embedded controller to transmit TTL level signals through the serial port, thereby achieving data transmission.

[0021] In this regard, the data acquisition and debugging method of this application can achieve data transmission by configuring the debugging equipment, such as... Figure 2 As shown, Figure 2 This is a schematic diagram illustrating the steps of a data acquisition and debugging method provided in one embodiment of this application. In one embodiment, when the corresponding interface of the debugging device is connected to the chip to be debugged (such as the touch chip mentioned above) and the host computer, the debugging device provides a data transmission path between the host computer and the chip to be debugged after device configuration, thereby eliminating the need for data to be forwarded through the embedded controller, and realizing the host computer's data acquisition of the chip to be debugged and the sending of test data to the chip to be debugged. The specific steps include steps S110-S140.

[0022] Step S110: When the chip to be debugged is connected to the first serial communication interface and the host computer is connected to the USB interface, in response to the received power-on signal, the host computer performs a USB enumeration operation to allow the host computer to access the debugging device.

[0023] It is conceivable that, in reference Figure 1After connecting the debugging device, embedded device, and host computer, the power-on signal is triggered by the host computer's pins. For example, the CC pin of the host computer's USB interface detects the device connection and powers it on, causing the connected debugging device to power-on and reset, and enter the connection configuration state. During this process, the debugging device and the host computer perform a USB enumeration operation. It can be understood that when the debugging device is connected to the host computer as a USB device, the USB enumeration operation performed is the process by which the host computer identifies the device, allocates an address, loads the driver, and establishes communication after the device is connected, allowing the host computer to access the debugging device.

[0024] Optionally, in this solution, an enumeration operation is performed between the debugging device and the host computer to enumerate the debugging device as a USB network card or WebUSB device, thereby enabling data transmission. During the enumeration process, the host computer sends a corresponding request signal to the debugging device to obtain the device descriptor. This device descriptor is used to record the device parameters of the debugging device, such as the USB specifications supported by the device, device class identifier, device protocol, and other information. Then, the first and second enumeration operations are performed to configure the debugging device. Specifically, based on the RNDIS (Remote Network Driver Interface Specification) protocol, the debugging device and the host computer perform the first enumeration operation to enumerate the debugging device as a USB network card. Understandably, RNDIS implements TCP (Transmission Control Protocol) / IP (Internet Protocol) protocol stack transmission through the USB interface, thus virtualizing the debugging device as an Ethernet card (i.e., the aforementioned USB network card). This allows the host computer to connect to the shared network via the USB interface without additional dialing. This method enables plug-and-play and highly compatible data transmission between the debugging device and the host computer. Specifically, the first enumeration operation enumerates the debugging device as a virtual network card, allowing the host computer to access the debugging device through the built-in browser, thereby preparing the host computer to obtain data from the debugging device during subsequent data transmission.

[0025] Furthermore, the debugging device is based on the WebUSB protocol, and a second enumeration operation is performed with the host computer to enumerate the debugging device as a WebUSB device. The WebUSB protocol provides a browser API (Application Programming Interface) on the host computer side, allowing communication with external devices via USB. This eliminates the limitations of traditional USB devices requiring the installation of local drivers or SDKs (Software Development Kits), enabling direct device control, data transfer, and firmware updates within a webpage. Therefore, the second enumeration operation enumerates the debugging device as a WebUSB device, allowing the host computer to access the webpage provided by the debugging device through a browser for data acquisition and transmission.

[0026] In response, the debugging device uses USB enumeration to enumerate devices and participate in the data transmission process as different types of devices, thus eliminating the need to install drivers or host computer software. It can directly debug external embedded devices without an embedded processor, providing convenience for the debugging work of development and testing personnel.

[0027] Step S120: After completing the USB enumeration operation, determine to use the first transmission mode.

[0028] The first transmission mode is used to provide a transmission path connecting the chip under test and the host computer, as shown in the reference. Figure 1 The transmission path is indicated by a solid double-headed arrow. The debugging device connects to the touch chip via a first serial interface and to the host computer via a USB interface. This allows data collected from the touch chip to be transmitted to the debugging device via the first serial interface and then sent to the host computer via the USB interface. Similarly, test data sent by the host computer is transmitted to the debugging device via the USB interface and then sent to the chip under test via the first serial interface. In other words, the transmission path provided by the debugging device between the touch chip and the host computer does not require passing through the embedded controller. It is conceivable that the debugging device may also have a second transmission mode. In this mode, the debugging device can further add a data transmission path via the embedded controller, building upon the first transmission mode. That is, the collected data can be transmitted from the touch chip through the embedded controller to the debugging device. Therefore, after completing the USB enumeration operation, the debugging device transmits data via the transmission path corresponding to the first transmission mode, thus eliminating the need for additional devices to monitor the interface in this mode for real-time data transmission and reception.

[0029] Step S130: In the first transmission mode, the first signal data of the chip to be debugged is obtained through the first serial communication interface during the sampling period, and the first signal data is sent to the host computer through the USB interface.

[0030] In the first transmission mode, the debugging device has a corresponding sampling period for data acquisition (such as waveform data), meaning it acquires first signal data from the touch chip according to a frequency. The acquired first signal data is transmitted along the transmission path provided by the first transmission mode; that is, the debugging device obtains the waveform signal from the touch chip through the first serial communication interface and then transmits the signal data to the host computer via the USB interface. On the host computer side, in response to the first signal data uploaded by the debugging device, the host computer can display the signal waveform on the display interface.

[0031] Step S140: In the first transmission mode, in response to receiving test data sent by the host computer via the USB interface, the test data is forwarded to the chip to be debugged via the first serial communication interface.

[0032] Furthermore, when the host computer sends test data, it also sends the data based on the transmission path corresponding to the first transmission mode, that is, by sending the test data to the debugging device via the USB interface. The debugging device then forwards the test data to the touch chip (which is the chip to be debugged) via the first serial communication interface, so that the touch chip can be configured according to the test data.

[0033] As can be seen from the above scheme, this scheme is based on the connection structure between the debugging device and other external devices. By performing USB enumeration operations on the debugging device, a stable data transmission channel is established between the debugging device, the host computer, and the chip under test. No driver or host computer software needs to be installed. The chip under test can be directly debugged to achieve data transmission even without an embedded processor. After data acquisition, it is transmitted to the host computer via WebUSB and displayed on a webpage. Data can also be sent down via the webpage to debug the chip under test, which improves the convenience and versatility of the debugging device. It also provides convenience for the debugging work of development and testing personnel and helps to improve testing efficiency.

[0034] Figure 3 The figure shows a schematic diagram of the steps of the debugging device performing the first enumeration operation according to an embodiment of the present application. In one embodiment, during the first enumeration operation between the debugging device and the host computer, the debugging device is enumerated as a USB network card and provides page data to the host computer for rendering. The specific steps include steps S210-230.

[0035] Step S210: In response to receiving the RNDIS request sent by the host computer, send RNDIS response information back to the host computer so that the host computer can configure network parameters and establish a communication connection.

[0036] Step S220: With the communication connection established, run the HTTP server to listen for call requests initiated by the host computer.

[0037] Step S230: Upon receiving a call request, provide page data to the host computer for rendering to form an interactive page.

[0038] Understandably, the host computer and the debugging device jointly complete the first enumeration operation, interacting with each other to complete the enumeration. After the device powers on, the host computer sends an RNDIS request to the debugging device. This RNDIS request, initiated by the host computer, is used to complete the initialization of the RNDIS protocol stack, state management, capability negotiation, and data link configuration. In response, the debugging device returns RNDIS response information to the host computer. This RNDIS response information includes device capability parameters, such as the list of OIDs (Object Identifiers) supported by the debugging device, hardware status, etc., to complete the RNDIS device capability negotiation. Subsequently, the host computer completes network parameter configuration, such as configuring static IPs to allocate IP addresses.

[0039] Furthermore, the debugging device firmware has a built-in lightweight HTTP server module. After determining the network parameters, the debugging device configures its IP address to run an HTTP server through this built-in module and waits for a request from the host computer. It's conceivable that the host computer can establish an HTTP session with the debugging tool by entering its IP address in a browser and initiating a request to access the tool. The debugging tool then responds to this request by retrieving page data from memory, encapsulating it in HTML, CSS, or JS formats, and sending it to the host computer via a data channel. The host computer then receives and renders the page data through its browser, retrieving webpage data and generating an interactive page on its display interface. This interactive page displays the data sent and received by the host computer. For example, Figure 4 The figure shows a schematic diagram of an interactive page provided in an embodiment of this application. The interactive interface displayed on the host computer includes a first area 201, a second area 202, a third area 203, and a fourth area 204. The first area 201 is used to display the waveform drawn based on the first signal data, the second area 202 is used to display the received data, the third area 203 is used to display the sent data, and the fourth area 204 is used to display debugging information, such as debugging status and debugging results.

[0040] In this regard, this solution eliminates the need to develop dedicated desktop clients for different systems such as Windows, Linux, or macOS. By leveraging the cross-platform nature of browsers, data transfer can be achieved by enumerating the debugging device as a USB network adapter. This avoids client driver compatibility issues and deployment costs caused by version iterations, conforms to the plug-and-play USB device design principle, and improves the convenience, versatility, and lightweight nature of the debugging device with an embedded web architecture.

[0041] In some embodiments, the debugging device and the host computer perform a second enumeration operation to enumerate the debugging device as a WebUSB device. During the second enumeration operation, the host computer sends a read request to the debugging device to obtain the device descriptor of the debugging device. In response to receiving the read request from the host computer, the debugging device returns the device descriptor to the host computer so that the host computer can identify the debugging device and display the device information in a pop-up window. It is conceivable that during the second enumeration operation, the host computer uses an API through a browser to enumerate devices conforming to the WebUSB specification and requests the devices to return device descriptors so that the host computer can identify the device and display the device information in a pop-up window for user authorization. After user authorization, an authorization signal is sent to the debugging device. This authorization signal is used to confirm the connection and establish an exclusive communication channel for the host computer to communicate with the debugging tool through the browser. That is, upon receiving the authorization signal to confirm the connection, the debugging device establishes a data transmission channel with the host computer for application layer data transmission.

[0042] To address this, this solution establishes a communication channel between the host computer and the debugging device through a second enumeration operation. This allows web applications to directly interact with the device's designated interface without relying on native system drivers or desktop clients. Furthermore, it eliminates the need to develop dedicated drivers for different operating systems. Data interaction with the debugging device can be achieved simply by using the built-in browser to enumerate with the device, effectively reducing the cross-platform adaptation cost of the debugging device and improving its compatibility.

[0043] Optionally, during data transmission and reception, the debugging device encodes and decodes data according to the corresponding transmission protocol during communication with the chip under test. For example, in some embodiments, the debugging device reads the pin level signal of the chip under test through the first serial communication interface within a sampling period based on a preset sampling method, such as acquiring the pin level of the chip under test in an average sampling manner to read the pin level signal of the chip under test. Furthermore, based on the transmission protocol corresponding to the first serial communication interface, the debugging device parses the pin level signal within the sampling period into a level signal value according to the corresponding decoding method to generate first signal data and send the first signal data to the host computer. For example, refer to... Figure 1In this application scenario, the chip to be debugged is a touch chip based on IIC bus communication, and the first serial communication interface is an IIC interface. Based on this, for the pin level signals transmitted by the IIC bus, the debugging equipment parses the pin level signals into digital signals according to the IIC bus transmission protocol, and then encapsulates the parsed data, sampling time interval, and other information to obtain the first signal data, so as to send the first signal data to the host computer.

[0044] Similarly, after receiving the test data, in one embodiment, the debugging device encodes the test data according to the corresponding encoding method based on the transmission protocol corresponding to the first serial communication interface and generates second signal data. In response to the generation of the second signal data, the debugging device forwards the second signal data to the chip to be debugged through the first serial communication interface. For example, refer to... Figure 1 In this application scenario, the debugging equipment converts the test data into corresponding level signals according to the IIC bus transmission protocol as second signal data, and then sends the second signal data to the touch chip.

[0045] For example, the debugging equipment uses average sampling to acquire the pin levels of the chip under test. Following the transmission protocol corresponding to the first serial communication interface, it parses the pin level signals within the acquisition period into digital signals, such as level signal values. The acquired data is then encapsulated and sent to the host computer via a USB interface. The host computer receives the data via API and parses it to display waveforms, text, and other information on the interactive page. Furthermore, the host computer responds to user control by sending test data to the debugging equipment. The debugging equipment receives and parses the data, selects the encoding method corresponding to the first serial communication interface, and encodes the test data, such as converting numerical signals in the test data into analog signals, thereby obtaining the corresponding second signal data and sending it to the chip under test.

[0046] Figure 5 This is a schematic diagram of a data acquisition and debugging device provided in one embodiment of this application. The device is applied to a debugging equipment, which includes an MCU, a first serial communication interface, and a USB interface. The MCU is connected to both the first serial communication interface and the USB interface. The first serial communication interface is used to connect to the chip to be debugged in the embedded device, and the USB interface is used to connect to a host computer. This device is used to implement the data acquisition and debugging method provided in the above embodiment and possesses the functional modules and beneficial effects of implementing the method. As shown in the figure, the device includes a device enumeration module 301, a mode configuration module 302, a data acquisition module 303, and a data forwarding module 304.

[0047] The device enumeration module 301 is configured to, in response to the received power-on signal, perform a USB enumeration operation with the host computer when the first serial communication interface is connected to the chip to be debugged and the USB interface is connected to the host computer, so that the host computer can access the debugging device. The mode configuration module 302 is configured to determine the first transmission mode when the USB enumeration operation is completed. The first transmission mode is used to provide a transmission path connecting the chip to be debugged and the host computer. The data acquisition module 303 is configured to acquire the first signal data of the chip to be debugged through the first serial communication interface during the sampling period in the first transmission mode, and send the first signal data to the host computer through the USB interface. The data forwarding module 304 is configured to, in the first transmission mode, respond to receiving test data sent by the host computer via the USB interface, forward the test data to the chip to be debugged via the first serial communication interface.

[0048] In some embodiments, the device enumeration module 301 is specifically configured as follows: Based on the RNDIS protocol, the host computer performs the first enumeration operation to enumerate the debugging device as a USB network card. Based on the WebUSB protocol, a second enumeration operation is performed with the host computer to enumerate the debugging device as a WebUSB device.

[0049] In some embodiments, the device enumeration module 301 is further configured to: In response to receiving an RNDIS request from the host computer, the system sends RNDIS response information back to the host computer so that the host computer can configure network parameters and establish a communication connection. Once a communication connection is established, run an HTTP server to listen for call requests initiated by the host computer; Upon receiving a call request, page data is provided to the host computer for rendering into an interactive page, which is used to display the data sent and received by the host computer.

[0050] In some embodiments, the device enumeration module 301 is further configured to: In response to receiving a read request from the host computer, the device descriptor is fed back to the host computer so that the host computer can identify and debug the device and display the device information in a pop-up window; Upon receiving an authorization signal to confirm the connection, a data transmission channel with the host computer is established.

[0051] In some embodiments, the data acquisition module 303 is specifically configured as follows: Based on a preset sampling method, the pin level signal of the chip to be debugged is read through the first serial communication interface within the sampling period; Based on the transmission protocol corresponding to the first serial communication interface, the pin level signal within the sampling period is parsed into a level signal value according to the corresponding decoding method to generate the first signal data and send the first signal data to the host computer.

[0052] In some embodiments, the data forwarding module 304 is specifically configured as follows: Based on the transmission protocol corresponding to the first serial communication interface, the test data is encoded according to the corresponding encoding method and the second signal data is generated. In response to the generation of the second signal data, the second signal data is forwarded to the chip to be debugged through the first serial communication interface.

[0053] In some embodiments, the first serial communication interface is an IIC interface, an SPI interface, or a CAN interface.

[0054] It is worth noting that in the embodiments of the above-mentioned device, the modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each module are only for easy differentiation and are not used to limit the protection scope of the embodiments of this application.

[0055] Figure 6 This is a schematic diagram of an electronic device provided in an embodiment of this application. The device is used to execute the data acquisition and debugging method provided in the above embodiment and has corresponding functional modules and beneficial effects for executing the method. As shown in the figure, the device includes a processor 401, a memory 402, an input device 403, and an output device 404. The number of processors 401 can be one or more; one processor 401 is shown as an example in the figure. The processor 401, memory 402, input device 403, and output device 404 can be connected via a bus or other means; a bus connection is shown as an example in the figure. The memory 402, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the data acquisition and debugging method in the embodiments of this application. The processor 401 executes various corresponding functional applications and data processing by running the software programs, instructions, and modules stored in the memory 402, thereby realizing the above-mentioned data acquisition and debugging method.

[0056] The memory 402 may primarily include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a given function; the data storage area may store data recorded or created during use. Furthermore, the memory 402 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 402 may further include memory remotely located relative to the processor 401, which can be connected to the device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0057] The input device 403 can be used to input corresponding digital or character information to the processor 401, and to generate key signal inputs related to the user settings and function control of the device; the output device 404 can be used to send or display key signal outputs related to the user settings and function control of the device.

[0058] This application also provides a storage medium storing computer-executable instructions, which, when executed by a processor, are used to perform related operations in the data acquisition and debugging method provided in any embodiment of this application.

[0059] Computer-readable storage media include both permanent and non-permanent, removable and non-removable media, and information storage can be achieved by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.

[0060] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0061] Note that the above description is merely a preferred embodiment and the technical principles employed in this application. Those skilled in the art will understand that this application is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of this application. Therefore, although this application has been described in detail through the above embodiments, this application is not limited to the above embodiments. Many other equivalent embodiments may be included without departing from the concept of this application, and the scope of this application is determined by the scope of the appended claims.

Claims

1. A data acquisition and debugging method, characterized in that, The method is applied to a debugging device, which includes an MCU, a first serial communication interface, and a USB interface. The MCU is connected to both the first serial communication interface and the USB interface. The first serial communication interface is used to connect to the chip to be debugged in an embedded device, and the USB interface is used to connect to a host computer. When the chip to be debugged is connected to the first serial communication interface and the host computer is connected to the USB interface, in response to the received power-on signal, a USB enumeration operation is performed with the host computer so that the host computer can access the debugging device; Upon completion of the USB enumeration operation, a first transmission mode is determined to be used, which is used to provide a transmission path connecting the chip to be debugged and the host computer. In the first transmission mode, the first signal data of the chip to be debugged is obtained through the first serial communication interface during the sampling period, and the first signal data is sent to the host computer through the USB interface. In addition, in the first transmission mode, in response to receiving test data sent by the host computer through the USB interface, the test data is forwarded to the chip to be debugged through the first serial communication interface.

2. The data acquisition and debugging method according to claim 1, characterized in that, The step of responding to the received power-on signal and performing a USB enumeration operation with the host computer to allow the host computer to access the debugging device includes: Based on the RNDIS protocol, the host computer performs a first enumeration operation to enumerate the debugging device as a USB network card; Based on the WebUSB protocol, the host computer performs a second enumeration operation to enumerate the debugging device as a WebUSB device.

3. The data acquisition and debugging method according to claim 2, characterized in that, The step of performing a first enumeration operation with the host computer based on the RNDIS protocol to enumerate the debugging device as a USB network card includes: In response to receiving the RNDIS request sent by the host computer, the system sends RNDIS response information back to the host computer so that the host computer can configure network parameters and establish a communication connection. Once a communication connection is established, an HTTP server is run to listen for call requests initiated by the host computer. Upon receiving the call request, page data is provided to the host computer for the host computer to render and form an interactive page, which is used to display the data sent and received by the host computer.

4. The data acquisition and debugging method according to claim 2 or 3, characterized in that, The step of performing a second enumeration operation with the host computer based on the WebUSB protocol to enumerate the debugging device as a WebUSB device includes: In response to receiving a read request from the host computer, the device descriptor is fed back to the host computer so that the host computer can identify the debugging device and display the device information through a pop-up window; Upon receiving an authorization signal to confirm the connection, a data transmission channel is established with the host computer.

5. The data acquisition and debugging method according to claim 1, characterized in that, The step of acquiring the first signal data of the chip under test through the first serial communication interface during the sampling period, and sending the first signal data to the host computer through the USB interface, includes: Based on a preset sampling method, the pin level signal of the chip to be debugged is read through the first serial communication interface within the sampling period; Based on the transmission protocol corresponding to the first serial communication interface, the pin level signal within the sampling period is parsed into a level signal value according to the corresponding decoding method to generate the first signal data and send the first signal data to the host computer.

6. The data acquisition and debugging method according to claim 1, characterized in that, The step of responding to receiving test data sent by the host computer through the USB interface and forwarding the test data to the chip to be debugged through the first serial communication interface includes: Based on the transmission protocol corresponding to the first serial communication interface, the test data is encoded according to the corresponding encoding method and a second signal data is generated. In response to the generation of the second signal data, the second signal data is forwarded to the chip to be debugged through the first serial communication interface.

7. The data acquisition and debugging method according to any one of claims 1-6, characterized in that, The first serial communication interface is an IIC interface, an SPI interface, or a CAN interface.

8. A data acquisition and debugging device, characterized in that, An application is made in debugging equipment, the debugging equipment including an MCU, a first serial communication interface, and a USB interface. The MCU is connected to both the first serial communication interface and the USB interface. The first serial communication interface is used to connect to the chip to be debugged in an embedded device, and the USB interface is used to connect to a host computer. The device includes: The device enumeration module is configured to, in response to a received power-on signal, perform a USB enumeration operation with the host computer when the first serial communication interface is connected to the chip to be debugged and the USB interface is connected to the host computer, so that the host computer can access the debugging device. The mode configuration module is configured to determine the first transmission mode when the USB enumeration operation is completed. The first transmission mode is used to provide a transmission path connecting the chip to be debugged and the host computer. The data acquisition module is configured to acquire the first signal data of the chip to be debugged through the first serial communication interface within the sampling period in the first transmission mode, and send the first signal data to the host computer through the USB interface. The data forwarding module is configured to, in the first transmission mode, in response to receiving test data sent by the host computer through the USB interface, forward the test data to the chip to be debugged through the first serial communication interface.

9. An electronic device, characterized in that, include: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to implement the data acquisition and debugging method as described in any one of claims 1-7.

10. A storage medium for storing computer-executable instructions, characterized in that, The computer-executable instructions, when executed by a processor, are used to perform the data acquisition and debugging method as described in any one of claims 1-7.