Method, device and equipment for switching USB signal and debugging signal
By detecting the working mode of the equipment and switching signal paths, using switching switches and synchronization control, the difficulty of signal switching caused by independent debugging interface and USB interface is solved, and accurate and efficient signal switching and stable transmission are achieved, and fast problem positioning is supported.
Patent Information
- Application Number
- CN202510427458.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-07
- Publication Date
- 2025-07-04
AI Technical Summary
In the prior art, the debugging interface is independent of the USB interface, which makes it difficult to efficiently switch signals when encountering occasional problems, destroying the on-site state and affecting the recurrence of problems.
By detecting the operating mode requirements of the equipment, switching the signal path to the USB signal or debug signal transmission path, and accurate and efficient signal switching is achieved using switching switches and synchronization control, including signal quality detection and compensation.
It realizes accurate and efficient switching between USB signals and debug signals, ensures stable signal transmission, and supports rapid problem positioning and resolution.
Smart Images

Figure CN120256356A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer debugging technology, for example, it relates to a method, device, and equipment for switching between USB signals and debugging signals. Background Art
[0002] Functional debugging is an important part of the equipment development process and an indispensable part of problem location and solution; generally, the debugging interface and the USB interface are independent of each other. During functional debugging, the debugging interface needs to be led out to carry out relevant debugging work.
[0003] In the process of overall machine debugging and testing, if occasional problems occur and the debugging interface is needed, if the relevant debugging signals are not led out in advance, it is very difficult to locate the cause of the problem only by the characteristics of the problem manifestation. At this time, to locate the cause of the problem, the debugging signals must be used; if the relevant debugging interface needs to be led out, the whole machine needs to be powered off and disassembled and assembled. Then the problem site state at this time is damaged, which may cause this problem to be difficult to reproduce later and the problem cannot be quickly located.
[0004] Therefore, in the existing functional debugging process, signals cannot be efficiently switched.
[0005] It should be noted that the information disclosed in the above background art section is only used to strengthen the understanding of the background of this application. Summary of the Invention
[0006] To have a basic understanding of some aspects of the disclosed embodiments, a simple summary is given below. This summary is not a general review, nor is it intended to identify key / important constituent elements or delineate the protection scope of these embodiments, but rather serves as a preface to the subsequent detailed description.
[0007] Embodiments of the present disclosure provide a method for switching between USB signals and debugging signals, and the method includes:
[0008] Detect the working mode requirements of the device, and the working mode requirements include USB data transmission mode and debugging mode;
[0009] When it is detected that the working mode requirement is the USB data transmission mode, switch the signal path to the USB signal transmission path, and the USB signal transmission path is used to connect the USB interface and the data processing unit to achieve data transmission of the device;
[0010] When it is detected that the working mode requirement is the debugging mode, switch the signal path to the debugging signal transmission path, and the debugging signal transmission path is used to connect the debugging interface and the debugging processing unit to achieve debugging of the device.
[0011] In some embodiments, the method may further include:
[0012] Receive the working mode selection instruction input by the user through the operation interface of the device;
[0013] Determine the working mode requirement of the device according to the working mode selection instruction.
[0014] In some embodiments, detecting the working mode requirement of the above-mentioned detection device may include:
[0015] Detect the system status information of the device, and the system status information includes the startup status, running status, and error status of the device;
[0016] Judge the working mode requirement of the device according to the system status information.
[0017] In some embodiments, switching the signal path to the USB signal transmission path may include:
[0018] Based on the switching signal, control the switching switch to connect the differential data lines DP and DM of the USB interface to the pins of the data processing unit;
[0019] Disconnect the connection between the debug interface and the debug processing unit.
[0020] In some embodiments, switching the signal path to the debug signal transmission path may include:
[0021] Based on the switching signal, control the switching switch to connect the debug signal line of the debug interface to the corresponding debug pin of the debug processing unit;
[0022] Disconnect the connection between the USB interface and the data processing unit.
[0023] In some embodiments, the above method may further include:
[0024] During the signal path switching process, perform synchronous control on the switching operation to ensure the stable transmission of signals during the switching process.
[0025] In some embodiments, performing synchronous control on the switching operation may include:
[0026] Before switching the signal path, send a synchronization signal to the corresponding signal processing unit for the signal processing unit to record the signal path switching;
[0027] After receiving the confirmation response from the corresponding signal processing unit, perform the signal path switching operation.
[0028] In some embodiments, the above method may further include:
[0029] After the signal path switching is completed, perform signal quality detection on the switched signal path;
[0030] If the detected signal quality does not meet the preset standard, signal compensation is performed or the signal path is re-switched.
[0031] An embodiment of the present disclosure provides a switching device for USB signals and debugging signals, the device comprising:
[0032] A detection module, configured to detect the working mode requirements of the device, where the working mode requirements include a USB data transmission mode and a debugging mode;
[0033] A switching module, configured to switch the signal path to a USB signal transmission path when it is detected that the working mode requirement is the USB data transmission mode, where the USB signal transmission path is used to connect a USB interface and a data processing unit to implement data transmission of the device;
[0034] The switching module is further configured to switch the signal path to a debugging signal transmission path when it is detected that the working mode requirement is the debugging mode, where the debugging signal transmission path is used to connect a debugging interface and a debugging processing unit to implement debugging of the device.
[0035] An embodiment of the present disclosure provides an electronic device, the device comprising at least one processor;
[0036] And a memory communicatively connected to the at least one processor;
[0037] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the above-mentioned method for switching USB signals and debugging signals.
[0038] The method, device, and equipment for switching USB signals and debugging signals provided by the embodiments of the present disclosure can achieve the following technical effects:
[0039] The method for switching USB signals and debugging signals provided by the present disclosure is based on a switching circuit, and by controlling the change of the switching signal, the signal path is switched, so that accurate and efficient switching of USB signals and debugging signals can be achieved.
[0040] The above general description and the following description are only exemplary and explanatory, and are not used to limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] One or more embodiments are exemplarily illustrated by corresponding drawings, and these exemplary illustrations and the drawings do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are shown as similar elements. The drawings do not constitute a scale limitation, and among them:
[0042] Figure 1It is a schematic flowchart of a method for switching between USB signals and debugging signals provided by an embodiment of the present disclosure;
[0043] Figure 2 It is a schematic switching diagram of a switching circuit provided by an embodiment of the present disclosure;
[0044] Figure 3 It is a schematic structural diagram of a device for switching between USB signals and debugging signals provided by an embodiment of the present disclosure;
[0045] Figure 4 It is a schematic structural diagram of a device for switching between USB signals and debugging signals provided by an embodiment of the present disclosure. Detailed implementation manners
[0046] In order to be able to understand the features and technical content of the embodiments of the present disclosure in more detail, the implementation of the embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings. The accompanying drawings are only for reference and illustration purposes and are not used to limit the embodiments of the present disclosure. In the following technical description, for the sake of explanation, multiple details are provided to give a full understanding of the disclosed embodiments. However, one or more embodiments can still be implemented without these details. In other cases, well-known structures and devices can be shown in a simplified manner.
[0047] Terms such as "first" and "second" in the embodiments of the present disclosure are used to distinguish similar objects and do not necessarily have to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so as to implement the embodiments of the present disclosure described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion.
[0048] Unless otherwise specified, the term "plurality" means two or more.
[0049] In the embodiments of the present disclosure, the character " / " indicates that the objects before and after are in an "or" relationship. For example, A / B means: A or B.
[0050] The term "and / or" is a description of the association relationship of an object, indicating that there can be three relationships. For example, A and / or B means: A or B, or, the three relationships of A and B.
[0051] The term "correspond" can refer to an association relationship or a binding relationship. A corresponding to B means that there is an association relationship or a binding relationship between A and B.
[0052] To solve the above problems, the present disclosure provides a method, a device, and a device for switching between USB signals and debugging signals.
[0053] The following describes the method, apparatus, and device for switching between USB signals and debugging signals provided by the embodiments of the present disclosure with reference to the accompanying drawings.
[0054] Figure 1 It is a schematic flowchart of a method for switching between USB signals and debugging signals provided by the embodiments of the present disclosure.
[0055] Combined with Figure 1 As shown, the method for switching between USB signals and debugging signals may include:
[0056] S101, detecting the working mode requirements of the device, where the working mode requirements include the USB data transfer mode and the debugging mode;
[0057] S102, when it is detected that the working mode requirement is the USB data transfer mode, switching the signal path to the USB signal transmission path, and the USB signal transmission path is used to connect the USB interface and the data processing unit to implement data transfer of the device;
[0058] S103, when it is detected that the working mode requirement is the debugging mode, switching the signal path to the debugging signal transmission path, and the debugging signal transmission path is used to connect the debugging interface and the debugging processing unit to implement debugging of the device.
[0059] In some embodiments, Figure 1 the method in
[0060] may further include:
[0061] Receiving a working mode selection instruction input by the user through the operation interface of the device;
[0062] Determining the working mode requirements of the device according to the working mode selection instruction.
[0063] In some embodiments, the above-mentioned detecting the working mode requirements of the device may include:
[0064] Detecting the system status information of the device, where the system status information includes the startup status, running status, and error status of the device;
[0065] In some embodiments, the above-mentioned switching the signal path to the USB signal transmission path may include:
[0066] Based on the switching signal, controlling the switching switch to connect the differential data lines DP and DM of the USB interface to the pins of the data processing unit;
[0067] Disconnecting the connection between the debugging interface and the debugging processing unit.
[0068] In some embodiments, switching the signal path to the debug signal transmission path may include:
[0069] Controlling a switching switch based on a switching signal to connect a debug signal line of a debug interface to a corresponding debug pin of a debug processing unit;
[0070] Disconnecting the connection between the USB interface and the data processing unit.
[0071] In some embodiments, Figure 1 the method in
[0072] may further include:
[0073] During the signal path switching process, synchronously controlling the switching operation to ensure stable signal transmission during the switching process.
[0074] Before switching the signal path, sending a synchronization signal to the corresponding signal processing unit for the signal processing unit to record the signal path switching;
[0075] After receiving the confirmation response from the corresponding signal processing unit, performing the signal path switching operation.
[0076] In some embodiments, Figure 1 the method in
[0077] may further include:
[0078] After the signal path switching is completed, performing signal quality detection on the switched signal path;
[0079] If it is detected that the signal quality does not meet the preset standard, perform signal compensation or re-switch the signal path.
[0080] Specifically, performing signal quality detection on the switched signal path includes detecting the quality of the USB signal and the debug signal, and thus signal compensation for signals that do not meet the preset standard can be achieved.
[0081] For debugging signal compensation: If the level of the debugging signal is abnormal, the signal level can be adjusted to the standard range through a level conversion circuit. If the signal frequency is abnormal, a frequency adjustment circuit can be used to calibrate the signal frequency to restore it to the standard frequency. For signal integrity issues, terminal matching resistors, decoupling capacitors, etc. can be used to improve the transmission characteristics of the signal, reduce reflections and interference, and improve signal integrity.
[0082] If the signal quality still does not meet the preset standard after signal compensation, the signal path switching operation is performed again. The working mode requirements of the device are detected again, and the USB signal transmission path or the debugging signal transmission path is reselected according to the requirements, and the above signal quality detection and compensation steps are repeated until the signal quality meets the preset standard.
[0083] Figure 2 is the switching schematic diagram of a switching circuit provided by an embodiment of the present disclosure. In combination with Figure 2 , for Figure 1 the switching method of the USB signal and the debugging signal in is further described.
[0084] In Figure 2 , U1 is a switching switch, which switches different output channels by changing the level state of the control signal (Switch_Ctrl), thereby realizing the switching of the USB signal and the debugging signal; under normal circumstances, the channel is default switched to the USB signal side, where the control signal is the above-mentioned switching signal.
[0085] In a specific example, a shortcut key (such as F1+0) can be defined in the firmware to realize the switching of the USB signal and the debugging signal functions. The default channel is switched to the USB signal. When the debugging signal needs to be used, the shortcut key is used to switch the channel to the debugging signal channel side for function debugging; after the debugging is completed, pressing the shortcut key again can switch the channel to the USB signal. The specific situation can be set according to actual needs.
[0086] The switching method of the USB signal and the debugging signal provided by the present disclosure can, based on the above switching circuit, switch the signal path by controlling the change of the switching signal, and thus can realize the accurate and efficient switching of the USB signal and the debugging signal.
[0087] Corresponding to the switching method of the USB signal and the debugging signal in Figure 1 , the present disclosure also provides a switching device for the USB signal and the debugging signal. As shown in Figure 3 , the switching device for the USB signal and the debugging signal may include:
[0088] The detection module 301 is used to detect the working mode requirements of the device, and the working mode requirements include the USB data transmission mode and the debugging mode;
[0089] The switching module 302 is used to switch the signal path to the USB signal transmission path when it is detected that the working mode requirement is the USB data transmission mode. The USB signal transmission path is used to connect the USB interface and the data processing unit to achieve data transmission of the device;
[0090] The switching module 302 is also used to switch the signal path to the debugging signal transmission path when it is detected that the working mode requirement is the debugging mode. The debugging signal transmission path is used to connect the debugging interface and the debugging processing unit to achieve debugging of the device.
[0091] In some embodiments, the detection module 301 is further used to receive a working mode selection instruction input by the user through the operation interface of the device; and determine the working mode requirement of the device according to the working mode selection instruction.
[0092] In some embodiments, the above-mentioned detection of the working mode requirement of the device includes:
[0093] Detect the system status information of the device, and the system status information includes the startup status, running status and error status of the device;
[0094] Judge the working mode requirement of the device according to the system status information.
[0095] In some embodiments, the above-mentioned switching of the signal path to the USB signal transmission path includes:
[0096] Based on the switching signal, control the switching switch to connect the differential data lines DP and DM of the USB interface to the pins of the data processing unit;
[0097] Disconnect the connection between the debugging interface and the debugging processing unit.
[0098] In some embodiments, the above-mentioned switching of the signal path to the debugging signal transmission path includes:
[0099] Based on the switching signal, control the switching switch to connect the debugging signal line of the debugging interface to the corresponding debugging pin of the debugging processing unit;
[0100] Disconnect the connection between the USB interface and the data processing unit.
[0101] In some embodiments, during the signal path switching process, synchronous control can also be performed on the switching operation to ensure stable signal transmission during the switching process.
[0102] In some embodiments, the above-mentioned synchronous control of the switching operation includes:
[0103] Before switching the signal path, a synchronization signal is sent to the corresponding signal processing unit for the signal processing unit to record the signal path switching;
[0104] After receiving the confirmation response from the corresponding signal processing unit, perform the signal path switching operation.
[0105] In some embodiments, the above switching device may further include a detection module for detecting the signal quality of the switched signal path after the signal path switching is completed; if the detected signal quality does not meet the preset standard, signal compensation or re-switching of the signal path is performed.
[0106] Combined with Figure 4 As shown, an embodiment of the present disclosure also provides a switching device 400 for USB signals and debugging signals, including a processor 404 and a memory 401. Optionally, the system may further include a communication interface 402 and a bus 403. Among them, the processor 404, the communication interface 402, and the memory 401 can communicate with each other through the bus 403. The communication interface 402 can be used for information transmission. The processor 404 can call the logical instructions in the memory 401 to execute the USB signal and debugging signal switching method of the above embodiment.
[0107] In addition, when the logical instructions in the above memory 401 are implemented in the form of a software functional unit and sold or used as an independent product, they can be stored in a computer-readable storage medium.
[0108] The memory 401, as a computer-readable storage medium, can be used to store software programs and computer-executable programs, such as the program instructions / modules corresponding to the methods in the embodiments of the present disclosure. The processor 404 executes functional applications and data processing by running the program instructions / modules stored in the memory 401, that is, implements the USB signal and debugging signal switching method in the above embodiment.
[0109] The memory 401 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system and application programs required for at least one function; the data storage area can store data created according to the use of the terminal device, etc. In addition, the memory 401 may include a high-speed random access memory and may also include a non-volatile memory.
[0110] An embodiment of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, and the computer-executable instructions are set as the USB signal and debugging signal switching method.
[0111] The above computer-readable storage medium may be a transient computer-readable storage medium or a non-transient computer-readable storage medium.
[0112] The technical solution of the embodiments of the present disclosure may be embodied in the form of a software product. The computer software product is stored in a storage medium and includes one or more instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method of the embodiments of the present disclosure. The foregoing storage medium may be a non-transient storage medium, including: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes, or may also be a transient storage medium.
[0113] The above description and the drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process, and other changes. The embodiments only represent possible variations. Unless explicitly required, the individual components and functions are optional, and the order of operations may vary. Parts and features of some embodiments may be included in or substituted for parts and features of other embodiments. As used in the description of the embodiments, unless the context clearly indicates otherwise, the singular forms "a", "an", and "the" are intended to also include the plural forms. Similarly, as used in this application, the term "and / or" refers to any and all possible combinations including one or more of the associated listed items. Additionally, when used in this application, the term "comprise" and its variants "comprises" and / or "comprising" etc. mean the presence of the stated features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or groups thereof. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, or device comprising the element. In this document, each embodiment may focus on the differences from other embodiments, and the same or similar parts among the various embodiments may be referred to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, the relevant parts may refer to the description of the method part.
[0114] Those skilled in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner may depend on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods for each specific application to implement the described functions, but such implementation should not be considered to exceed the scope of the embodiments of the present disclosure. Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments, and will not be elaborated herein.
[0115] In the embodiments disclosed herein, the disclosed methods, products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of units can be merely a logical function division, and there can be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces, and the indirect couplings or communication connections of devices or units can be in electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to implement this embodiment. In addition, in the embodiments of the present disclosure, the functional units can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.
[0116] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a part of code, which contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions noted in the blocks may occur in an order different from that noted in the accompanying drawings. For example, two consecutive blocks may actually be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending on the functions involved. In the descriptions corresponding to the flowcharts and block diagrams in the accompanying drawings, the operations or steps corresponding to different blocks may also occur in an order different from that disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps may actually be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending on the functions involved. Each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
[0117] The various embodiments of the systems and techniques described above in this document can be implemented in digital electronic circuitry, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a dedicated or general-purpose programmable processor, and can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit the data and instructions to the storage system, the at least one input device, and the at least one output device.
[0118] The program code for implementing the methods of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to the processor or controller of a general-purpose computer, a dedicated computer, or other programmable data processing device, such that when the program codes are executed by the processor or controller, the functions / operations specified in the flowchart and / or block diagram are implemented. The program codes can be executed entirely on the machine, partially on the machine, as an independent software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0119] In the context of this disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0120] In order to provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, speech input, or tactile input).
[0121] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0122] A computer system can include a client and a server. The client and the server are generally remote from each other and typically interact through a communication network. The relationship between the client and the server is generated by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, or a server of a distributed system, or a server incorporating a blockchain.
[0123] It should be understood that the various forms of processes shown above can be used, with steps reordered, added or deleted. For example, the steps recited in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of this disclosure can be achieved, and no limitation is imposed herein.
[0124] The above specific embodiments do not constitute a limitation on the protection scope of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub - combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this disclosure shall be included within the protection scope of this disclosure.
Claims
1. A method for switching between USB signals and debugging signals, characterized in that, The method includes: Detecting the working mode requirements of the device, where the working mode requirements include USB data transfer mode and debugging mode; When it is detected that the working mode requirement is the USB data transfer mode, switching the signal path to the USB signal transmission path, where the USB signal transmission path is used to connect the USB interface and the data processing unit to achieve data transfer of the device; When it is detected that the working mode requirement is the debugging mode, switching the signal path to the debugging signal transmission path, where the debugging signal transmission path is used to connect the debugging interface and the debugging processing unit to achieve debugging of the device.
2. The method according to claim 1, wherein The method further includes: Receiving a working mode selection instruction input by the user through the operation interface of the device; Determining the working mode requirements of the device according to the working mode selection instruction.
3. The method according to claim 1, wherein The detecting the working mode requirements of the device includes: Detecting the system status information of the device, where the system status information includes the startup status, running status, and error status of the device; Judging the working mode requirements of the device according to the system status information.
4. The method according to claim 1, wherein The switching the signal path to the USB signal transmission path includes: Based on a switching signal, controlling a switching switch to connect the differential data lines DP and DM of the USB interface to the pins of the data processing unit; Disconnecting the connection between the debugging interface and the debugging processing unit.
5. The method according to claim 1, wherein The switching the signal path to the debugging signal transmission path includes: Based on a switching signal, controlling a switching switch to connect the debugging signal line of the debugging interface to the corresponding debugging pin of the debugging processing unit; Disconnecting the connection between the USB interface and the data processing unit.
6. The method according to claim 1, characterized in that, The method further includes: During the signal path switching process, performing synchronous control on the switching operation to ensure stable signal transmission during the switching process.
7. The method according to claim 6, wherein The performing synchronous control on the switching operation includes: Before switching the signal path, sending a synchronous signal to the corresponding signal processing unit for the signal processing unit to record the signal path switching; After receiving the confirmation response from the corresponding signal processing unit, performing the signal path switching operation.
8. The method according to claim 1, characterized in that, The method further includes: After the signal path switching is completed, performing signal quality detection on the switched signal path; If it is detected that the signal quality does not meet the preset standard, performing signal compensation or re-switching the signal path.
9. A switching device for USB signals and debugging signals, characterized in that The device includes: A detection module for detecting the working mode requirements of the device, where the working mode requirements include USB data transfer mode and debugging mode; A switching module for, when it is detected that the working mode requirement is the USB data transfer mode, switching the signal path to the USB signal transmission path, where the USB signal transmission path is used to connect the USB interface and the data processing unit to achieve data transfer of the device; The switching module is further used for, when it is detected that the working mode requirement is the debugging mode, switching the signal path to the debugging signal transmission path, where the debugging signal transmission path is used to connect the debugging interface and the debugging processing unit to achieve debugging of the device.
10. An electronic device, characterized in that, Includes: At least one processor; And a memory communicatively connected to the at least one processor; The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method according to any one of claims 1-8.