MCU two-wire debugging circuit and MCU two-wire debugging method

By using a dual-wire debugging circuit for MCUs, efficient and reliable communication and rich debugging functions are achieved through two IO interfaces. This solves the problem of existing MCU chip debugging interfaces having a large number of IOs and high complexity, thus improving debugging efficiency and reliability.

CN114253790BActive Publication Date: 2024-11-08FOSHAN JUSHENG MICROELECTRONICS CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202111357769.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-15
Publication Date
2024-11-08
Estimated Expiration
2041-11-15

AI Technical Summary

Technical Problem

Existing MCU chip debugging interfaces suffer from problems such as occupying many I/O interfaces, high debugging complexity, and difficulty in guaranteeing reliability and speed. In particular, the four-wire debugging interface is not user-friendly, and there is a lack of a unified solution for two-wire debugging.

Method used

A dual-wire debugging circuit for an MCU was designed, which realizes communication through two IO interfaces. It includes a communication protocol processing module and an event processing module. By utilizing components such as a level detection circuit, a shift register, a level state counter, a debugging instruction judgment circuit, and a communication mode state machine, it achieves high-reliability communication and rich debugging functions.

Benefits of technology

It enables debugging using only two I/O interfaces, improving communication efficiency and reliability, and provides rich debugging functions, supporting CPU control, SRAM and FLASH access, thus simplifying the debugging process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114253790B_ABST
    Figure CN114253790B_ABST
Patent Text Reader

Abstract

The present invention discloses a MCU dual-line debugging circuit and a MCU dual-line debugging method, wherein the MCU dual-line debugging circuit comprises a communication protocol processing module and an event processing module; wherein the communication protocol processing module is used to perform information interaction with an off-chip debugger according to a communication protocol; the event processing module is electrically connected to the communication protocol processing module, and the event processing module is used to perform corresponding actions according to the received debugging instructions, including controlling the CPU of the MCU, accessing the SRAM inside the MCU, accessing at least one of the FLASH inside the MCU, and transmitting the internal data to the debugger through the communication protocol processing module. According to the MCU dual-line debugging circuit of the present invention, the communication protocol processing module provides a highly reliable communication interaction mode, and communication can be completed using only two IO interfaces; the event processing module provides a rich debugging function, which is convenient for software developers to debug programs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of chip debugging, and in particular to an MCU dual-line debugging circuit and an MCU dual-line debugging method. Background Art

[0002] With the rapid development of chip design technology, MCU chips have higher and higher requirements on pin functions, and solution providers tend to use chips with fewer PINs to achieve richer application functions.

[0003] There are three mainstream debugging interfaces for MCU chips on the market: four-wire debugging, two-wire debugging, and single-wire debugging. Among them, the four-wire debugging interface is generally a standard JTAG interface, which needs to occupy four IO interfaces in the chip, resulting in that these four IO interfaces cannot be used as functional PINs during the debugging process. It is not friendly to simulation debugging during the solution development process, and the four wires will increase the hardware complexity during the debugging process. Although the single-wire debugging interface reduces the IO occupancy rate to the lowest, it is more difficult to implement technically, and its reliability and debugging speed are difficult to guarantee. Two-wire debugging is the most mainstream debugging mode in the current market, but there is no unified implementation solution. The SWD debugging interface of the ARM core is the most popular, but it is only applicable to chips using the ARM core. For this reason, it is particularly important to provide a low-cost, fast and reliable debugging interface in MCU chip design. Summary of the invention

[0004] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the present invention proposes an MCU two-wire debugging circuit, which improves debugging efficiency and reliability.

[0005] The invention also proposes a MCU dual-line debugging method.

