CPU reset prevention circuit, emulator adapter, and CPU reset prevention system

By setting up a transfer unit and an XOR circuit in the CPU's anti-reset circuit, a watchdog signal is generated to ensure that the watchdog unit outputs a normal working signal. This solves the system reset problem caused by the hardware watchdog during simulation debugging and programming, and achieves stable system operation.

CN117555404BActive Publication Date: 2026-11-17CHANGCHUN INST OF OPTICS FINE MECHANICS & PHYSICS CHINESE ACAD OF SCI
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202311458726.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-03
Publication Date
2026-11-17
Estimated Expiration
2043-11-03

AI Technical Summary

Technical Problem

During simulation debugging and programming, the watchdog timer feeding operation experienced an interruption issue, causing the system to reset and affecting normal operation.

Method used

By setting the first transfer unit to receive the square wave signal from the square wave generator, the microcontroller unit obtains the status signal of the square wave generator and outputs the control signal. The XOR circuit generates the watchdog signal to ensure that the watchdog unit outputs a normal working signal during simulation debugging and programming, preventing reset.

Benefits of technology

This effectively prevents the hardware watchdog from misjudging system faults during simulation debugging and programming, ensuring the normal operation of the microcontroller unit under various conditions and improving the stability and maintainability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117555404B_ABST
    Figure CN117555404B_ABST
Patent Text Reader

Abstract

This invention relates to the field of CPU reset technology and discloses a CPU anti-reset circuit, an emulator adapter, and a CPU anti-reset system. The CPU anti-reset circuit includes a first adapter unit, a microcontroller unit, an XOR circuit, and a watchdog unit. The microcontroller unit obtains a square wave generator operating status signal from the first adapter unit and outputs a control signal when the square wave generator operating status signal indicates a stopped operating state. The XOR circuit outputs a watchdog feed signal based on the square wave signal or the control signal. When the watchdog unit receives the watchdog feed signal, it outputs a status signal indicating normal operation. When the microcontroller unit receives the status signal indicating normal operation, it does not reset and performs actions such as emulation debugging, programming, or normal operation. Thus, it can receive the normal operation status signal output by the watchdog unit during emulation debugging, programming, or normal operation, avoiding CPU reset caused by these states.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of CPU reset technology, specifically to a CPU anti-reset circuit, an emulator adapter, and a CPU anti-reset system. Background Technology

[0002] In the design and development of digital signal processing systems, hardware watchdog timers are a crucial protection mechanism used to monitor the system's operational status. Hardware watchdog timers typically detect system activity through timer counting. If the system fails to "feed" the watchdog timer within a certain timeframe, the timer expires and triggers a reset, preventing system malfunctions or deadlocks. However, during simulation debugging and programming, the hardware watchdog feeding operation suffers from interruption issues. Traditional hardware watchdog feeding methods are unsuitable for simulation debugging modes, causing the watchdog timer to time out and trigger a reset, thus interrupting normal system operation. Summary of the Invention

[0003] In view of the above problems, embodiments of the present invention provide a CPU anti-reset circuit to solve the technical problem that interrupt reset affects the normal operation of the system when the system is in debugging or burning state.

[0004] According to one aspect of the present invention, a CPU reset prevention circuit is provided, the CPU reset prevention circuit comprising:

[0005] The first switching unit is used to receive a square wave signal from the square wave generator of the simulator switching device and to obtain the square wave generator's operating status signal.

[0006] A microcontroller unit with a first feeding frequency is used to acquire the working status signal of the square wave generator and output a control signal when the working status signal of the square wave generator indicates a stopped working state. The working frequency of the control signal and the working frequency of the square wave signal are both higher than the first feeding frequency.

[0007] An XOR circuit is used to output a dog-feeding signal based on the square wave signal or the control signal;

[0008] The watchdog unit is used to output a status signal indicating normal operation when the watchdog signal is received;

[0009] The microcontroller unit is also used to perform actions such as simulation debugging, programming, or normal operation without resetting when it receives the status signal that represents normal operation.

[0010] In an alternative embodiment, the watchdog unit is further configured to output a status signal indicating a reset when the watchdog signal is not received.

[0011] In one alternative embodiment, the microcontroller is configured not to output the control signal when the square wave generator operating status signal represents a normal operating state.

[0012] In one alternative embodiment, the XOR circuit generates the dog-feeding signal according to the control signal when the square wave generator operating status signal indicates a stopped operating state.

[0013] The XOR circuit generates the dog-feeding signal based on the square wave signal when the square wave generator's operating status signal represents the normal operating state.

[0014] In one alternative embodiment, the first adapter unit is connected to both the microcontroller unit and the watchdog unit, the XOR circuit is connected to both the first adapter unit and the microcontroller unit, and the watchdog unit is connected to the microcontroller unit.

