Device debugging method, terminal device and host computer

By setting up an independently running SP subsystem in the terminal device and exchanging system data with the host computer via USB, the problem of data transmission difficulties caused by the terminal device AP subsystem being stuck is solved, and the ability to quickly and completely export data and analyze faults is realized.

CN122173425APending Publication Date: 2026-06-09SPREADTRUM COMMUNICATION (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SPREADTRUM COMMUNICATION (SHANGHAI) CO LTD
Filing Date
2026-01-27
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

The terminal device experienced an AP CPU freeze during operation, resulting in decreased operational stability. Existing technologies make it difficult to quickly and completely export system data to the host computer for debugging.

Method used

An independently operable SP subsystem is set up in the terminal device. After the AP subsystem is detected to be hanging, the UART interface is switched to the USB channel to handshake with the host computer and interact through the USB channel to achieve efficient transmission of system data, including status query, address space read and write, and debug bus information transmission.

Benefits of technology

It enables fast and complete system data transmission even when the AP subsystem is suspended, improving data observability and maintainability, and reducing the difficulty of problem localization and R&D debugging costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122173425A_ABST
    Figure CN122173425A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of communication, in particular to a device debugging method, a terminal device and an upper computer, the method is applied to a terminal device, the terminal device comprises an AP subsystem and an SP subsystem, the method comprises the following steps: when the SP subsystem detects that the AP subsystem is hung, switching a universal asynchronous receiver transmitter (UART) interface to a USB channel; the SP subsystem performs handshaking with the upper computer through the USB channel; the SP subsystem performs command interaction with the upper computer through the USB channel, so as to perform transmission of system data between the SP subsystem and the upper computer. The embodiment of the application realizes efficient and complete transmission of system data in the hung state.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a device debugging method, a terminal device, and a host computer. Background Technology

[0002] Terminal devices, such as mobile phones, often experience instability issues during operation, such as AP (application processor) and CPU (central processing unit) freezing. To resolve these issues and maintain smooth operation, system data related to the terminal device's problems can be exported to a host computer. Developers can then use this exported data to debug, analyze, and address the problems to prevent recurrence.

[0003] Therefore, in the event of operational problems with terminal devices, how the host computer can conveniently and quickly export the system data of the terminal devices is a technical problem that urgently needs to be solved. Summary of the Invention

[0004] This application provides a device debugging method, a terminal device, and a host computer. When the SP subsystem of the terminal device detects that the AP subsystem has crashed, it transmits system data to the host computer via USB, thereby achieving efficient and complete transmission of system data in the event of a crash.

[0005] According to a first aspect of the embodiments of this application, a device debugging method is provided, applied to a terminal device, the terminal device including an AP subsystem and an SP subsystem, the method comprising: If the SP subsystem detects that the AP subsystem has crashed, it will switch the Universal Asynchronous Receiver / Transmitter (UART) interface to the USB path. The SP subsystem communicates with the host computer via USB. The SP subsystem interacts with the host computer via USB to execute commands and transfer system data between the SP subsystem and the host computer.

[0006] In conjunction with the first aspect, in certain implementations of the first aspect, the SP subsystem hands-on with the host computer via a USB pathway, including: The SP subsystem sends a handshake signal to the host computer via the USB channel. The handshake signal is used to trigger the host computer to provide a feedback response signal. The SP subsystem receives the response signal sent by the host computer through the USB channel to complete the handshake with the host computer.

[0007] In conjunction with the first aspect, in certain implementations of the first aspect, the SP subsystem interacts with the host computer via a USB channel to execute commands, thereby performing the transfer of system data between the SP subsystem and the host computer, including: The SP subsystem receives data read commands sent by the host computer via the USB channel; The SP subsystem transmits data to the host computer via USB to execute data read commands.

[0008] In conjunction with the first aspect, in certain implementations of the first aspect, the SP subsystem and the host computer perform data transmission corresponding to the data read command, including at least one of the following: When the data read command includes a status query command, the SP subsystem sends the system status information of the AP subsystem to the host computer. When the data read command includes an address space read command, the SP subsystem sends the data in the address space of the terminal device to the host computer. The address space includes: registers, memory or RAM. When the data read command includes a write command to the address space, the SP subsystem writes the data in the write command to the address space of the terminal device. When the data read command includes a read command for the debug bus, the SP subsystem sends the real-time information transmitted on the debug bus of the terminal device to the host computer. When the data read command includes a read command for register status, the SP subsystem sends the register status saved by the AP subsystem in the event of a hangup to the host computer. When the data read command includes a version read command, the SP subsystem sends the version information of each component of the terminal device to the host computer. When the data read command includes a machine read command, the SP subsystem sends the device information of the terminal device to the host computer.

[0009] In conjunction with the first aspect, in some implementations of the first aspect, after the SP subsystem performs the transmission of system data between the SP subsystem and the host computer, it also includes: The SP subsystem receives a restart command sent by the host computer; The SP subsystem responds to the restart command and restarts the AP subsystem.

[0010] In conjunction with the first aspect, in certain implementations of the first aspect, the SP subsystem detects that the AP subsystem has hanged, including: The SP subsystem monitors the watchdog of the AP subsystem; When the SP subsystem detects a watchdog-triggered hangup signal, it determines that the AP subsystem has hanged up.

[0011] In conjunction with the first aspect, in some implementations of the first aspect, after the SP subsystem detects that the AP subsystem has hanged, it also includes: The SP subsystem triggers a hangup notification component.

[0012] According to a second aspect of the embodiments of this application, a device debugging method is provided, applied to a host computer, the method comprising: The terminal device's SP subsystem is handshaked via the USB path. The USB path is a data transmission path established between the terminal device's SP subsystem and the host computer through the Universal Asynchronous Receiver / Transmitter (UART) interface when the AP subsystem is confirmed to be hanging.

[0013] The system interacts with the SP subsystem of the terminal device via USB to execute commands and receive system data from the terminal device sent by the SP subsystem.

[0014] In conjunction with the second aspect, in certain implementations of the second aspect, a handshake is performed with the SP subsystem of the terminal device via a USB pathway, including: The receiving terminal device sends a handshake signal via the USB channel. The handshake signal is sent by the terminal device's SP subsystem when it is confirmed that the AP subsystem has hanged up. The system sends a response signal to the SP subsystem of the terminal device via the USB channel to complete the handshake with the terminal device.

[0015] In conjunction with the second aspect, in some implementations of the second aspect, commands are executed and interacted with the SP subsystem of the terminal device via a USB path to receive system data of the terminal device sent by the SP subsystem, including: Send a data read command to the SP subsystem of the terminal device via the USB channel; Receive system data corresponding to the data read command sent by the SP subsystem via the USB channel.

[0016] According to a third aspect of the embodiments of this application, a terminal device is provided, including: a memory and a processor, wherein the memory is used to store computer programs for an AP subsystem and an SP subsystem respectively, and the computer program of the SP subsystem is invoked by the processor to execute the device debugging method of any one of the first aspects.

[0017] According to a fourth aspect of the embodiments of this application, a host computer is provided, including: a memory and a processor, wherein the memory is used to store a computer program, and the computer program is invoked by the processor to execute the device debugging method of any of the second aspects.

[0018] According to a fifth aspect of the embodiments of this application, a computer-readable storage medium is provided, on which a computer program is stored, and the computer program is invoked to execute any one of the device debugging methods of the first or second aspect of the embodiments of this application.

[0019] According to a sixth aspect of the embodiments of this application, a computer product is provided, comprising: a computer program, wherein the computer program is executed by a control module using any one of the device debugging methods of the first or second aspect of the embodiments of this application.

[0020] As will be described in detail below, the technical solution provided in this application embodiment includes an AP subsystem and an SP subsystem in the terminal device, isolating the terminal device's system operation system (i.e., the AP subsystem) and monitoring system (i.e., the SP subsystem). Thus, when the AP subsystem hangs, the still independently operating SP subsystem switches the UART interface to a USB path and interacts with the host computer via the USB path. After the AP subsystem hangs, the system data is quickly and completely transmitted to the host computer within a short time, ensuring the integrity and efficiency of data transmission at the fault location. Therefore, the SP subsystem, as an independent monitoring system, actively interacts with the host computer to complete timely transmission and alerts at the fault location, greatly improving the observability and maintainability of data when the AP subsystem hangs, and significantly reducing the difficulty of locating the system hang problem and the R&D and debugging costs.

[0021] It should be understood that both the foregoing general description and the following detailed description are exemplary and intended to provide further illustration of the claimed technology. Attached Figure Description

[0022] The above and other objects, features, and advantages of the embodiments of this application will become more apparent from the more detailed description of the embodiments in conjunction with the accompanying drawings. The accompanying drawings are used to provide a further understanding of the embodiments of this application and constitute a part of the specification. They are used together with the embodiments of this application to explain the embodiments of this application and do not constitute a limitation thereof. In the accompanying drawings, the same reference numerals generally represent the same components or steps.

[0023] Figure 1 The figure shows a structural example of a communication system according to an embodiment of this application; Figure 2 The figure shows a flowchart of a device debugging method according to an embodiment of this application; Figure 3 The figure shows an example of data transmission between an SP subsystem and a host computer according to an embodiment of this application; Figure 4 The figure shows a flowchart of yet another embodiment of a device debugging method according to an embodiment of this application; Figure 5 The figure shows a schematic diagram of a USB path according to an embodiment of this application; Figure 6 The figure shows a schematic diagram of a communication device according to an embodiment of this application; Figure 7 The figure shows another structural schematic diagram of a communication device according to an embodiment of this application; Figure 8 The figure shows a hardware block diagram of a terminal device according to an embodiment of this application; Figure 9 The figure shows a hardware block diagram of a host computer according to an embodiment of this application. Detailed Implementation

[0024] To make the objectives, technical solutions, and advantages of the embodiments of this application more apparent, exemplary embodiments according to the embodiments of this application will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of the embodiments of this application, and not all embodiments of the embodiments of this application. It should be understood that the embodiments of this application are not limited to the exemplary embodiments described herein.

[0025] The technical solution of this application embodiment can be applied to equipment debugging scenarios, by setting up an independently operable AP subsystem and SP subsystem in the terminal device. When the SP subsystem of the terminal device detects that the AP subsystem has crashed, it transmits system data to the host computer via USB, achieving efficient and complete transmission of system data even in the event of a crash.

[0026] To facilitate understanding of the embodiments of this application, firstly, in conjunction with Figure 1 A detailed description of the communication system applicable to embodiments of this application will be provided. The communication system may include: a terminal device 10 and a host computer 20.

[0027] The terminal device 10 can be configured with an independently operable AP (application processor) subsystem 101 and an SP (system processor) subsystem 102.

[0028] AP subsystem 101 can refer to the APCPU system in the terminal device, which can run various applications and interact with the user. When users use the various applications in AP subsystem 101, crashes frequently occur.

[0029] A watchdog can be configured in AP subsystem 101. When AP subsystem 101 is performing 10a normally, it periodically sends specific signals to watchdog 1011 to prove that it (referring to AP subsystem) is in a normal operating state.

[0030] After a hangup (10b) occurs in the AP subsystem 101, no more specific signals can be sent to the watchdog 1011. If the watchdog 1011 does not receive the specific signal within a preset timeout period, the SP subsystem will detect the hangup signal. The SP subsystem 102 detects the hangup signal from the watchdog 1011 and confirms that the AP subsystem 101 has hanged up.

[0031] Furthermore, SP subsystem 102 will monitor the watchdog 1011 of AP subsystem 101. Once the watchdog is detected to have triggered a hang-up signal, SP subsystem 102 will execute 10d to confirm that AP subsystem 101 has hanged up.

[0032] After SP subsystem 102 confirms that AP subsystem 101 has hung, it can perform the following: 10e to switch the Universal Asynchronous Receiver / Transmitter (UART) interface to the USB path; 10f to perform a handshake with the host computer via the USB path; and 10g to perform command interaction with the host computer via the USB path to execute system data transmission between the SP subsystem and the host computer.

[0033] For the host computer, after the handshake with the SP subsystem of the terminal device is completed, it can execute commands and interact with the SP subsystem of the terminal device to receive system data from the terminal device sent by the SP subsystem.

[0034] like Figure 2 The diagram shown is a flowchart of a device debugging method provided in an embodiment of this application. This device debugging method can be applied to a terminal device, which may include an independently operable AP subsystem and SP subsystem. The device debugging method may include: S201, if the SP subsystem detects that the AP subsystem has crashed, it will switch the Universal Asynchronous Receiver / Transmitter (UART) interface to the USB path.

[0035] Optionally, an AP subsystem hangup can mean that the AP subsystem can no longer operate normally, such as a black screen, software operation logic error, screen freeze or UI interface that is still and no longer refreshes, no response to input, peripheral device interruption (such as sound playback stopping, indicator lights stopping flashing, network disconnection and inability to reconnect), etc.

[0036] UART (Universal Asynchronous Receiver / Transmitter) is a serial communication interface that can operate in USB mode, meaning it supports the transmission of data encapsulated according to the USB protocol. The UART interface can connect to a USB physical adapter, which in turn connects to the host computer's USB interface to establish a USB connection.

[0037] The S202 and SP subsystems communicate with the host computer via USB.

[0038] The S203 and SP subsystems interact with the host computer via USB to execute commands and transfer system data between the SP subsystem and the host computer.

[0039] Optionally, the handshake and command interaction between the SP subsystem and the host computer can be completed through a console program.

[0040] Specifically, the SP subsystem hands over to the host computer via USB, including: the SP subsystem can start the console program; the console program hands over to the host computer via USB; and the SP subsystem executes commands and interacts with the host computer via USB, including: the console program executes commands and interacts with the host computer via USB.

[0041] Optionally, the console program can be a program in the SP subsystem or a plugin that the SP subsystem can call.

[0042] Optionally, after the host computer obtains the system data, it can display the system data on the monitor to facilitate debugging of the system data and locate the cause of the AP subsystem hangup problem.

[0043] In the technical solution provided in this application embodiment, the terminal device may include an AP subsystem and an SP subsystem, isolating the terminal device's system operation system (i.e., the AP subsystem) and monitoring system (i.e., the SP subsystem). Thus, when the AP subsystem hangs, the still independently operating SP subsystem switches the UART interface to a USB path and interacts with the host computer via the USB path. After the AP subsystem hangs, system data is quickly and completely transmitted to the host computer within a short time, ensuring the integrity and efficiency of data transmission at the fault location. Therefore, the SP subsystem, as an independent monitoring system, actively interacts with the host computer to complete timely transmission and alerts at the fault location, greatly improving the observability and maintainability of data when the AP subsystem hangs, and significantly reducing the difficulty of locating system hangs and the R&D and debugging costs.

[0044] The handshake between the terminal device and the host computer can be achieved through signal interaction. As an example, in S202, the SP subsystem hands off the host computer via a USB path, including: The SP subsystem sends a handshake signal to the host computer via the USB channel. The handshake signal is used to trigger the host computer to provide a feedback response signal. The SP subsystem receives the response signal sent by the host computer through the USB channel to complete the handshake with the host computer.

[0045] Optionally, the handshake signal can be a fixed string, such as 0x11223344. The response signal can also be a fixed string, such as 0x55667788. After the SP subsystem receives the response signal, it can determine that the handshake is complete.

[0046] In this embodiment, the SP subsystem interacts with the host computer via a USB channel. Specifically, the SP subsystem actively sends a handshake signal to the host computer and waits for a response signal. Leveraging the connectivity and data transmission characteristics of the USB channel, a communication link is established between the SP subsystem and the host computer, completing transmission preparation and significantly improving the system's data transmission success rate and stability, thus providing a reliable data foundation for subsequent fault analysis.

[0047] Command interaction between the terminal device and the host computer is mainly achieved through data reading commands. As another embodiment, S203, the SP subsystem interacts with the host computer via a USB channel to execute command interactions, thereby transferring system data between the SP subsystem and the host computer. This may include: The SP subsystem receives data read commands sent by the host computer via the USB channel; the SP subsystem then transmits the data corresponding to the data read commands to the host computer via the USB channel.

[0048] In this embodiment, the SP subsystem and the host computer transmit data read commands and corresponding data via a USB channel. This enables targeted reading of system data corresponding to the data read commands, leveraging the efficient transmission and accurate acquisition capabilities of the USB channel. Interactive data export allows developers to flexibly control data transmission, thereby selectively mining data related to hang-up faults. This significantly improves the targeting and flexibility of data transmission, providing precise data support for quickly locating system faults.

[0049] In related technologies, when a terminal device hangs, the host computer can only read a small amount of data at a time, leading to difficulties in data modulation. In this embodiment, the types and number of commands that the SP subsystem and the host computer can interact with are expanded based on the USB interface.

[0050] As another embodiment, the transmission of data corresponding to the data read command executed by the host computer includes at least one of the following: When the data read command includes a status query command, the system status information of the AP subsystem is sent to the host computer; When the data read command includes an address space read command, the data in the address space of the terminal device is sent to the host computer. The address space includes: registers, memory or RAM. When a data read command includes a write command to the address space, the data in the write command is written to the address space of the terminal device; When the data read command includes a read command for the debug bus, the real-time information transmitted on the debug bus of the terminal device is sent to the host computer. When the data read command includes a read command for register status, the register status saved by the AP subsystem in the event of a hangup is sent to the host computer; When the data read command includes a version read command, the version information of each component of the terminal device is sent to the host computer. When the data read command includes a machine read command, the device information of the terminal device is sent to the host computer.

[0051] For ease of understanding, such as Figure 3 The diagram shown is an example of data transmission between the SP subsystem and the host computer in an embodiment of this application.

[0052] refer to Figure 3 After the SP subsystem and the host computer establish a connection via USB, it can be used to execute: 301. Read system status information 302. Reading / Writing the Registers of Terminal Devices 303. Read / write terminal device memory 304. Read the real-time information transmitted on the debug bus. 305. Read the register state saved by the AP subsystem in the event of a hangup. 306. Read the version information of each component of the terminal device. 307. Read device information of terminal device For data read commands, one or more of the following can exist: Command 1, Status Query Command System status information refers to the status of various program modules or hardware / components when the system is suspended. Examples include the current status of the watchdog timer, power management status (such as battery level and supply voltage), the operating mode of each subsystem (normal / hibernate / suspended), the operating status of the SP subsystem itself, and the interrupt flag status. The status query command can be set to: sys_status.

[0053] Command 2, address space read and / or write commands Optionally, the address space read command can be set to, for example, `read [addr]`, where `read` indicates a read command type and `addr` represents the specific physical address in the address space. The address space write command can be set to, for example, `write [addr][data]`, where `write` indicates a write command type, `addr` represents the specific physical address in the address space, and `data` represents the data to be written to the address space.

[0054] Taking the address space as the register space as an example, it is possible to read the current value of the internal register of the terminal device, or modify the value of the register to change the working state of the corresponding hardware.

[0055] Taking the address space as the memory space as an example, it is possible to read real-time data from memory or write data to memory. For example, after the AP subsystem hangs, the SP subsystem can read the memory image (core dump) of the AP subsystem.

[0056] Command 3: Command to read the debug bus A debug bus can refer to a dedicated bus in a system used to transmit debug information. Executing this command will output real-time data on the bus (such as debug interactions between modules, status reporting, etc.) to help analyze problems in inter-module communication or hardware debug links.

[0057] For example, the command to read the debug bus can be set to: `dump_debug_bus`. This command allows you to read real-time information transmitted on the debug bus. This real-time information is an internal signal of the terminal device.

[0058] Command 4: Command to read register status Optionally, the command to read the register status can be set to, for example, dump_reg_autosave.

[0059] When the AP subsystem hangs (watchdog timeout), the SP subsystem automatically saves the values ​​of the AP subsystem's current critical registers (such as the program counter PC, stack pointer SP, and general-purpose registers R0-R15) to a specific storage area. Register status read commands can be used to read the storage area containing the values ​​of these critical registers to obtain their values.

[0060] Command 5, Version Reading Command Optionally, the version reading command can be set to `print_version_info` to read the version information of each component (including software and / or hardware) within the terminal device. The version information of each component includes, for example, the SP firmware version, AP operating system kernel version, Bootloader version, hardware version (HW ID), driver version, etc. By checking the version information of each component, it can be confirmed whether the software version currently running on the device is correct and whether there are any compatibility issues caused by version mismatches.

[0061] Command 6, Machine Read Command Optionally, the machine read command can be set to `print_phone_info` to read the device information of the terminal device. The device information may include, for example, the device model number, serial number / IMEI, MAC address, manufacturing date, and configured region / language. This device information can uniquely identify the device and is used for after-sales maintenance records, production line testing tracking, or to differentiate hardware configurations.

[0062] In this embodiment, the SP subsystem and the host computer define a set of refined and differentiated interaction commands, enabling the host computer to perform comprehensive and in-depth remote data read and write capabilities on faulty terminal devices. This not only supports basic checks on system status, version, and device information, but also direct access to and real-time monitoring of underlying hardware resources such as registers, memory, and debug buses. In particular, it can accurately extract various real-time data when the AP subsystem is suspended, providing more timely analytical objects for root cause analysis. Furthermore, it supports write commands, allowing the host computer to dynamically configure or urgently repair the terminal in a faulty state, thereby significantly improving the depth, breadth, and flexibility of system debugging and greatly reducing the difficulty of locating complex faults and maintenance costs.

[0063] To restore the terminal equipment to normal operation as quickly as possible, in one possible design, after the SP subsystem performs the system data transmission between the SP subsystem and the host computer, it also includes: The SP subsystem receives a restart command sent by the host computer; The SP subsystem responds to the restart command and restarts the AP subsystem.

[0064] like Figure 3 As shown, after 307, there is also: 308, Execute the restart command to restart the AP subsystem.

[0065] Optionally, the reboot command can be set to: reboot.

[0066] In this embodiment, after the SP subsystem performs system data transmission between the SP subsystem and the host computer, it can send a restart command to the SP subsystem to achieve automatic restart of the AP subsystem. This enables immediate system recovery after the data used for fault analysis is securely stored, effectively eliminating the waiting time and operational costs of manual startup, minimizing the downtime of terminal devices, and achieving rapid and automated recovery of terminal devices.

[0067] The AP subsystem of the terminal device can feed a watchdog timer to promptly notify the SP subsystem of the AP subsystem's operating status. As another embodiment, the SP subsystem detects a hangup in the AP subsystem, including: The SP subsystem monitors the watchdog of the AP subsystem.

[0068] When the SP subsystem detects a watchdog-triggered hangup signal, it determines that the AP subsystem has hanged up.

[0069] Optionally, the SP subsystem can use a watchdog program to monitor the watchdog timer of the AP subsystem. Specifically, it can monitor for CPU hangs, and if the watchdog is not fed within a timeout, it will trigger an interrupt (i.e., trigger a hangup signal) or a restart. The hangup signal can be, for example, a high-low level toggle.

[0070] In this embodiment, the SP subsystem monitors the watchdog of the AP subsystem in real time. It can quickly and accurately capture the hangup signal the moment the AP subsystem hangs up and fails to "feed the watchdog" on time. This ensures that the SP subsystem can perceive and accurately determine the fault of the AP subsystem in real time, avoid the problem of missed detection or delay of hangup, and provide the most core and timely trigger source for the SP subsystem to quickly connect the USB channel, export fault data and perform system recovery. This significantly improves the sensitivity and reliability of the system fault response.

[0071] If a user experiences a hangup while using a terminal device, it will affect the user's normal use, and the user may not understand the reason for the malfunction, leading to anxiety about recovery. To address this issue, in this embodiment, after the SP subsystem detects a hangup in the AP subsystem, it further includes: The SP subsystem triggers a hangup notification component.

[0072] In this embodiment, after the SP subsystem detects that the AP subsystem has crashed, the independently running SP subsystem actively triggers a prompt component to provide a crash notification. This effectively solves the problem that users cannot perceive the system status and recovery progress when the terminal device is unresponsive. This not only helps users accurately determine the nature of the fault, such as a crash, but also significantly alleviates users' recovery anxiety and panic through clear and predictable prompts, thereby greatly improving the user experience and interactivity of the terminal device in fault scenarios.

[0073] like Figure 4 The diagram shown is a flowchart of another embodiment of a device debugging method provided in this application. This device debugging method may include the following steps: S401. Handshake with the SP subsystem of the terminal device through the USB channel. The USB channel is a data transmission channel established between the SP subsystem of the terminal device and the host computer through the Universal Asynchronous Receiver / Transmitter (UART) interface when the AP subsystem is confirmed to be hanging.

[0074] Figure 5 This is a schematic diagram of a USB pathway provided in an embodiment of this application. Figure 5 As shown, the SUB path may include: the UART interface / USB mode 502 of the SP subsystem 501, the USB physical adapter 503, and the USB interface 505 of the host computer 504. Specifically, the UART interface 502 of the SP subsystem 501 is switched to USB mode. The UART interface / USB mode 502 is connected to the USB physical adapter 503, and the USB physical adapter 503 is connected to the USB interface 505 of the host computer 504.

[0075] The SP subsystem and the host computer communicate via Figure 5 The USB pathway shown transmits commands or data.

[0076] S402. Execute command interaction with the SP subsystem of the terminal device through the USB channel to receive system data of the terminal device sent by the SP subsystem.

[0077] Optionally, S401 may include: receiving a handshake signal sent by the terminal device via a USB channel, the handshake signal being sent by the terminal device's SP subsystem upon confirming that the AP subsystem has hanged; and sending a response signal to the terminal device's SP subsystem via the USB channel to complete the handshake with the terminal device.

[0078] In the technical solution provided in this application embodiment, the terminal device may include an AP subsystem and an SP subsystem, isolating the terminal device's system operation system (i.e., the AP subsystem) and monitoring system (i.e., the SP subsystem). Thus, when the AP subsystem hangs, the still independently operating SP subsystem switches the UART interface to a USB path and interacts with the host computer via the USB path. After the AP subsystem hangs, system data is quickly and completely transmitted to the host computer within a short time, ensuring the integrity and efficiency of data transmission at the fault location. Therefore, the SP subsystem, as an independent monitoring system, actively interacts with the host computer to complete timely transmission and alerts at the fault location, greatly improving the observability and maintainability of data when the AP subsystem hangs, and significantly reducing the difficulty of locating the problem and the R&D and debugging costs associated with system hangs.

[0079] As one embodiment, commands are executed to interact with the SP subsystem of the terminal device via a USB channel to receive system data of the terminal device sent by the SP subsystem, including: Send a data read command to the SP subsystem of the terminal device via the USB channel; Receive system data corresponding to the data read command sent by the SP subsystem via the USB channel.

[0080] In this embodiment, the SP subsystem and the host computer transmit data read commands and corresponding data via a USB channel. This enables targeted reading of system data corresponding to the data read commands, leveraging the efficient transmission and accurate acquisition capabilities of the USB channel. Interactive data export allows developers to flexibly control data transmission, thereby selectively mining data related to hang-up faults. This significantly improves the targeting and flexibility of data transmission, providing precise data support for quickly locating system faults.

[0081] As another embodiment, receiving system data corresponding to a data read command sent by the SP subsystem via the USB channel includes at least one of the following: When the data read command includes a status query command, receive the system status information of the AP subsystem sent by the SP subsystem; When the data read command includes an address space read command, the terminal device receives data in the address space sent by the SP subsystem. The address space includes: registers, memory, or RAM. When the data read command includes a write command to the address space, the write command sent to the SP subsystem includes the data that needs to be written to the address space of the terminal device; When the data read command includes a read command for the debug bus, receive real-time information transmitted on the debug bus of the terminal device sent by the SP subsystem; In the case where the data read command includes a read command for register status, receive the register status saved by the AP subsystem in the event of a hangup from the SP subsystem; When the data read command includes a version read command, receive the version information of each component of the terminal device sent by the SP subsystem; When the data read command includes a machine read command, receive the device information of the terminal device sent by the SP subsystem.

[0082] In this embodiment, the SP subsystem and the host computer define a set of refined and differentiated interaction commands, enabling the host computer to perform comprehensive and in-depth remote data read and write capabilities on faulty terminal devices. This not only supports basic checks on system status, version, and device information, but also direct access to and real-time monitoring of underlying hardware resources such as registers, memory, and debug buses. In particular, it can accurately extract various real-time data when the AP subsystem is suspended, providing more timely analytical objects for root cause analysis. Furthermore, it supports write commands, allowing the host computer to dynamically configure or urgently repair the terminal in a faulty state, thereby significantly improving the depth, breadth, and flexibility of system debugging and greatly reducing the difficulty of locating complex faults and maintenance costs.

[0083] The above text combines Figures 2 to 4 The present application describes in detail the device debugging method according to the embodiments of this application. The following will be combined with... Figure 5 and Figure 6 This application describes in detail the communication device according to embodiments of the present application.

[0084] Figure 6 This illustration shows a structural schematic of a communication device according to an embodiment of this application. The communication device can be an SP subsystem of a terminal device, and the terminal device may further include an AP subsystem operating independently of the SP subsystem. The communication device 600 may include: The detection unit 601 is used to switch the Universal Asynchronous Receiver / Transmitter (UART) interface to the USB path when the AP subsystem is detected to be hanging.

[0085] The handshake unit 602 is used to handshake with the host computer via the USB path; The interaction unit 603 is used to interact with the host computer via USB to execute commands, so as to perform the transmission of system data between the SP subsystem and the host computer.

[0086] As one embodiment, the handshake unit 602 includes: The signal sending module is used to send a handshake signal to the host computer via the USB channel. The handshake signal is used to trigger the host computer to provide a feedback response signal. The signal receiving module is used to receive response signals sent by the host computer through the USB channel to complete the handshake with the host computer.

[0087] As another embodiment, the interaction unit 603 includes: The command receiving module is used to receive data read commands sent by the host computer via the USB channel; The data transmission module is used to transmit data to the host computer via USB to execute data reading commands.

[0088] As yet another embodiment, the data transmission module is specifically configured to perform at least one of the following: When the data read command includes a status query command, the system status information of the AP subsystem is sent to the host computer; When the data read command includes an address space read command, the data in the address space of the terminal device is sent to the host computer. The address space includes: registers, memory or RAM. When a data read command includes a write command to the address space, the data in the write command is written to the address space of the terminal device; When the data read command includes a read command for the debug bus, the real-time information transmitted on the debug bus of the terminal device is sent to the host computer. When the data read command includes a read command for register status, the register status saved by the AP subsystem in the event of a hangup is sent to the host computer; When the data read command includes a version read command, the version information of each component of the terminal device is sent to the host computer. When the data read command includes a machine read command, the device information of the terminal device is sent to the host computer.

[0089] As another embodiment, after performing the transmission of system data between the SP subsystem and the host computer, the process further includes: The restart command unit is used to receive restart commands sent by the host computer. The system restart unit is used to restart the AP subsystem in response to a restart command.

[0090] As another embodiment, the detection unit 601: The watchdog detection module is used to monitor the watchdog timer of the AP subsystem. The hang-up trigger module is used to determine that the AP subsystem has hanged up when a watchdog-triggered hang-up signal is detected.

[0091] As yet another embodiment, it also includes: The hang-up notification unit is used to trigger the notification component to display a hang-up notification.

[0092] like Figure 7 The diagram shown is a structural schematic of a communication device provided in an embodiment of this application. This communication device can be located in a host computer, and the communication device 700 may include the following units: The handshake unit 701 is used to handshake with the SP subsystem of the terminal device through the USB path. The USB path is a data transmission path established between the SP subsystem of the terminal device and the host computer through the Universal Asynchronous Receiver / Transmitter (UART) interface when it is confirmed that the AP subsystem has hanged. The interaction unit 702 is used to execute command interaction with the SP subsystem of the terminal device through the USB channel to receive system data of the terminal device sent by the SP subsystem.

[0093] As one embodiment, the handshake unit 701 includes: The handshake receiving module is used to receive handshake signals sent by the terminal device through the USB channel. The handshake signal is sent by the SP subsystem of the terminal device when it is confirmed that the AP subsystem has hanged.

[0094] The handshake response module is used to send a response signal to the SP subsystem of the terminal device via the USB channel to complete the handshake with the terminal device.

[0095] As another embodiment, the interaction unit 702 includes: The command sending module is used to send data read commands to the SP subsystem of the terminal device via the USB channel; The data receiving module is used to receive system data corresponding to data read commands sent by the SP subsystem via the USB channel.

[0096] It should be understood that the devices 600 and 700 here are embodied in the form of functional units. The term "unit" here can refer to application-specific integrated circuits (ASICs), electronic circuits, processors (e.g., shared processors, proprietary processors, or group processors, etc.) and memories for executing one or more software or firmware programs, combined logic circuits, and / or other suitable components supporting the described functions. In an alternative example, those skilled in the art will understand that devices 600 and 700 can specifically be the terminal devices in the above embodiments, and devices 600 and 700 can be used to execute the various processes and / or steps corresponding to the terminal devices in the above method embodiments; to avoid repetition, these will not be described again here.

[0097] The devices 600 and 700 of the above-described solutions have the function of implementing the corresponding steps performed by the terminal device in the above-described methods; the above functions can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions. For example, the devices 600 and 700 may include a transmitting unit and a receiving unit. The transmitting unit can be used to implement the various steps and / or processes corresponding to the transmitting and receiving unit for performing the transmitting action, and the receiving unit can be used to implement the various steps and / or processes corresponding to the transmitting and receiving unit for performing the receiving action. The transmitting unit can be replaced by a transmitter, and the receiving unit can be replaced by a receiver, respectively performing the transmitting and receiving operations and related processing operations in each method embodiment.

[0098] In the embodiments of this application, Figure 6 , Figure 7 The devices 600 and 700 mentioned can also be chips or chip systems, such as system-on-chip (SoC). No limitation is made here.

[0099] Figure 8 A schematic block diagram of another terminal device 800 provided in an embodiment of this application is shown. The terminal device 800 includes a processor 810 and a memory 820. The processor 810 and the memory 820 communicate with each other via an internal connection. The memory 820 stores computer programs for the AP subsystem and the SP subsystem, respectively. The processor 810 executes the computer program for the SP subsystem stored in the memory 820 to perform the various processes and steps corresponding to the device debugging method executed by the terminal device in the above-described method.

[0100] The processor 810 is used to: switch the Universal Asynchronous Receiver / Transmitter (UART) interface to the USB path when the AP subsystem is detected to be hanging; handshake with the host computer through the USB path; and execute command interaction with the host computer through the USB path to perform system data transmission between the SP subsystem and the host computer.

[0101] Figure 9 A schematic block diagram of another host computer 900 provided in an embodiment of this application is shown. The host computer 900 includes a processor 910 and a memory 920. The processor 910 and the memory 920 communicate with each other via an internal connection. The memory 920 stores computer programs, and the processor 910 executes the computer programs stored in the memory 920 to perform the various processes and steps corresponding to the device debugging method executed by the host computer in the above-described method.

[0102] The processor 910 is used to: handshake with the SP subsystem of the terminal device via a USB channel, which is a data transmission channel established between the SP subsystem of the terminal device and the host computer through the Universal Asynchronous Receiver / Transmitter (UART) interface when the AP subsystem is confirmed to be hanging; and to execute command interaction with the SP subsystem of the terminal device via the USB channel to receive system data of the terminal device sent by the SP subsystem.

[0103] It should be understood that, in the embodiments of this application, the processor of the above-described device can be a central processing unit (CPU), which can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.

[0104] In implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software. The steps of the method disclosed in the embodiments of this application can be directly manifested as execution by a hardware processor, or as a combination of hardware and software units within the processor. The software units can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory, and the processor executes the instructions in the memory, combining them with its hardware to complete the steps of the above method. To avoid repetition, detailed descriptions are omitted here.

[0105] This application also provides a communication system, which may include the above-described... Figure 8 The terminal device shown, and the above Figure 9 The host computer shown.

[0106] This application provides a readable computer storage medium for storing a computer program that implements the methods corresponding to the terminal devices shown in the various possible implementations of the above embodiments.

[0107] This application provides another readable computer storage medium for storing a computer program that implements the methods corresponding to the host computer shown in the various possible implementations of the above embodiments.

[0108] This application provides a computer program product, which includes a computer program (also known as code or instructions). When the computer program is run on a computer, the computer can execute the method corresponding to the terminal device shown in the above embodiments.

[0109] This application provides another computer program product, which includes a computer program (also called code or instructions). When the computer program is run on a computer, the computer can execute the methods corresponding to the host computer shown in the various possible implementations of the above embodiments.

[0110] This application provides a chip system for supporting the terminal device described above to implement the functions shown in this application.

[0111] This application provides another chip system for supporting the host computer to implement the functions shown in this application.

[0112] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0113] 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.