[0006] In a first aspect, an MCU two-wire debugging circuit according to an embodiment of the present invention comprises: a communication protocol processing module and an event processing module electrically connected in sequence; the communication protocol processing module is used to exchange information with an external debugger according to a communication protocol; the event processing module is used to perform corresponding actions according to received debugging instructions, including but not limited to controlling the CPU of the MCU, accessing the SRAM inside the MCU, accessing the FALSH inside the MCU, and transmitting the acquired internal data to the debugger through the communication protocol processing module; wherein the communication protocol processing module comprises: a level detection circuit electrically connected to the debugger through two IO interfaces of the MCU, wherein one of the IO interfaces is used to transmit a clock signal, and the other IO interface is used to transmit debugging instructions, and the level detection circuit is used to detect the level state of the debugging instruction according to the clock signal; a shift register electrically connected to the level detection circuit, and the shift register is used to perform debugging on the debugging instruction A level state counter is electrically connected to the level detection circuit, and the level state counter is used to count the number of times the debug instruction maintains a high / low level state; a debug instruction judgment circuit is electrically connected to the shift register and the level state counter, and the debug instruction judgment circuit is used to judge whether the debug instruction that has completed the serial-to-parallel conversion meets the preset instruction code; a communication mode state machine is electrically connected to the debug instruction judgment circuit, and when the debug instruction meets the preset instruction code, the communication mode state machine enters a corresponding state according to the corresponding debug instruction; a debug instruction transmitter is electrically connected to the communication mode state machine, and after the communication mode state machine enters a corresponding state, the debug instruction is sent to the event processing module; a data buffer is used to buffer the internal data sent by the event processing module; a communication encoder is electrically connected to the data buffer, and the communication encoder is used to encode the internal data and send it to the debugger.

[0007] The MCU two-wire debugging circuit according to the embodiment of the present invention has at least the following beneficial effects: the communication protocol processing module provides a highly reliable communication interaction method, and only two IO interfaces are used to complete the communication; the event processing module provides a rich debugging function, which is convenient for software developers to debug programs; in addition to controlling the behavior of the CPU and the type and number of breakpoints, it can also directly access the internal SRAM and FALSH, and the richness of the debugging function is prominent.

[0008] According to some embodiments of the present invention, the communication protocol processing module also includes a response processing circuit, an input end of the response processing circuit is electrically connected to an output end of the communication mode state machine, an output end of the response processing circuit is electrically connected to the debugger, and the response processing circuit is used to send a response signal to the debugger each time a communication data is received.

[0009] According to some embodiments of the present invention, the event processing module includes: a debug instruction receiver, used to receive the debug instruction sent by the communication protocol processing module; an event processing state machine, electrically connected to the debug instruction receiver, and the event processing state machine is used to enter a corresponding event state according to the debug instruction; a CPU control interface, electrically connected to the event processing state machine and the CPU, respectively; an SRAM access interface, electrically connected to the event processing state machine and the SRAM, respectively; and a FALSH access interface, electrically connected to the event processing state machine and the FALSH, respectively.

[0010] According to some embodiments of the present invention, the event processing module further comprises an internal register access interface, and the internal register access interface is used to access the internal register of the event processing module.

[0011] In a second aspect, the MCU two-wire debugging method according to an embodiment of the present invention comprises the following steps: an off-chip debugger sends a clock signal and a debugging instruction to a level detection circuit; the level detection circuit detects the level state of the debugging instruction according to the clock signal, and sends the debugging instruction to a shift register for serial-to-parallel conversion; a debugging instruction judgment circuit judges whether the debugging instruction that has completed the serial-to-parallel conversion conforms to a preset instruction code, and if so, sends the debugging instruction to an event processing module through a communication mode state machine and a debugging instruction transmitter; the event processing module executes corresponding actions according to the debugging instruction, and sends the acquired internal data to the debugger through a data buffer and a communication encoder.

[0012] The MCU two-wire debugging method according to the embodiment of the present invention has at least the following beneficial effects: compared with the traditional four-wire debugging interface, the present design only needs to occupy two IO interfaces to complete the debugging function, one IO interface is used to transmit the clock signal, and the other IO interface is used to transmit the debugging instructions. The debugging instructions are transmitted according to the clock beat. Therefore, there is no need to rely on the clock communication of the MCU itself, and there is no need to reserve a sampling window. While improving the communication efficiency, the reliability is also improved.

[0013] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0015] Figure 1 A schematic diagram of the structure of a MCU two-wire debugging circuit according to an embodiment of the present invention;

[0016] Figure 2 A schematic diagram of the structure of a communication protocol processing module according to an embodiment of the present invention;

[0017] Figure 3 is a schematic diagram of the structure of an event processing module according to an embodiment of the present invention;

[0018] Figure 4 A flowchart of the steps of the MCU dual-line debugging method according to an embodiment of the present invention;