[0015] In one optional embodiment, the microcontroller unit includes a switching signal input terminal, a reset signal input terminal, and a watchdog signal output terminal. The switching signal input terminal of the microcontroller unit is connected to the first switching unit and is used to receive simulation debugging information, programming information, and the operating status signal of the square wave generator. The watchdog signal output terminal of the microcontroller unit is connected to the XOR circuit and is used to output the control signal. The reset signal input terminal of the microcontroller unit is connected to the watchdog unit and is used to receive the status signal.

[0016] In one optional embodiment, the first adapter unit includes a first JTAG interface, which includes a plurality of first test pins and a first watchdog signal pin. The adapter signal input terminal of the microcontroller includes a plurality of adapter pins that are connected to the first test pins one by one. The plurality of first test pins input the input test signal to the microcontroller. The first watchdog signal pin of the first JTAG interface is connected to the XOR circuit and is used to output the input square wave signal to the XOR circuit.

[0017] In one alternative embodiment, the XOR circuit includes an XOR gate having a first input, a second input, and an output. The first input of the XOR gate is connected to the watchdog signal output of the microcontroller unit, the second input of the XOR gate is connected to the first watchdog signal pin of the first JTAG interface, and the output of the XOR gate is connected to the watchdog unit.

[0018] According to another aspect of the present invention, a simulator adapter is provided, the simulator adapter comprising:

[0019] The simulator is used to connect the microcontroller to a personal terminal and to program the program output by the personal terminal to the microcontroller; it is also used to acquire test instructions and output test signals according to the test instructions.

[0020] The second JTAG unit is connected to the emulator and is used to acquire the test signal and output it.

[0021] A square wave generation unit is connected to the third JTAG unit and is used to generate square wave signals;

[0022] The third JTAG unit is connected to the second JTAG unit and is used to connect to the first adapter unit of the CPU anti-reset circuit during testing and programming. It is used to receive the test signal and the square wave signal and output them.

[0023] According to another aspect of the present invention, a CPU reset prevention system is provided, the CPU reset prevention system including the CPU reset prevention circuit as described above and the emulator adapter as described above, wherein a first adapter unit of the CPU reset prevention circuit is connected to a third JTAG unit of the emulator adapter.

[0024] In one alternative embodiment, the CPU anti-reset system further includes a personal terminal connected to the emulator of the emulator adapter for outputting test signals received by the first JTAG interface of the CPU anti-reset circuit.

[0025] This invention addresses both the programming and debugging states by using a first switching unit to receive a stable square wave signal from the square wave generator. Simultaneously, the microcontroller unit monitors the programming and debugging states of the simulator by acquiring the square wave generator's operating status signal. When the square wave generator's operating status signal indicates a stopped working state, a control signal is output. This ensures that, regardless of the state, only the square wave signal or the corresponding control signal indicating a stopped working state is input to the XOR circuit. This guarantees that the XOR circuit outputs a valid watchdog signal to the watchdog unit during debugging, programming, and normal operation. The watchdog unit then outputs a status signal indicating normal operation to the microcontroller unit, ensuring the microcontroller unit functions correctly in all three states without resetting. This solves the technical problem of interruptions and resets affecting normal system operation during debugging or programming states.

[0026] The above description is merely an overview of the technical solutions of the embodiments of the present invention. In order to better understand the technical means of the embodiments of the present invention and to implement them in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the embodiments of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description

[0027] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:

[0028] Figure 1 A schematic diagram of the CPU anti-reset circuit provided by the present invention is shown.

[0029] Figure 2 The diagram shows a circuit diagram of the first switching unit, the watchdog unit, and the XOR circuit in the CPU anti-reset circuit provided by the present invention.

[0030] Figure 3 A schematic diagram of the CPU anti-reset circuit and the emulator adapter provided by the present invention is shown.

[0031] Figure 4 The circuit diagram of the second JTAG unit, the third JTAG unit, and the square wave generation unit in the simulator adapter provided by the present invention is shown.

[0032] Figure 5 A schematic diagram of the CPU anti-reset system provided by the present invention is shown. Detailed Implementation

[0033] Exemplary embodiments of the invention will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be implemented in various forms and should not be limited to the embodiments set forth herein.

[0034] The following analysis, based on relevant technologies, examines existing solutions for CPU reset.

[0035] For reset triggering encountered during simulation or debugging, the existing technology generally offers the following two solutions:

[0036] 1. During simulation debugging or programming, the hardware watchdog chip should not be soldered or the watchdog reset signal should be disconnected from the microcontroller by using a DIP switch. After completion, the chip should be soldered back or the DIP switch should be switched back.

[0037] 2. The patent entitled "CPU Reset Prevention Circuit for DSP Chip During Burning Process", with application number 201020236167.5, discloses a method of feeding the dog after XORing the TCK signal of JTAG and the dog-feeding signal of the microcontroller.

[0038] Analysis and experimental verification of the above-mentioned Scheme 1 revealed that it is not suitable for situations where the circuit board has already been installed on the equipment or product. It is inconvenient to disassemble and reassemble, and there is a possibility of forgetting to use the DIP switch, which causes the hardware watchdog to malfunction.