[0114] 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. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0115] 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.

[0116] 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.

[0117] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a 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 part 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, a server, or a receiving end, etc.) to execute all or part of the steps of the methods of 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.

[0118] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included 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 method for debugging equipment, characterized in that, Applied to a terminal device, the terminal device including an application processor (AP) subsystem and a system processor (SP) subsystem, the method includes: If the SP subsystem detects that the AP subsystem has hung up, it will switch the Universal Asynchronous Receiver / Transmitter (UART) interface to the Universal Serial Interface (USB) path. The SP subsystem communicates with the host computer via the USB channel. The SP subsystem interacts with the host computer via the USB channel to execute commands and perform system data transmission between the SP subsystem and the host computer.

2. The method according to claim 1, characterized in that, The SP subsystem hands together with the host computer via the USB channel, including: The SP subsystem sends a handshake signal to the host computer through the USB channel, and the handshake signal is used to trigger the host computer to provide a feedback response signal. The SP subsystem receives the response signal sent by the host computer through the USB channel to complete the handshake with the host computer.

3. The method according to claim 1 or 2, characterized in that, The SP subsystem interacts with the host computer via the USB channel to execute commands, thereby transmitting system data between the SP subsystem and the host computer, including: The SP subsystem receives a data read command sent by the host computer through the USB channel; The SP subsystem transmits data to the host computer via the USB channel, corresponding to the data read command.