[0019] Reference numerals:

[0020] Communication protocol processing module 100, level detection circuit 110, shift register 120, level status counter 130, debug instruction judgment circuit 140, communication mode state machine 150, debug instruction transmitter 160, data buffer 170, communication encoder 180, response processing circuit 190, event processing module 200, debug instruction receiver 210, event processing state machine 220, CPU control interface 230, SRAM access interface 240, FLASH access interface 250, internal register access interface 260, CPU 300, SRAM 400, FLASH 500. DETAILED DESCRIPTION

[0021] This section will describe in detail the specific embodiments of the present invention. The preferred embodiments of the present invention are shown in the accompanying drawings. The purpose of the accompanying drawings is to supplement the description of the text part of the specification with graphics, so that people can intuitively and vividly understand each technical feature and the overall technical solution of the present invention, but it cannot be understood as a limitation on the scope of protection of the present invention.

[0022] In the description of the present invention, "several" means one or more, "more" means more than two, "greater than", "less than", "exceed" etc. are understood as not including the number itself, and "above", "below", "within" etc. are understood as including the number itself. If there is a description of "first" or "second", it is only used for the purpose of distinguishing the technical features, and cannot be understood as indicating or implying the relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.

[0023] In the description of the present invention, unless otherwise clearly defined, terms such as setting, installing, connecting, etc. should be understood in a broad sense, and technicians in the relevant technical field can reasonably determine the specific meanings of the above terms in the present invention based on the specific content of the technical solution.

[0024] First, as Figure 1As shown, the MCU two-wire debugging circuit according to the embodiment of the present invention includes a communication protocol processing module 100 and an event processing module 200; wherein the communication protocol processing module 100 is used to exchange information with an external debugger according to the communication protocol; the event processing module 200 is electrically connected to the communication protocol processing module 100, and the event processing module 200 is used to perform corresponding actions according to the received debugging instructions, including but not limited to controlling the CPU 300 of the MCU, accessing the SRAM 400 inside the MCU, accessing the FALSH 500 inside the MCU, and transmitting the acquired internal data to the debugger through the communication protocol processing module 100. The communication protocol processing module 100 specifically includes a level detection circuit 110, a shift register 120, a level state counter 130, a debugging instruction judgment circuit 140, a communication mode state machine 150, a debugging instruction transmitter 160, a data buffer 170 and a communication encoder 180. Among them, the level detection circuit 110 is electrically connected to the debugger through two IO interfaces of the MCU, one of which is used to transmit the clock signal DEBUG_CLK, and the other IO interface is used to transmit the debugging instruction DEBUG_DAT. The level detection circuit 110 is used to detect the level state of the debugging instruction according to the clock signal, that is, to detect the level state of DEBUG_DAT at the rising edge of the clock; by default, the IO interface corresponding to DEBUG_CLK is in an internal pull-up state to avoid interference caused by unstable level state caused by floating. The shift register 120 is electrically connected to the level detection circuit 110, and is used to perform serial-to-parallel conversion on the debugging instruction, that is, to cache the single-bit signal input by DEBUG_DAT and complete the serial-to-parallel conversion. The level state counter 130 is electrically connected to the level detection circuit 110, and the level state counter 130 is used to count the high / low level state of the debugging instruction DEBUG_DAT so that the system can determine whether the data transmission is incorrect. The debugging instruction judgment circuit 140 is electrically connected to the shift register 120 and the level state counter 130 respectively, and is used to judge whether the debugging instruction that has completed the serial-to-parallel conversion conforms to the preset instruction code; for each instruction code, there is a fixed header respectively, therefore, for the data that has completed the serial-to-parallel conversion, it is first necessary to judge whether its header conforms to the agreed protocol, and then judge whether the debugging instruction behind the header is the agreed instruction code. When the received data conforms to the communication protocol and conforms to the preset instruction code, the communication mode state machine 150 enters the corresponding state according to the corresponding debugging instruction. After the communication mode state machine 140 enters the corresponding state, the debugging instruction transmitter 160 sends the debugging instruction to the event processing module 200. The data buffer 170 is used to cache the internal data that the MCU needs to send to the off-chip debugger. The communication encoder 180 is used to encode the internal data and send it to the off-chip debugger.