[0039] Analysis and experimental verification of the above scheme 2 revealed that it is only applicable to the case of program burning. During simulation debugging, sometimes TCK (memory clock cycle) does not generate a clock signal, so the watchdog signal cannot be generated continuously.

[0040] This application provides a CPU (Central Processing Unit) anti-reset circuit that can take into account unreasonable triggering and reset situations under various CPU states. Through circuit design, it solves the technical problem of interrupt reset affecting the normal operation of the system when the system is in debugging or burning state.

[0041] In one possible implementation scenario, the CPU anti-reset circuit of this solution can be integrated into the design, development, and debugging process of various DSP (Digital Signal Processing) systems to improve the maintainability and stability of the system.

[0042] Figure 1 A block diagram of a first embodiment of the CPU anti-reset circuit of the present invention is shown. The CPU anti-reset circuit includes a first transfer unit 11, a watchdog unit 13, a microcontroller unit 14 having a first watchdog frequency, and an XOR circuit 12.

[0043] The first switching unit 11 receives a square wave signal from the square wave generator 21 of the simulator switching device and acquires the square wave generator's operating status signal. The microcontroller unit 14 acquires the square wave generator's operating status signal from the simulator switching device and outputs a control signal when the square wave generator's operating status signal indicates a stopped working state. The operating frequency of both the control signal and the square wave signal is higher than the first watchdog frequency. The XOR circuit 12 outputs a watchdog signal based on either the square wave signal or the control signal. When the watchdog unit 13 acquires the watchdog signal, it outputs a status signal indicating normal operation to the microcontroller unit 14. The microcontroller unit 14 continuously acquires watchdog signals with frequencies higher than the first watchdog frequency to maintain normal operation, thereby ensuring that the microcontroller unit 14 does not reset and perform actions such as simulation debugging, programming, or normal operation when it receives a status signal indicating normal operation.

[0044] This invention considers both the programming and debugging states. In the first case, a stable square wave signal is input from the square wave generator 21 via the first adapter unit 11. This indicates that the emulator is in both programming and debugging states. The programming and debugging states of the emulator are monitored, and the square wave generator's operating status signal represents the normal operating state. At this time, the microcontroller unit 14 does not output control signals. In the second case, the microcontroller unit 14 acquires the square wave generator's operating status signal to monitor the programming and debugging states of the emulator. When the square wave generator's operating status signal represents a stopped operating state, the corresponding control signal is output. At this time, there is no square wave signal input, indicating that the emulator is not in the programming state. The XOR circuit 12 is configured to operate in both normal and debugging states. This ensures that at any given time, only a square wave signal or a corresponding square wave generator operating status signal representing the stopped operating state is input to the XOR circuit 12. Consequently, whether in debugging, programming, or normal operation, the XOR circuit 12 outputs a valid watchdog signal to the watchdog unit 13. Upon receiving the watchdog signal, the watchdog unit 13 outputs a normal operating status signal to the microcontroller unit 14, enabling the microcontroller unit 14 to operate normally. This guarantees that the microcontroller unit 14 operates normally in all three states—normal operation, debugging, and programming—without resetting, thus solving the technical problem of interrupt reset affecting normal system operation when the system is in debugging or programming state.

[0045] It should be noted that the first feeding frequency at this time is the operating frequency required for the normal feeding signal of the microcontroller 14. Only when it is greater than this value is the feeding behavior effective and the normal operation of the microcontroller 14 can be guaranteed.

[0046] The above embodiments can be implemented based on the following circuit connection relationship: the first adapter unit 11 is connected to the microcontroller unit 14 and the watchdog unit 13 respectively; the XOR circuit 12 is connected to the first adapter unit 11 and the microcontroller unit 14 respectively; and the watchdog unit 13 is connected to the microcontroller unit 14.

[0047] Based on the above embodiments, the frequency of the square wave signal is higher than the first dog-feeding frequency, and the frequency of the control signal output by the microcontroller unit 14 is higher than the first dog-feeding frequency.

[0048] In the above embodiment, the square wave generator working status signal represents the normal working state, indicating that the square wave generator 21 is working normally and the first transfer unit 11 has been connected to the square wave generator 21. At this time, simulation debugging or burning process is being performed. Therefore, the microcontroller unit 14 does not output control signals at this time.

[0049] The square wave generator operating status signal indicates a stopped operating state, meaning that the square wave generator 21 has malfunctioned or the first transfer unit 11 has disconnected from the square wave generator 21, ended the simulation debugging or programming process, and there is no square wave signal input at this time. When the microcontroller unit 14 receives the square wave generator operating status signal indicating a stopped operating state, it outputs a control signal with a frequency higher than the first feed dog frequency, so that the XOR circuit 12 only has a control signal input with a frequency higher than the first feed dog frequency, thereby outputting a feed dog signal to the watchdog unit 13, so that the watchdog unit 13 outputs a status signal indicating a normal operating state, thereby maintaining the normal operation of the microcontroller unit 14.