4. The method according to claim 3, characterized in that, The transmission of data corresponding to the data read command executed by the host computer includes at least one of the following: If the data read command includes a status query command, the system status information of the AP subsystem is sent to the host computer. When the data read command includes an address space read command, the data in the address space of the terminal device is sent to the host computer, wherein the address space includes: registers, memory or RAM; If the data read command includes a write command for the address space, the data in the write command is written into the address space of the terminal device; When the data read command includes a read command for the debug bus, the real-time information transmitted on the debug bus of the terminal device is sent to the host computer. When the data read command includes a register status read command, the register status saved by the AP subsystem in the event of a hangup is sent to the host computer; If the data reading command includes a version reading command, the version information of each component of the terminal device is sent to the host computer. When the data reading command includes a machine reading command, the device information of the terminal device is sent to the host computer.

5. The method according to any one of claims 1-4, characterized in that, After the process of transmitting system data between the SP subsystem and the host computer, the method further includes: The SP subsystem receives the restart command sent by the host computer; The SP subsystem responds to the restart command and restarts the AP subsystem.

6. The method according to any one of claims 1-5, characterized in that, The SP subsystem detects that the AP subsystem has crashed, including: The SP subsystem monitors the watchdog of the AP subsystem; When the SP subsystem detects a watchdog-triggered hangup signal, it determines that the AP subsystem has hanged up.

7. The method according to any one of claims 1-6, characterized in that, After the SP subsystem detects that the AP subsystem has hanged, it also includes: The SP subsystem triggers a hangup notification component.

8. A method for debugging equipment, characterized in that, Applied to a host computer, the method includes: The terminal device's SP subsystem is handshaked via a USB path. This USB path is a data transmission path established between the terminal device's SP subsystem and the host computer via a Universal Asynchronous Receiver / Transmitter (UART) interface when the AP subsystem is confirmed to be hanging. The terminal device's SP subsystem is accessed via the USB channel to execute commands and interact with the terminal device, thereby receiving system data from the SP subsystem.

9. A terminal device, characterized in that, include: A memory and a processor, wherein the memory is used to store computer programs for the AP subsystem and the SP subsystem respectively, and the computer program of the SP subsystem is invoked by the processor to execute the device debugging method according to any one of claims 1-7.

10. A host computer, characterized in that, include: A memory and a processor, the memory being used to store a computer program, the computer program being invoked by the processor to execute the device debugging method of claim 8.