[0025] Specifically, the communication protocol processing module 100 is responsible for communicating with the debugger outside the chip, including interpreting and judging the received signal according to the communication protocol, and outputting the internal data; the event processing module 200 is responsible for executing the corresponding control actions for the received instructions, including controlling the CPU 300, accessing the internal SRAM 400, accessing the internal FLASH 500, etc. The entire MCU two-wire debugging circuit is a bridge for communication between the external debugger and the internal MCU. The communication is initiated by the external debugger, and the communication protocol processing module 100 receives the communication signal, interprets the protocol, and passes the correct instruction obtained to the event processing module 200; the event processing module 200 then performs corresponding control operations on the CPU 300, SRAM 400, FLASH 500, etc. according to the instruction task; when the internal data needs to be passed to the external debugger through the debugging interface, the event processing module 200 obtains the data, and then passes it to the communication protocol processing module 100, and transmits it out according to the agreed communication protocol.

[0026] According to the MCU two-wire debugging circuit of the embodiment of the present invention, compared with the traditional four-wire debugging interface, this design only needs to occupy two IO interfaces to complete the debugging function. One IO interface is used to transmit the clock signal DEBUG_CLK, and the other IO interface is used to transmit the debugging instruction DEBUG_DAT. The debugging instruction is transmitted according to the clock beat. Therefore, there is no need to rely on the clock communication of the MCU itself, and there is no need to reserve a sampling window. While improving communication efficiency, reliability is also improved.

[0027] Furthermore, if Figure 2 As shown, in some embodiments of the present invention, the communication protocol processing module 100 further includes a response processing circuit 190, the input end of the response processing circuit 190 is electrically connected to the output end of the communication mode state machine 150, the output end of the response processing circuit 190 is electrically connected to the debugger, and the response processing circuit 190 is used to send a response signal to the debugger every time a communication data is received. The response signal fed back by the response processing circuit 190 to the debugger outside the chip ensures the accuracy of the communication.

[0028] like Figure 3As shown, the event processing module 200 includes a debug instruction receiver 210, an event processing state machine 220, a CPU control interface 230, an SRAM access interface 240 and a FLASH access interface 250; wherein the debug instruction receiver 210 is used to receive debug instructions sent by the communication protocol processing module 100; the event processing state machine 220 is used to enter the corresponding event state according to the debug instructions; the CPU control interface 230 is electrically connected to the event processing state machine 220 and the CPU 300 respectively; the SRAM access interface 240 is electrically connected to the event processing state machine 220 and the SRAM 400 respectively; and the FLASH access interface 250 is electrically connected to the event processing state machine 220 and the FLASH 500 respectively.

[0029] Specifically, the event processing module 200 operates in a high-frequency clock domain, which is asynchronous with the clock of the communication protocol processing module 100. Therefore, an asynchronous transition needs to be made at the debug instruction receiver 210. The event states mainly processed by the event processing state machine 220 include but are not limited to: controlling the operation of the CPU 300 through the CPU control interface 230, accessing the SRAM 400 through the SRAM access interface 240, and accessing the FLASH 500 through the FLASH access interface 250. The CPU control interface 230 is used to control the CPU 300 to pause, run at full speed, reset, and execute in a single step, and can set the breakpoint type, breakpoint position, and breakpoint number during the operation of the CPU 300. The SRAM access interface 240 is used to generate a read / write control signal for the SRAM 400, and perform a single access or continuous access to the SRAM 400. The FLASH access interface 250 is used to generate a read / write control signal for the FLASH 500, and perform a single access or continuous access to the FLASH 500. Finally, the acquired internal data is sent to the communication protocol processing module 100, and then sent to the external debugger by the communication protocol processing module 100.

[0030] In addition, if Figure 3 As shown, the event processing module 200 further includes an internal register access interface 260 , and the internal register access interface 260 is used to read / write special function registers inside the event processing module 200 .

[0031] In summary, the MCU two-wire debugging circuit according to the embodiment of the present invention:

[0032] 1. The communication protocol processing module 100 provides a highly reliable communication interaction mode, and only two IO interfaces are used to complete the communication;

