Debugging circuit, first electronic equipment and debugging device
By designing a debugging circuit for handheld terminal equipment and determining the debugging mode using external voltage values, the problem of low debugging efficiency in the prior art is solved, and efficient disassembly-free debugging is achieved.
Patent Information
- Application Number
- CN202421223851.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Utility models(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-30
- Publication Date
- 2025-02-21
- Estimated Expiration
- 2034-05-30
AI Technical Summary
In the prior art, when debugging handheld terminal devices using serial debugging ports (SWD), the machine needs to be disassembled to fly the line, resulting in low debugging efficiency.
A debugging circuit is designed, including a control module, a switching module and an external interface. By obtaining the external voltage value, the debugging mode is determined to achieve switching the debugging mode without disassembly.
It improves the debugging efficiency of handheld terminal equipment and realizes debugging and analysis without disassembling the equipment.
Smart Images

Figure CN222514730U_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of electronic technology, and relates to but is not limited to a debugging circuit, a first electronic device, and a debugging device. Background Art
[0002] The Serial Wire Debug Port (SWD) is one of the two debug interfaces supported by Advanced RISC Machine (ARM) architecture System on Chip (SoC). It requires two signals to complete the functions that the five-wire Joint Test Action Group (JTAG) can complete. Therefore, it is widely used in various handheld device terminals using ARM architecture, such as mobile phones and tablets. When these devices need to use SWD to assist in abnormal analysis in the form of a complete machine, they often need to be disassembled and wired on the printed circuit board (PCB), resulting in low efficiency in using SWD to debug handheld terminal devices. Utility Model Content
[0003] In view of this, the technical solution of the embodiment of the present application is implemented as follows:
[0004] In a first aspect, an embodiment of the present application provides a debugging circuit, which is applied to a first electronic device, and the debugging circuit includes a control module, a switching module, and an external interface of the first electronic device, wherein:
[0005] The input end of the control module is connected to the external interface, and is used to use the external interface to obtain an external voltage value transmitted by a debugging device connected to the external interface;
[0006] The output end of the control module is connected to the switching module, and is used to control the switching module to switch to the first debugging mode when it is determined that the external voltage value belongs to the preset voltage range.
[0007] In a second aspect, an embodiment of the present application provides a first electronic device, which includes: a housing, a body, and a debugging circuit as described in the above method.
[0008] In a third aspect, an embodiment of the present application provides a debugging device, the device comprising: a first interface connected to a first electronic device, a second interface connected to a second electronic device, a third interface connected to a third electronic device, and an output voltage adjustment unit, wherein:
[0009] The second electronic device is used to debug the first electronic device in the first debugging mode through the debugging device, and the third electronic device is used to debug the first electronic device in the second debugging mode through the debugging device;
[0010] The output voltage adjustment unit is used to adjust the external voltage value output to the first electronic device, so that the first electronic device determines a debugging mode based on the external voltage value. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 A schematic diagram of a debugging circuit is provided for an embodiment of the present application;
[0012] Figure 2A A schematic diagram of a control module provided in an embodiment of the present application;
[0013] Figure 2B A schematic diagram of a control module provided in an embodiment of the present application;
[0014] Figure 3 A schematic diagram of a control module provided in an embodiment of the present application;
[0015] Figure 4 A schematic diagram of the structure of a first electronic device is provided for an embodiment of the present application;
[0016] Figure 5A A schematic diagram of the structure of a debugging device provided in an embodiment of the present application;
[0017] Figure 5B A schematic diagram of the structure of a voltage adjustment unit provided in an embodiment of the application;
[0018] Fig. 6A A structural schematic diagram of an electronic device to be debugged is provided for an embodiment of the present application;
[0019] Figure 6B A schematic diagram of the structure of a debugging board is provided for an embodiment of the present application. DETAILED DESCRIPTION
[0020] To make the technical solutions and advantages of the embodiments of the present application clearer, the specific technical solutions of the present application will be further described in detail below in conjunction with the drawings in the embodiments of the present application. The following embodiments are used to illustrate the present application but are not intended to limit the scope of the present application.
[0021] When describing the embodiments of the present application in detail, for the sake of convenience, the cross-sectional views showing the device structure will not be partially enlarged according to the general scale, and the schematic views are only examples, which should not limit the scope of protection of the present application. In addition, in actual production, the three-dimensional dimensions of length, width and depth should be included.
[0022] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0023] In the subsequent description, the suffixes such as "module", "component" or "unit" used to represent elements are only used to facilitate the description of the present application, and have no specific meanings. Therefore, "module", "component" or "unit" can be used in a mixed manner.
[0024] Figure 1 A schematic diagram of a debugging circuit is provided for an embodiment of the present application, which is applied to a first electronic device, such as Figure 1 As shown, the debugging circuit includes a control module 11, a switching module 12 and an external interface 13 of a first electronic device, wherein:
[0025] The input end of the control module 11 is connected to the external interface 13 , and is used to use the external interface 13 to obtain an external voltage value transmitted by a debugging device connected to the external interface.
[0026] Here, the first electronic device may be a handheld electronic device, such as a mobile phone, a tablet or other electronic device. The external interface may be an interface for connecting to other electronic devices or debugging devices. For example, the external interface may be an interface of the USB Type-C model. During implementation, a Type-C female connector may be connected to a Type-C male connector of the debugging device to obtain an external voltage value transmitted by the debugging device. During implementation, the VBUS pin of the Type-C interface may be connected to the control module 11, so that the control module 11 may obtain an external voltage value using the VBUS pin; the SUB1 pin and the SUB2 pin of the Type-C interface idle sideband use (Side Band Use, SBU) are respectively connected to the two common input terminals (COM1 and COM2) of the switching module.
[0027] The control module 11 can be used to obtain an external voltage value to control the switching module to switch the debugging mode based on the external voltage value.
[0028] For example, the control module 11 may be a voltage comparator for determining the magnitude of an external voltage value, and the voltage comparator may determine whether the external voltage value satisfies a preset voltage range.
[0029] The output end of the control module 11 is connected to the switching module 12 , and is used to control the switching module 12 to switch to the first debugging mode when it is determined that the external voltage value belongs to the preset voltage range.
[0030] Here, the switching module 12 can perform a switching operation based on the output of the control module 11 to switch the debugging mode. For example, the switching module 12 can be a dual-channel single-pole double-throw circuit, and two different channels are used to select two debugging modes. Among them, the first debugging mode can be a SWD mode, and the two common input terminals (COM1 and COM2) of the switching module corresponding to the SWD mode are respectively connected to the clock pin SWDCK and the SWD debug pin SWDIO. The two common input terminals (COM1 and COM2) corresponding to the selection of other debugging modes can be connected to the sideband using SBU1 and SUB2 respectively, so as to use SUB1 and SUB2 to obtain the debugging signal for debugging.
[0031] During implementation, the control module 11 can switch to the first debugging mode when it is determined that the external voltage value belongs to the preset voltage range. For example, the preset voltage range can be set to 2 volts (V) to 4V. When the control module 11 determines that the external voltage is greater than 2V and less than 4V, a high level can be output so that the switch in the switching module 12 is switched to the two common input terminals (COM1 and COM2) respectively connected to SWDCK and SWDIO, so that the debugging mode of the first electronic device in which the debugging circuit is set is switched to the SWD mode.
[0032] In an embodiment of the present application, a debugging circuit applied to a first electronic device includes a control module, a switching module, and an external interface of the first electronic device, wherein the input end of the control module is connected to the external interface, and is used to use the external interface to obtain an external voltage value transmitted by a debugging device connected to the external interface; the output end of the control module is connected to the switching module, and is used to control the switching module to switch to a first debugging mode when it is determined that the external voltage value belongs to a preset voltage range. In this way, it is possible to switch to the first debugging mode based on the external voltage value, and to implement debugging analysis in the first debugging mode without disassembling the first electronic device.
[0033] In some embodiments, the control module is further used to control the switching module to switch to a second debugging mode when it is determined that the external voltage value does not belong to a preset voltage range, and the second debugging mode is different from the first debugging mode.
[0034] Here, if Figure 1The control module 11 shown can also control the switching module 12 to switch to the second debugging mode when it is determined that the external voltage value does not belong to the preset voltage range. For example, the voltage on the VBUS pin of the external interface 13 may be 0V, 5V or above 5V, which are all outside the preset voltage range [2V, 4V]. The path of the switching module 12 can be set to the default SBU path, that is, the debugging analysis of the first electronic device can be performed in the USB mode.
[0035] In the embodiment of the present application, the control module is further used to control the switching module to switch to the second debugging mode when it is determined that the external voltage value does not belong to the preset voltage range. In this way, the debugging mode can be adjusted to the second debugging mode based on the external voltage value.
[0036] In some embodiments, Figure 2A The control module shown includes a voltage determination unit 112 for determining whether the external voltage value belongs to the preset voltage range.
[0037] Here, the voltage determination unit 112 can be used to determine whether the voltage value input to the voltage determination power supply belongs to a preset voltage range. For example, the voltage determination power supply can be a voltage comparator, which is used to determine whether the input voltage value is within the preset voltage range [2V, 4V].
[0038] In the embodiment of the present application, the control module includes a voltage determination unit 112 for determining whether the external voltage value belongs to the preset voltage range. In this way, the voltage determination unit can be used to determine whether the external voltage value belongs to the preset voltage range.
[0039] In some embodiments, Figure 2B The control module 11 shown includes an internal control interface 111,
[0040] The internal control interface is used to receive a control signal to control the switching module to switch the debugging mode based on the control signal, wherein the debugging mode at least includes the first debugging mode and a second debugging mode different from the first debugging mode.
[0041] Here, the internal control interface may be a control interface of the first electronic device, which may interface a control signal and control the switching module to switch the debugging mode based on the control signal. For example, the internal control interface may be a general-purpose input / output (GPIO) interface of the SoC, and when it is determined that the external voltage value meets the USB debugging voltage value, the GPIO interface may be used to obtain the debugging instruction of the third electronic device (computer) and switch the debugging mode to SWD debug or USB debug.
[0042] In the embodiment of the present application, the internal control interface in the control module can be used to receive a control signal to control the switching module to switch the debugging mode based on the control signal. In this way, the debugging mode can be flexibly switched using the internal control interface to meet the debugging and analysis requirements of the first electronic device in different debugging modes.
[0043] In some embodiments, Figure 3 As shown, the control module 11 further includes a logic operation unit 113 and a voltage determination unit 112.
[0044] The two input ends of the logic operation unit 113 are connected to the internal control interface 111 and the voltage judgment unit 112 respectively, and the output end of the logic operation unit 113 is connected to the switching module 12;
[0045] The logic operation unit 113 is used to determine the operation result of the logic operation unit based on the first output value of the voltage judgment unit 112 and the second output value of the internal control interface 111, and output the operation result to the switching module, so that the switching module 12 determines the debugging mode based on the operation result.
[0046] During implementation, the logic operation unit 113 may be capable of determining a calculation result of the logic operation unit based on the first output value of the voltage determination unit 112 and the second output value of the internal control interface 111 , and output the calculation result to the switching module 12 .
[0047] For example, the logic operation unit 113 may be an operation unit capable of performing an OR operation, so as to output a valid value 1 when it is determined that either the output of the voltage judgment unit 112 or the internal control interface 111 is a valid value 1, so as to control the switching module 12 to switch the debugging mode. When it is determined that the output of the voltage judgment unit 112 is a valid value 1 and the output of the internal control interface 111 is a non-valid value 0, the debugging mode is switched to the first debugging mode; when it is determined that the output of the voltage judgment unit 112 is a non-valid value 0 and the output of the internal control interface 111 is a valid value 1, the debugging mode is switched based on the control signal obtained by the internal control interface 111.
[0048] For another example, the logic operation unit 113 can also be an operation unit capable of performing an AND operation, so as to output a valid value of 0 when either the output of the voltage judgment unit 112 or the internal control interface 111 is a valid value of 0, so as to control the switching module 12 to switch the debugging mode. When it is determined that the output of the voltage judgment unit 112 is a valid value of 0 and the output of the internal control interface 111 is an invalid value of 1, the valid value of 0 is output to switch the debugging mode to the first debugging mode; when it is determined that the output of the voltage judgment unit 112 is not a valid value of 1 and the output of the internal control interface 111 is a valid value of 0, the valid value of 0 is output to switch the debugging mode based on the control signal obtained by the internal control interface 111.
[0049] In the embodiment of the present application, the control module further includes a logic operation unit and a voltage judgment unit, wherein the two input ends of the logic operation unit are respectively connected to the internal control interface and the voltage judgment unit, and the output end of the logic operation unit is connected to the switching module; the logic operation unit is used to determine the operation result of the logic operation unit based on the first output value of the voltage judgment unit and the second output value of the internal control interface, and output the operation result to the switching module, so that the switching module determines the debugging mode based on the operation result. In this way, the debugging mode can be determined in conjunction with a reasonable logic operation unit to ensure that no false triggering events occur when the SBU is used normally.
[0050] In some embodiments, when it is determined that the external voltage value belongs to the preset voltage range, the first output value is set to a high level and the second output value is set to a low level;
[0051] The logic operation unit is used to determine the operation result of the logic operation unit based on the first output value of the voltage judgment unit and the second output value of the internal control interface, and output the operation result to the switching module so that the switching module determines the debugging mode based on the operation result. This can be achieved by the following process:
[0052] The logic operation unit is used to control the switching module to switch to the first debugging mode when it is determined that the first output value is a high level.
[0053] During the implementation process, when it is determined that the external voltage value belongs to the preset voltage range, the first output value can be set to a high level and the second output value can be set to a low level; by utilizing the logic operation unit, when it is determined that the first output value is a high level, the switching module can be controlled to switch to the first debugging mode.
[0054] For example, in the case where the first electronic device cannot be used normally due to a USB failure, the first electronic device to be debugged, the debugging device, the second electronic device (emulator) and the third electronic device (computer) can be connected, and the mechanical switch of the debugging device can be manually disconnected. At this time, the computer provides 5V VBUS, and VBUS meets the judgment condition of the logic circuit (logic operation unit) in the device after passing through the voltage divider circuit, and controls the switching module 12 to switch to the first debugging mode, namely SWDdebug.
[0055] In the embodiment of the present application, when it is determined that the external voltage value belongs to the preset voltage range, the first output value is set to a high level, and the second output value is set to a low level; the logic operation unit is used to control the switching module to switch to the first debugging mode when it is determined that the first output value is a high level. In this way, when it is determined that the external voltage value belongs to the preset voltage range, the debugging mode can be switched to the first debugging mode.
[0056] In some embodiments, when it is determined that the external voltage value matches the operating voltage of the external interface, the first output value is set to a low level and the second output value is set to a high level;
[0057] The logic operation unit is used to determine the operation result of the logic operation unit based on the first output value of the voltage judgment unit and the second output value of the internal control interface, and output the operation result to the switching module so that the switching module determines the debugging mode based on the operation result. This can be achieved by the following process:
[0058] The logic operation unit is used to control the switching module to switch the debugging mode based on the control signal of the internal control interface when determining that the second output value is a high level.
[0059] During the implementation process, when it is determined that the external voltage value matches the operating voltage of the external interface, the first output value is set to a low level and the second output value is set to a high level; by utilizing the logic operation unit, when it is determined that the second output value is a high level, the switching module is controlled to switch the debugging mode based on the control signal of the internal control interface.
[0060] For example, when it is determined that the USB of the first electronic device can work normally. The first electronic device to be debugged, the debugging device, the second electronic device (emulator) and the third electronic device (computer) can be manually connected, and the mechanical switch on the debugging device can be manually closed to form a path between the first electronic device and the computer. The first electronic device can use the USB debug, and send a command through the USB to control the GPIO of the SoC to switch the path of the switching module to SWD. Here, a control instruction can be input through the USB of the first electronic device, and the control instruction is sent to the GPIO of the SOC to control the GPIO to switch the path of the switching module to SWD. At this time, the USB can be used to control the switching module to control the debugging of SWD or USB.
[0061] In the embodiment of the present application, when it is determined that the external voltage value matches the working voltage of the external interface, the first output value is set to a low level, and the second output value is set to a high level; the logic operation unit is used to control the switching module to switch the debugging mode based on the control signal of the internal control interface when it is determined that the second output value is a high level. In this way, it can be achieved that when it is determined that the external voltage value matches the working voltage of the external interface, the switching module is controlled to switch the debugging mode based on the control signal of the internal control interface.
[0062] Figure 4 A schematic diagram of the structure of a first electronic device is provided for an embodiment of the present application, such as Figure 4 As shown, the first electronic device includes: a housing 41, a body 42, and the above-mentioned debugging circuit 43.
[0063] The first electronic device provided in the embodiment of the present application can use the debugging circuit to easily switch the debugging mode without disassembling the device.
[0064] The present application embodiment provides a debugging device, such as Figure 5A As shown, the debugging device includes: a first interface 51 connected to a first electronic device, a second interface 52 connected to a second electronic device, a third interface 53 connected to a third electronic device, and an output voltage adjustment unit 54, wherein:
[0065] The second electronic device is used to debug the first electronic device in the first debugging mode through the debugging device, and the third electronic device is used to debug the first electronic device in the second debugging mode through the debugging device;
[0066] The output voltage adjustment unit 54 is used to adjust the external voltage value output to the first electronic device, so that the first electronic device determines the debugging mode based on the external voltage value.
[0067] like Figure 5AAs shown, the first interface 51 of the debugging device is used to connect to the first electronic device to be debugged. For example, in the case where the first interface is a Type-C interface, the VBUS pin of the first interface 51 is connected to the VBUS pin of the third interface 53 through the voltage adjustment module 54; the CC1 pin of the first interface 51 is connected to the CC1 pin of the third interface 53; the DP pin of the first interface 51 is connected to the DP pin of the third interface 53; the DN pin of the first interface 51 is connected to the DN pin of the third interface 53; the SUB1 pin of the first interface 51 is connected to the SWDIO pin of the second interface 52; the SUB2 pin of the first interface 51 is connected to the SWDCK of the second interface 52.
[0068] The third interface 53 is used to connect to a third electronic device for debugging the first electronic device. For example, the third interface 53 may be a Type-C interface, which may be connected to a computer so that a user can use the computer to debug the first electronic device by connecting to the debugging device.
[0069] During the implementation, the second electronic device (emulator) can debug the first electronic device in the first debugging mode through the debugging device, and the third electronic device (computer) can debug the first electronic device in the second debugging mode through the debugging device. For example, the emulator can be connected to the second interface 52 to debug the first electronic device in the SWD mode; the computer can be connected to the third interface 53 to debug the first electronic device in the USB mode.
[0070] The output voltage adjustment unit 54 is used to adjust the external voltage value output to the first electronic device, so that the first electronic device determines the debugging mode based on the external voltage value.
[0071] Here, the output voltage adjustment unit 54 can adjust the voltage value obtained through the VBUS pin of the third interface 53 to obtain an external voltage value that can switch the debugging mode, and output the value to the first electronic device through the VBUS pin of the first interface 52. The output voltage adjustment unit 54 can output an external voltage value that matches the debugging of the third electronic device when the third electronic device is used to debug the first electronic device; the output voltage adjustment unit 54 can output an external voltage value that matches the debugging of the second electronic device when the second electronic device is used to debug the first electronic device. For example, when a computer is used to debug a mobile phone, the voltage adjustment unit 54 can be used to output an external voltage of about 5V; when an emulator is used to debug a mobile phone, the voltage adjustment unit 54 can be used to output an external voltage of about 2.5V.
[0072] The debugging device provided in the embodiment of the present application includes: a first interface connected to a first electronic device, a second interface connected to a second electronic device, a third interface connected to a third electronic device, and an output voltage adjustment unit, wherein the second electronic device is used to debug the first electronic device in a first debugging mode through the debugging device, and the third electronic device is used to debug the first electronic device in a second debugging mode through the debugging device; the output voltage adjustment unit is used to adjust the external voltage value output to the first electronic device, so that the first electronic device determines the debugging mode based on the external voltage value. In this way, it is possible to connect the second electronic device or the third electronic device to the first electronic device through the debugging device, and it is possible to switch different debugging modes to debug the first electronic device, and to implement debugging analysis of the first electronic device in different debugging modes without making any changes to the physical hardware of the first electronic device.
[0073] In some embodiments, Figure 5B As shown, the output voltage adjustment unit 54 includes a voltage divider circuit 541 and a switch circuit 542 connected in parallel with the voltage divider circuit;
[0074] The output voltage adjustment unit is used to adjust the external voltage value output to the first electronic device, including:
[0075] When the switch circuit 542 is in the disconnect mode, the external voltage value output to the first electronic device by debugging the voltage divider circuit 542 belongs to a preset voltage range, so that the second electronic device can debug the first electronic device in the first debugging mode.
[0076] Here, a mechanical switch that can be controlled by the user can be set on the switch circuit. When it is determined that the second electronic device is used to debug the first electronic device in the first debugging mode, the mechanical switch can be set to the disconnect mode to divide the output voltage using the voltage divider circuit 524, and the obtained external voltage value belongs to the preset voltage range. For example, when the user needs to use the SWD mode to debug the mobile phone, the mechanical switch can be disconnected so that the external voltage value output to the first electronic device is approximately 2.5V, which can meet the preset voltage range [2V, 4V].
[0077] When the switch circuit 542 is in the on mode, the switch circuit 541 is used to debug the external voltage value output to the first electronic device to match the working voltage of the external interface of the first electronic device, so that the third electronic device can control the first electronic device to switch the debugging mode in the second debugging mode.
[0078] Here, a mechanical switch that can be controlled by the user can be set on the switch circuit. When it is determined that the third electronic device is used to debug the first electronic device in the second debugging mode, the mechanical switch can be set to the on mode, and the voltage obtained from the third electronic device is directly sent to the first electronic device, so that the first electronic device can use the third electronic device to debug the first electronic device when the external voltage value obtained matches the working voltage of the external interface. For example, when the user needs to use the USB mode to debug the mobile phone, the mechanical switch can be closed so that the external voltage value output to the mobile phone is about 5V, which can meet the working voltage of the external interface Type-C, and the computer can use the Type-C interface to debug the mobile phone in USB mode.
[0079] In an embodiment of the present application, the output voltage adjustment unit includes a voltage divider circuit and a switch circuit connected in parallel with the voltage divider circuit; the output voltage adjustment unit is used to adjust the external voltage value output to the first electronic device, including: when the switch circuit is in the disconnected mode, using the voltage divider circuit to debug the external voltage value output to the first electronic device to belong to a preset voltage range, so that the second electronic device can debug the first electronic device in the first debugging mode; when the switch circuit is in the on mode, using the switch circuit to debug the external voltage value output to the first electronic device to match the working voltage of the external interface of the first electronic device, so that the third electronic device can control the first electronic device to switch the debugging mode in the second debugging mode. In this way, different external voltage values can be output to the first electronic device by switching between the disconnected and closed modes of the switch circuit, so that the first electronic device can adjust the adapted debugging mode based on different external voltage values.
[0080] Fig. 6A A schematic diagram of the structure of an electronic device to be debugged is provided for an embodiment of the present application. Figure 6B A schematic diagram of the structure of a debugging board is provided for an embodiment of the present application, wherein:
[0081] like Figure 6B As shown, a SWD connector 621 is provided on the debug board (debugging device) 62 for connecting to the emulator; a Type-C male connector 622 is used for connecting to the emulator. Fig. 6A The electronic device to be debugged (first electronic device) 61 (electronic product such as a mobile phone or tablet) is connected, and the Type-C female connector 623 is used to connect to the debugging device (computer), wherein the debugging device can perform Universal Serial Bus (USB) debugging through the debugging board;
[0082] A voltage divider circuit 624 is connected in series to the VBUS pin of the Type-C connector on the debugging board 62, which can divide the 5V VBUS into 2.5V. A mechanical switch 625 is reserved, and the voltage divider circuit 624 can be bypassed when the mechanical switch 625 is closed.
[0083] like Figure 6B The electronic device to be debugged 61 shown in the figure has a dual-channel single-pole double-throw circuit (SW_SEL) 611 reserved on the mainboard design to enable SWD (including the SWD clock pin SWDCK and the SWD debug pin SWDIO) to be selected to the two idle SBU signals on the Type-C port. The analog switch 611 can be used to switch between SWD and SBU.
[0084] In some embodiments, the analog switch 611 is in a closed state by default, so that the SBU is connected by default.
[0085] In some embodiments, the switch switching signal for switching SW_SEL611 in the electronic device to be debugged 61 can be provided by performing an "OR" operation based on the output result of the GPIO and the voltage judgment circuit (logic circuit). For example, when the logic circuit determines that the input voltage belongs to the preset input voltage range of 2V to 4V, the output can be set to a high level. In this way, after the "OR" operation, SW_SEL611 obtains a high-level input signal, switches the switch to connect to SWD, and implements SWD debugging.
[0086] The present application provides the following three implementation scenarios.
[0087] Scenario 1: This scenario is applicable to the case where the USB of the electronic device 61 to be debugged can work normally.
[0088] Manually connect the electronic device to be debugged 61, the debugging board 62 and the computer for debugging, and manually close the mechanical switch 625 on the debugging board 62 to form a path between the electronic device to be debugged 61 and the computer. The computer can use the USB debug, and send a command through the USB to control the GPIO of the SoC to switch the path of the analog switch 611 to SWD. Here, a control instruction can be input through the USB of the electronic device to be debugged 61, and the control instruction is sent to the GPIO of the SOC, which controls the GPIO to switch the path of the analog switch 611 to SWD. At this time, the USB can be used to switch the analog switch 611 to control the debugging of SWD or USB.
[0089] Scenario 2: This scenario is applicable to the situation where the electronic device 61 to be debugged cannot be used normally due to a USB failure.
[0090] Manually connect the electronic device to be debugged 61, the debugging board 62 and the computer for debugging, and manually disconnect the mechanical switch 625 of the debugging board 62. At this time, the computer provides 5V VBUS. After the VBUS passes through the voltage divider circuit 624, it meets the judgment condition of the logic circuit in the device, and the analog switch 611 is switched to SWD. In the implementation process, the computer sends a 5V VBUS voltage to the debugging board 62. The debugging board 62 receives the 5V VBUS voltage from the computer, divides the 5V VBUS voltage through the voltage divider circuit 624 of the debugging board 62, and sends the divided VBUS voltage to the electronic device to be debugged 61. The electronic device to be debugged 61 receives the divided VBUS voltage from the debugging board 62. The electronic device to be debugged 61 judges the divided VBUS voltage. When the divided VBUS voltage meets the judgment condition, the analog switch 611 is switched to the SWD path, so that SWD debug can be implemented.
[0091] Scenario three: when the electronic device 61 to be debugged is used normally (when other functions are used normally), the voltage on the VBUS pin may be 0V, 5V or above 5V, all of which are not within the preset voltage range [2V, 4V], and the GPIO is not controlled. The path of the analog switch 611 can be set to the default SBU path.
[0092] In some embodiments, the SoC of the electronic device to be debugged 61 can directly multiplex the SWD and SBU signals, and realize the switching between SWD and SBU by linking with the USB insertion event. In the implementation process, it can be defined that when the USB is inserted, the IO is multiplexed as SBU, otherwise the IO is multiplexed as SWD, and the control of multiplexing can be more flexible. The selection of multiplexing can be linked with the USB insertion event in hardware, that is, when the USB device is inserted, the IO is multiplexed as SBU, and the rest of the scenes are all multiplexed as SWD.
[0093] In the embodiment of the present application, a dual-channel single-pole double-throw circuit is reserved on the mainboard design of the electronic device during the design phase to select SWD to the two idle SBU signals on the Type-C port, and a small external customized debugging board is used to easily access SWD without disassembling the device; at the same time, a USB2.0 transparent transmission circuit is designed on the debugging board, so that SWD and USB debugging can be performed simultaneously without the Type-C interface being occupied; finally, a logic judgment mechanism is used to ensure that no false triggering events occur when the SBU is used normally.
[0094] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The above-mentioned sequence numbers of the embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.
[0095] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0096] The above is only an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A debugging circuit, applied to a first electronic device, characterized in that: The debugging circuit includes a control module, a switching module and an external interface of the first electronic device, wherein: The input end of the control module is connected to the external interface, and is used to use the external interface to obtain an external voltage value transmitted by a debugging device connected to the external interface; The output end of the control module is connected to the switching module, and is used to control the switching module to switch to the first debugging mode when it is determined that the external voltage value belongs to the preset voltage range.
2. The debugging circuit according to claim 1, characterized in that: The control module is further configured to control the switching module to switch to a second debugging mode when it is determined that the external voltage value does not fall within a preset voltage range, and the second debugging mode is different from the first debugging mode.
3. The debugging circuit according to claim 1, characterized in that: The control module includes a voltage determination unit for determining whether the external voltage value belongs to the preset voltage range.
4. The debugging circuit according to claim 1, characterized in that: The control module includes an internal control interface, The internal control interface is used to receive a control signal to control the switching module to switch the debugging mode based on the control signal, wherein the debugging mode at least includes the first debugging mode and a second debugging mode different from the first debugging mode.
5. The debugging circuit according to claim 4, characterized in that: The control module also includes a logic operation unit and a voltage judgment unit. The two input ends of the logic operation unit are connected to the internal control interface and the voltage judgment unit respectively, and the output end of the logic operation unit is connected to the switching module; The logic operation unit is used to determine the operation result of the logic operation unit based on the first output value of the voltage judgment unit and the second output value of the internal control interface, and output the operation result to the switching module so that the switching module determines the debugging mode based on the operation result.
6. The debugging circuit according to claim 5, characterized in that: When it is determined that the external voltage value belongs to the preset voltage range, the first output value is set to a high level and the second output value is set to a low level; The logic operation unit is used to determine the operation result of the logic operation unit based on the first output value of the voltage judgment unit and the second output value of the internal control interface, and output the operation result to the switching module, so that the switching module determines the debugging mode based on the operation result, including: The logic operation unit is used to control the switching module to switch to the first debugging mode when it is determined that the first output value is a high level.
7. The debugging circuit according to claim 5, characterized in that: When it is determined that the external voltage value matches the operating voltage of the external interface, the first output value is set to a low level, and the second output value is set to a high level; The logic operation unit is used to determine the operation result of the logic operation unit based on the first output value of the voltage judgment unit and the second output value of the internal control interface, and output the operation result to the switching module, so that the switching module determines the debugging mode based on the operation result, including: The logic operation unit is used to control the switching module to switch the debugging mode based on the control signal of the internal control interface when determining that the second output value is a high level.
8. A first electronic device, characterized in that: The first electronic device comprises: a housing, a body, and a debugging circuit as claimed in any one of claims 1 to 7.
9. A debugging device, characterized in that: The device comprises: a first interface connected to a first electronic device, a second interface connected to a second electronic device, a third interface connected to a third electronic device, and an output voltage adjustment unit, wherein: The second electronic device is used to debug the first electronic device in the first debugging mode through the debugging device, and the third electronic device is used to debug the first electronic device in the second debugging mode through the debugging device; The output voltage adjustment unit is used to adjust the external voltage value output to the first electronic device, so that the first electronic device determines a debugging mode based on the external voltage value.
10. The debugging device according to claim 9, characterized in that: The output voltage adjustment unit includes a voltage dividing circuit and a switch circuit connected in parallel with the voltage dividing circuit; The output voltage adjustment unit is used to adjust the external voltage value output to the first electronic device, including: When the switch circuit is in the off mode, the voltage divider circuit is used to debug the external voltage value output to the first electronic device to fall within a preset voltage range, so that the second electronic device can debug the first electronic device in the first debugging mode; When the switch circuit is in the on mode, the external voltage value output to the first electronic device is debugged by the switch circuit to match the working voltage of the external interface of the first electronic device, so that the third electronic device can control the first electronic device to switch the debugging mode in the second debugging mode.
Citation Information
Cited By
Security access control system and method and storage medium
CN122153867A