[0050] The above settings ensure that the microcontroller can continue to function normally during normal operation, when the square wave generator 21 malfunctions, and during simulation debugging or programming.

[0051] In an optional embodiment, the microcontroller unit 14 does not output a control signal when the square wave generator operating status signal represents the normal operating state.

[0052] At this time, it indicates that the first transfer unit 11 is connected to the simulator transfer device and is in the simulation debugging or burning process. Therefore, when the first transfer unit 11 is connected to the square wave signal, the microcontroller unit 14 does not output the control signal, and the XOR circuit 12 only has the square wave signal input, so that it can output the watchdog signal to the watchdog unit 13, so that the watchdog unit 13 outputs the status signal representing the normal working state, so as to maintain the normal operation of the microcontroller unit 14.

[0053] The above settings ensure that the microcontroller can maintain normal operation during simulation debugging or programming.

[0054] It should be noted that, since this is for simulation debugging or programming, the square wave generator 21 is generally set in the simulation debugging equipment or programming equipment. With the connection of the corresponding debugging or simulation interface, the square wave generator 21 will input the generated square wave signal into the first adapter unit 11. It should be noted that no judgment is required throughout this process. After passing through the XOR circuit 12, the square wave generator 21 outputs a feed signal to the watchdog unit, ensuring that the watchdog will not send a reset signal that would cause the microcontroller unit to reset during simulation debugging or programming. When the connection is disconnected, the microcontroller unit controls GPIO48 to output a square wave to the XOR circuit 12 through its internally programmed program. Subsequently, the XOR circuit 12 outputs a feed signal to the watchdog unit, ensuring the normal operation of the internal program. It should be emphasized that in the scheme of this application, it is necessary to ensure that the square wave generator 21 is working during connection, and the information transmission delay after the interface handshake is successful needs to be taken into account. Therefore, the frequency of the square wave signal needs to be increased after the test to cover the delay.

[0055] Optionally, when the square wave generator's operating status signal indicates a stopped operating state, the frequency of the control signal output by the microcontroller 14 is at least twice the first dog-feeding frequency.

[0056] With the above settings, when the simulation debugging and programming process switches to the normal operating state of the microcontroller unit 14, even if the previous state is about to issue the next watchdog signal, the watchdog signal issued by the microcontroller unit 14 after the switch can continue normally from the previous watchdog signal without interruption. This ensures that the normal watchdog signal output can be maintained even during state transitions. It should be noted that the control signal can vary at this time; initially, the output only needs to be at least twice the first watchdog frequency, and subsequently, it only needs to remain greater than the first watchdog frequency.

[0057] Optionally, when the microcontroller unit 14 is in the square wave generator operating state signal representing the first transfer unit 11 receiving a square wave signal, the frequency of the square wave signal is at least twice the first dog-feeding frequency.

[0058] With the above settings, when the microcontroller unit 14 switches from its normal operating state to the simulation debugging or programming process, even if the next watchdog signal is about to be issued in the previous state, the watchdog signal issued by the simulation debugging or programming device after the switch can continue normally from the previous watchdog signal without interruption. This ensures that the normal watchdog signal output can be maintained during state switching. It should be noted that the control signal can vary at this time; initially, the output only needs to be at least twice the first watchdog frequency, and thereafter it only needs to remain greater than the first watchdog frequency.

[0059] In an optional embodiment, the watchdog unit 13 also outputs a status signal indicating a reset when it does not receive a dog-feeding signal.

[0060] At this point, two scenarios exist. First, there is a watchdog signal, but the frequency of the signal does not meet the requirements of the watchdog unit 13, thus triggering the output of a reset status signal (i.e., a reset signal well-known to those skilled in the art). Second, there is no signal input, thus triggering the output of a reset status signal (i.e., a reset signal well-known to those skilled in the art). Through this scheme, when the program execution of the microcontroller unit 14 malfunctions, the reset status signal output can be triggered, achieving program restart.

[0061] In an optional embodiment, the XOR circuit 12 generates a dog-feeding signal according to the control signal when the square wave generator's operating status signal indicates a stopped operating state.

[0062] XOR circuit 12 generates a dog-feeding signal based on the square wave signal when the square wave generator's working status signal represents the normal working state.

[0063] According to the above scheme, in the first case, the square wave generator's working status signal represents the normal working state, indicating that the square wave generator 21 is working normally, and the first transfer unit 11 has been connected to the square wave generator 21. At this time, simulation debugging or programming is being performed. Therefore, the microcontroller unit 14 does not output control signals. Only the square wave signal is input at this time, and the XOR circuit 12 generates a dog feed signal based on the square wave signal.