[0033] 2. The event processing module 200 provides a rich debugging function, which is convenient for software developers to debug programs. In addition to controlling the behavior of the CPU 300 and the type and number of breakpoints, it can also directly access the internal SRAM 400 and FALSH 500, and the debugging function is rich and prominent.

[0034] 3. The communication protocol processing module 100 and the event processing module 200 work in different clock domains, which can not only ensure the reliability of communication, but also enable the internal event processing to be executed at a high speed, thereby ensuring the efficiency of debugging.

[0035] Second, as Figure 4 As shown, the MCU two-wire debugging method according to an embodiment of the present invention includes the following steps:

[0036] S100: the off-chip debugger sends a clock signal DEBUG_CLK and a debug instruction DEBUG_DAT to the level detection circuit 110;

[0037] S200: The level detection circuit 110 detects the level state of the debugging instruction according to the clock signal, and sends the debugging instruction to the shift register 120 for serial-to-parallel conversion;

[0038] The level detection circuit 110 uses DEBUG_CLK as the working clock and detects the level state of DEBUG_DAT at the rising edge of the clock; by default, the IO interface corresponding to DEBUG_CLK is in an internal pull-up state to avoid interference caused by floating and unstable level state. Subsequently, the level detection circuit 110 sends the debugging instruction to the shift register 120 and the level state counter 130; the shift register 120 is used to cache the single-bit signal of DEBUG_DAT and complete the serial-to-parallel conversion; the level state counter 130 is used to count the high / low state of DEBUG_DAT.

[0039] S300: The debugging instruction judging circuit 140 judges whether the debugging instruction that has completed the serial-to-parallel conversion conforms to the preset instruction code. If so, the debugging instruction is sent to the event processing module 200 through the communication mode state machine 150 and the debugging instruction transmitter 160.

[0040] For each instruction code, there is a fixed header. Therefore, for the data that has completed the serial-to-parallel conversion, it is first necessary to determine whether its header conforms to the agreed protocol, and then determine whether the debugging instruction after the header is the agreed instruction code. When the received data conforms to the communication protocol and conforms to the preset instruction code, the communication mode state machine 150 enters the corresponding state according to the corresponding debugging instruction. After the communication mode state machine 150 enters the corresponding state, the debugging instruction transmitter 160 sends the debugging instruction to the event processing module 200.

[0041] S400 : the event processing module 200 executes corresponding actions according to the debugging instruction, and sends the acquired internal data to the debugger through the data buffer 170 and the communication encoder 180 .

[0042] The event processing module 200 includes a debug command receiver 210, an event processing state machine 220, a CPU control interface 230, an SRAM access interface 240, a FLASH access interface 250, and an internal register access interface 260. The event processing module 200 operates in a high-frequency clock domain and is asynchronous with the clock of the communication protocol processing module 100. Therefore, an asynchronous transition needs to be made at the debug command receiver 210. The event states mainly processed by the event processing state machine 220 include but are not limited to: controlling the operation of the CPU 300 through the CPU control interface 230, accessing the SRAM 400 through the SRAM access interface 240, accessing the FLASH 500 through the FLASH access interface 250, and accessing the internal registers of the time processing module 200 through the internal register access interface 260. The CPU control interface 230 is used to control the CPU 300 to pause, run at full speed, reset, single-step, etc., and can set the breakpoint type, breakpoint position, and breakpoint quantity during the operation of the CPU 300. The SRAM access interface 240 is used to generate a read / write control signal of the SRAM 400, and perform a single access or continuous access to the SRAM 400. The FLASH access interface 250 is used to generate a read / write control signal of the FLASH 500, and perform a single access or continuous access to the FLASH 500. The internal register access interface 260 is used to read / write the special function registers inside the event processing module 200. The event processing module 200 finally sends the acquired internal data to the data buffer 170 of the communication protocol processing module 100, and the data buffer 170 caches the internal data. The communication encoder 180 encodes the internal data and sends it to the debugger outside the chip.

[0043] According to the MCU two-wire debugging method of the embodiment of the present invention, compared with the traditional four-wire debugging interface, only two IO interfaces are needed to complete the debugging function. One IO interface is used to transmit the clock signal DEBUG_CLK, and the other IO interface is used to transmit the debugging instruction DEBUG_DAT. The debugging instruction is transmitted according to the clock beat. Therefore, there is no need to rely on the clock communication of the MCU itself, and there is no need to reserve a sampling window. While improving the communication efficiency, the reliability is also improved.

[0044] In the description of this specification, the description with reference to the terms "one embodiment", "further embodiments", "some specific embodiments" or "some examples" etc. means that the specific features, structures or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0045] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.

Claims

1. A MCU two-wire debugging circuit, It is characterized in that It comprises a communication protocol processing module and an event processing module which are electrically connected in sequence; the communication protocol processing module is used to exchange information with an off-chip debugger according to the communication protocol; the event processing module is used to perform corresponding actions according to the received debugging instructions, including but not limited to controlling the CPU of the MCU, accessing the SRAM inside the MCU, accessing the FALSH inside the MCU, and transmitting the acquired internal data to the debugger through the communication protocol processing module; Wherein, the communication protocol processing module includes: A level detection circuit is electrically connected to the debugger through two IO interfaces of the MCU, wherein one of the IO interfaces is used to transmit a clock signal, and the other IO interface is used to transmit a debugging instruction, and the level detection circuit is used to detect a level state of the debugging instruction according to the clock signal; A shift register, electrically connected to the level detection circuit, and used for performing serial-to-parallel conversion on the debugging instruction; A level state counter, electrically connected to the level detection circuit, and used for counting the number of times the debugging instruction maintains a high / low level state; A debugging instruction judging circuit is electrically connected to the shift register and the level state counter respectively, and is used to judge whether the debugging instruction that has completed the serial-to-parallel conversion conforms to a preset instruction code; A communication mode state machine is electrically connected to the debugging instruction judgment circuit, and when the debugging instruction meets the preset instruction code, the communication mode state machine enters a corresponding state according to the corresponding debugging instruction; a debugging instruction transmitter, electrically connected to the communication mode state machine, and transmitting the debugging instruction to the event processing module after the communication mode state machine enters a corresponding state; A data buffer, used for buffering the internal data sent by the event processing module; A communication encoder is electrically connected to the data buffer, and is used to encode the internal data and send it to the debugger.

2. The MCU two-wire debugging circuit according to claim 1, It is characterized in that The communication protocol processing module also includes a response processing circuit, the input end of the response processing circuit is electrically connected to the output end of the communication mode state machine, the output end of the response processing circuit is electrically connected to the debugger, and the response processing circuit is used to send a response signal to the debugger each time a communication data is received.

3. The MCU two-wire debugging circuit according to claim 1 or 2, It is characterized in that The event processing module includes: A debugging instruction receiver, used for receiving the debugging instruction sent by the communication protocol processing module; An event processing state machine, electrically connected to the debug instruction receiver, the event processing state machine being used to enter a corresponding event state according to the debug instruction; A CPU control interface, electrically connected to the event processing state machine and the CPU respectively; An SRAM access interface, electrically connected to the event processing state machine and the SRAM respectively; The FALSH access interface is electrically connected to the event processing state machine and the FALSH respectively.

4. The MCU two-wire debugging circuit according to claim 3, It is characterized in that The event processing module further comprises an internal register access interface, and the internal register access interface is used to access the internal register of the event processing module.

5. An MCU two-wire debugging method, based on the MCU two-wire debugging circuit according to any one of claims 1 to 4, It is characterized in that The following steps are involved: The off-chip debugger sends clock signals and debug commands to the level detection circuit; The level detection circuit detects the level state of the debugging instruction according to the clock signal, and sends the debugging instruction to the shift register for serial-to-parallel conversion; The debugging instruction judging circuit judges whether the debugging instruction that has completed the serial-to-parallel conversion conforms to the preset instruction code, and if so, sends the debugging instruction to the event processing module through the communication mode state machine and the debugging instruction transmitter; The event processing module executes corresponding actions according to the debugging instruction, and sends the acquired internal data to the debugger through the data buffer and the communication encoder.

Citation Information

Patent Citations

  • Non-handshake-type JTAG debugging link compatible to AHB protocol and debugging method thereof

    CN107577635A

  • Debugging method of embedded microprocessor and embedded microprocessor

    CN111708707A

  • MCU debugging control circuit

    CN216595955U

  • On-chip debugger

    US6732311B1