[0064] In the second scenario, the square wave generator's operating status signal indicates a stopped operating state, signifying that the square wave generator 21 has malfunctioned or that the first transfer unit 11 has disconnected from the square wave generator 21, ended the simulation debugging or programming process, and there is no square wave signal input at this time. When the microcontroller unit 14 receives the square wave generator operating status signal indicating a stopped operating state, it outputs a control signal with a frequency higher than the first watchdog frequency, so that the XOR circuit 12 only has a control signal input with a frequency higher than the first watchdog frequency, thereby outputting a watchdog signal to the watchdog unit 13, so that the watchdog unit 13 outputs a status signal indicating a normal operating state, thus maintaining the normal operation of the microcontroller unit 14.

[0065] In an alternative embodiment, reference Figure 2As shown, the first adapter unit 11 includes a first JTAG interface X1, which includes multiple first test pins such as TMS, TDO, TDI, and TMS, as well as a first watchdog signal pin 6. The adapter signal input terminal of the microcontroller unit 14 includes multiple adapter pins that are connected to the first test pins one by one. The first watchdog signal pin of the first JTAG interface X1 is connected to the XOR circuit 12.

[0066] The first JTAG interface X1 has multiple first test pins that input the received test signals to the microcontroller unit 14. The first watchdog signal pin of the first JTAG interface X1 is used to output the received square wave signal to the XOR circuit 12. It should be noted that the test signal at this time includes simulation information and programming information. In this patent, the test signal is used uniformly for ease of explanation. At this time, it is necessary to introduce the pins of the first JTAG interface X1 to explain the inventive point. When connecting to the emulator adapter or test equipment, it is generally implemented through the emulator adapter, that is, another JTAG interface connected to the first JTAG interface X1. The emulator adapter includes a square wave generating chip that generates a fixed square wave. The output pin of the square wave generating chip is connected to the first watchdog signal pin of the JTAG port of the emulator adapter. At this time, the first watchdog signal pin of the first JTAG interface X1 is in contact with the second watchdog signal pin of the JTAG interface of the emulator adapter when connected to the CPU anti-reset circuit, thereby realizing the transmission of the square wave signal. Since the JTAG port was not used in the existing scheme and was generally left floating as an empty pin, its use for square wave signal transmission in this application will not affect the connection between the emulator's JTAG port and other signal pins of the microcontroller.

[0067] In an alternative embodiment, refer to Figure 2 As shown, the XOR circuit 12 includes an XOR gate U2, which has a first input terminal, a second input terminal, and an output terminal. The first input terminal of the XOR gate U2 is connected to the watchdog signal output terminal of the microcontroller unit 14, the second input terminal of the XOR gate U2 is connected to the first watchdog signal pin of the first JTAG interface X1, and the output terminal of the XOR gate U2 is connected to the watchdog unit 13.

[0068] The XOR gate U2 can be implemented using an XOR logic chip, such as the SN74AHC1G86. In one optional implementation based on specific connection relationships, the microcontroller unit 14 is implemented using a TMS320F28335PGFA MCU. In this case, the first watchdog signal pin of the first JTAG interface X1 and the watchdog signal output by the MCU are respectively connected to the first input A and the second input B of the XOR logic chip. The output Y of the XOR logic chip is connected to the watchdog pin WDI of the watchdog unit 13, outputting a watchdog signal generated according to a control signal or a square wave signal. Through this scheme, as long as there is an input of a square wave signal or control signal above the first watchdog frequency, the watchdog unit 13 can output a status signal indicating normal operation to the microcontroller unit 14, thereby avoiding abnormal reset of the microcontroller unit 14 during debugging, programming, and other scenarios, thus achieving effective debugging and programming.

[0069] In one optional embodiment, the microcontroller unit 14 includes a switching signal input terminal, a reset signal input terminal, and a watchdog signal output terminal. The switching signal input terminal of the microcontroller unit 14 is connected to the first switching unit 11, the watchdog signal output terminal of the microcontroller unit 14 is connected to the XOR circuit 12, and the reset signal input terminal of the microcontroller unit 14 is connected to the watchdog unit 13.

[0070] Among them, the transfer signal input terminal of the microcontroller 14 receives simulation debugging information, programming information and square wave generator working status signal; the dog feed signal output terminal of the microcontroller 14 outputs control signal; and the reset signal input terminal of the microcontroller 14 receives status signal.

[0071] It should be noted that the microcontroller unit 14 at this time can be an MCU. In the experimental verification of this scheme, an MCU of model TMS320F28335PGFA was selected for implementation. It should be understood that this scheme can be extended to any control chip with a watchdog pin / reset pin to achieve the functions mentioned in this application. In the MCU of model TMS320F28335PGFA, GPIO48 is the watchdog pin of the MCU. During simulation debugging or programming, this pin does not output a watchdog signal, that is, a control signal with a frequency of zero. The first JTAG interface X1 connected to the MCU, the first watchdog signal pin of the first JTAG interface X1 and the GPIO48 pin of the MCU are used as the two inputs of an XOR gate. The specific signal of the XOR gate is SN74AHC1G86. The output of the XOR gate is used as the watchdog signal of the hardware watchdog 44 and connected to the WDI pin. The specific model of the watchdog unit 13 is MAX823.

[0072] In the specific workflow, during simulation debugging or programming using the emulator, GPIO48 does not generate a watchdog signal, while the JTAG adapter board generates a watchdog signal on the first watchdog signal pin. After completing the simulation debugging, the JTAG interface of the emulator adapter is disconnected. At this time, the MCU receives the working status signal of the stopped square wave generator and outputs a control signal higher than the first watchdog frequency through GPIO48. Therefore, the watchdog unit 13 will not trigger a timeout reset and can normally output a status signal indicating normal operation, so that the microcontroller unit 14 works normally and will not trigger a reset. Only when the program runs abnormally, after GPIO48 generates a control signal lower than the first watchdog frequency or equal to zero, will the watchdog unit 13 output a status signal indicating a reset to trigger a reset.

[0073] The following combination Figures 1-4 The principle of this invention will be explained as follows:

[0074] In the CPU reset prevention circuit, the first JTAG interface X1 connected to the MCU is directly connected to the third JTAG unit of the JTAG adapter board. The first watchdog signal pin of the first JTAG interface X1 is connected to the first input terminal 1 of the XOR logic chip, the watchdog pin GPIO48 of the MCU is connected to the second input terminal 2 of the XOR logic chip, the output terminal of the XOR logic chip is connected to the watchdog pin of the watchdog unit 13, and the signal generated by the watchdog unit 13 is connected to the reset pin RESET of the MCU.

[0075] A JTAG adapter board is an emulator adapter or virtual device used for simulation and debugging. In this application, it consists of an emulator, a second JTAG unit, a square wave generation unit, and a third JTAG unit. It also includes a personal terminal, such as a laptop computer used for simulation and debugging. Both the second and third JTAG units can be implemented via JTAG interfaces. The personal terminal connects to the emulator via a USB cable. The second and third JTAG units, along with the first JTAG interface X1, are used to connect the emulator and the MCU.

[0076] In one optional embodiment, the second JTAG unit and the third JTAG unit in the JTAG adapter board are the second JTAG port P1-input and the third JTAG port P2-output, respectively. The square wave generation unit is implemented using a square wave generation chip U1. The second JTAG port P1-input and the third JTAG port P2-output have the same structure and can both be implemented using an interface of model Header 7X2. For specific circuit details, please refer to [reference needed]. Figure 4 As shown, at this time, the second JTAG port P1-input is used as input, and the third JTAG port P2-output is used as output.

[0077] Based on the above scheme, this embodiment has three working states. In the first state, the JTAG adapter board is connected to the CPU anti-reset circuit. At this time, the second watchdog signal pin 6 of the second JTAG port P1-input is empty. Since the third watchdog signal pin 6 of the third JTAG port P2-output is connected to the square wave generation unit, the third watchdog signal pin 6 of the third JTAG port P2-output is connected to the clock output terminal 1 or 2 of the square wave generation chip U1 to generate a square wave pulse of fixed frequency. As long as there is a test or programming connection state, there will always be a square wave signal input, so that the XOR logic chip U2 can continuously obtain the square wave signal as a valid watchdog signal. At this time, the square wave generator working status signal detected by the MCU indicates that when the square wave generator 21 is working, the MCU does not output a control signal. Therefore, the watchdog can output a status signal indicating normal operation so that the MCU can work normally.

[0078] In the second state, the JTAG adapter board is disconnected from the CPU's anti-reset circuit. At this time, the second watchdog signal pin 6 of the second JTAG port P1-input is empty. Since the third watchdog signal pin 6 of the third JTAG port P2-output is connected to the square wave generation unit, it is connected to the clock output terminal 1 or 2 of the square wave generation chip U1 to generate a square wave pulse at a fixed frequency. However, at this time, the JTAG adapter board is not connected to the CPU's anti-reset circuit, so there is no square wave signal input to the XOR logic chip U2. At this time, the MCU outputs a control signal with a frequency higher than the first watchdog frequency, so that the XOR logic chip U2 can continuously obtain a control signal with a frequency higher than the first watchdog frequency as a valid watchdog signal, so that the watchdog can output a status signal indicating normal operation, and the MCU can work normally.

[0079] In the third operating state, the JTAG adapter board is disconnected from the CPU's anti-reset circuit, and the MCU experiences a malfunction. At this time, since the JTAG adapter board is not connected to the CPU's anti-reset circuit, there is no square wave signal input to the XOR logic chip U2, and the MCU cannot generate a control signal with a frequency higher than the first watchdog frequency. As a result, the XOR logic chip U2 only has a lower frequency control signal or no control signal as a valid watchdog signal, so that the watchdog can output a status signal indicating a reset, thereby resetting the MCU.

[0080] In summary, during simulation debugging or programming using an emulator, the MCU's GPIO48 does not output control signals, i.e., it does not generate a watchdog signal. The JTAG adapter board will output a square wave signal, i.e., the watchdog signal, on the third watchdog signal pin 6 of the third JTAG port P2-output. After completing the simulation debugging, disconnect the JTAG interface of the emulator adapter. At this time, the MCU receives the working status signal of the stopped square wave generator and outputs a control signal higher than the first watchdog frequency through GPIO48. Therefore, the watchdog unit 13 will not trigger a timeout reset and can normally output a status signal indicating normal operation, so that the microcontroller unit 14 works normally and will not trigger a reset. Only when the program runs abnormally, after GPIO48 generates a control signal lower than the first watchdog frequency or equal to zero, will the watchdog unit 13 output a status signal indicating a reset to trigger a reset.

[0081] Based on the above description, it is clear that this invention provides a solution for using a hardware watchdog timer not only during the programming process but also during simulation and debugging, ensuring system stability and reliability. By feeding the watchdog, the hardware watchdog timer effectively prevents misjudging system faults during simulation and debugging, reducing false alarms and erroneous operations. The hardware circuit is simple and can be widely applied in the design, development, and debugging of DSP systems, improving system maintainability and stability.

[0082] This invention also proposes a simulator adapter, with reference to... Figure 4 As shown, the simulator adapter includes a simulator 22, a second JTAG unit 23, a square wave generation unit 21, and a third JTAG unit 24. The second JTAG unit 23 is connected to the simulator 22, the square wave generation unit 21 is connected to the third JTAG unit 24, and the third JTAG unit 24 is connected to the second JTAG unit 23.

[0083] The emulator 22 is used to connect the microcontroller unit to the personal terminal and can burn the program output by the personal terminal to the microcontroller unit; it is also used to acquire test instructions and output test signals according to the test instructions. The second JTAG unit 23 acquires the test signals and outputs them. The square wave generation unit 21 generates square wave signals. The third JTAG unit 24 is used to connect to the first transfer unit 11 of the CPU anti-reset circuit during testing and burning, and is used to receive test signals and square wave signals and output them.

[0084] In the above scheme, the simulator 22 is generally connected to a personal terminal to acquire test signals, such as laptops, computers, mobile phones and other devices that can output test signals.

[0085] In the above scheme, during simulation or testing, it is generally connected to the command-issuing device through an emulator adapter, which is another JTAG interface connected to the first JTAG interface X1. In this application, the emulator adapter includes an emulator 22, a second JTAG unit 23, a square wave generation unit 21, and a third JTAG unit 24. The square wave generation unit 21 can be a square wave generation chip U1 that generates a fixed square wave. The output pin of the square wave generation chip U1 is connected to the third watchdog signal pin 66 of the third JTAG unit 24. At this time, the first watchdog signal pin 66 of the first JTAG interface X1 and the third watchdog signal pin 66 of the third JTAG unit 24 are connected in contact when the emulator adapter is connected to the CPU anti-reset circuit, thereby realizing the transmission of square wave signals. Since the original JTAG port was not used in the existing scheme and was generally left floating as an empty pin, its use for square wave signal transmission in this application will not affect the connection between the third JTAG unit 24 and other signal pins of the microcontroller.

[0086] Furthermore, the specific circuit diagrams for the second JTAG unit 23, the square wave generation unit 21, and the third JTAG unit 24 are provided below. Figure 4 As shown, resistors R1 and R2 in the circuit are 0-resistance resistors; only one of the two resistors needs to be soldered on the actual circuit board. The square wave generator chip U1 can be model YUSIJIE-2DS2, which can generate two 2Hz square wave pulses. The selected watchdog timer has a reset time of 1.6 seconds, and the feed signal frequency needs to be greater than 0.625Hz to meet the requirements.

[0087] The present invention also proposes a CPU anti-reset system, which further includes the CPU anti-reset circuit as described above and the emulator adapter as described above. The first adapter unit 11 of the CPU anti-reset circuit is connected to the third JTAG unit 24 of the emulator adapter.

[0088] It should be noted that since the CPU anti-reset system uses the complete solution of the CPU anti-reset circuit and the emulator adapter, the CPU anti-reset system also has all the embodiments and beneficial effects of the CPU anti-reset circuit and the emulator adapter, which will not be repeated here.

[0089] In one alternative approach, refer to Figure 5 As shown, the CPU reset prevention system also includes a personal terminal. The personal terminal is connected to the emulator adapter.

[0090] The personal terminal outputs test commands, which can be issued automatically or entered by the user through various input methods such as keyboard, mouse, voice, and gestures, and then converted into corresponding test commands for output. This achieves diversity in command input.

[0091] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of the invention may be practiced without these specific details. Similarly, for the sake of brevity and to aid in understanding one or more aspects of the invention, in the description of exemplary embodiments of the invention above, various features of the embodiments are sometimes grouped together in a single embodiment, figure, or description thereof. The claims, which follow the detailed description, are hereby expressly incorporated into that detailed description, wherein each claim itself is a separate embodiment of the invention.

[0092] Those skilled in the art will understand that the modules in the device of the embodiment can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or components in the embodiment can be combined into a single module, unit, or component, and further, they can be divided into multiple sub-modules, sub-units, or sub-components, except that at least some of such features and / or processes or units are mutually exclusive.

[0093] It should be noted that the above embodiments are illustrative of the invention and not restrictive, and that those skilled in the art can devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be construed as limiting the order of execution.

Claims

1. A CPU reset prevention circuit, characterized in that, The CPU reset prevention circuit includes: The first switching unit is used to receive a square wave signal from the square wave generator of the simulator switching device and to obtain the square wave generator's operating status signal. A microcontroller unit with a first feeding frequency is used to acquire the working status signal of the square wave generator and output a control signal when the working status signal of the square wave generator indicates a stopped working state. The working frequency of the control signal and the working frequency of the square wave signal are both higher than the first feeding frequency. An XOR circuit is used to output a dog-feeding signal based on the square wave signal or the control signal; The watchdog unit is used to output a status signal indicating normal operation when the watchdog signal is received; The microcontroller unit is also configured to not reset and perform simulation debugging, programming, or normal operation actions when it receives the status signal that represents normal operation. The microcontroller unit includes a switching signal input terminal, a reset signal input terminal, and a watchdog signal output terminal. The switching signal input terminal of the microcontroller unit is connected to the first switching unit and is used to receive simulation debugging information, programming information, and the working status signal of the square wave generator. The watchdog signal output terminal of the microcontroller unit is connected to the XOR circuit and is used to output the control signal. The reset signal input terminal of the microcontroller unit is connected to the watchdog unit and is used to receive the status signal. The first dog feeding frequency is the operating frequency required for a normal dog feeding signal by the microcontroller. Only when the frequency is greater than this value is the dog feeding behavior effective. The first adapter unit includes a first JTAG interface, which includes multiple first test pins and a first dog feed signal pin. The adapter signal input terminal of the microcontroller includes multiple adapter pins that are connected to the first test pins one by one. The multiple first test pins input the connected test signals to the microcontroller. The first dog-feed signal pin of the first JTAG interface is connected to the XOR circuit and is used to output the received square wave signal to the XOR circuit; The XOR circuit generates the dog-feeding signal according to the control signal when the square wave generator's working state signal indicates a stopped working state. The XOR circuit generates the dog-feeding signal based on the square wave signal when the square wave generator's operating status signal represents the normal operating state.

2. The CPU anti-reset circuit according to claim 1, characterized in that, The watchdog unit is also used to output the status signal representing a reset when the watchdog signal is not received.

3. The CPU anti-reset circuit according to claim 1, characterized in that, The microcontroller unit is configured not to output the control signal when the square wave generator's operating status signal represents the normal operating state.

4. The CPU anti-reset circuit according to claim 1, characterized in that, The first adapter unit is connected to both the microcontroller unit and the watchdog unit. The XOR circuit is connected to both the first adapter unit and the microcontroller unit. The watchdog unit is connected to the microcontroller unit.

5. The CPU anti-reset circuit according to claim 1, characterized in that, The XOR circuit includes an XOR gate, which has a first input terminal, a second input terminal, and an output terminal. The first input terminal of the XOR gate is connected to the watchdog signal output terminal of the microcontroller unit, the second input terminal of the XOR gate is connected to the first watchdog signal pin of the first JTAG interface, and the output terminal of the XOR gate is connected to the watchdog unit.

6. A simulator adapter device, characterized in that, The simulator adapter includes: The simulator is used to connect the microcontroller to a personal terminal and to program the program output by the personal terminal to the microcontroller; it is also used to acquire test instructions and output test signals according to the test instructions. The second JTAG unit is connected to the emulator and is used to acquire the test signal and output it. A square wave generation unit is connected to the third JTAG unit and is used to generate square wave signals; The third JTAG unit is connected to the second JTAG unit and is used to connect to the first adapter unit of the CPU anti-reset circuit according to any one of claims 1-5 during testing and programming, for receiving the test signal and the square wave signal and outputting them.

7. A CPU reset prevention system, characterized in that, The CPU anti-reset system further includes the CPU anti-reset circuit as described in any one of claims 1-5 and the emulator adapter as described in claim 6, wherein the first adapter unit of the CPU anti-reset circuit is connected to the third JTAG unit of the emulator adapter.

Citation Information

Patent Citations

  • Joint reset device and method based on watchdog

    CN114691442A

  • Circuit for preventing resetting of central processing unit (CPU) in programming process of digital signal processor (DSP) chip

    CN201828797U

  • Simulated resetting circuit device

    CN202257549U