CN110162421A - A kind of embedded software house dog test method and device containing interrupt function - Google Patents

A kind of embedded software house dog test method and device containing interrupt function Download PDF

Info

Publication number
CN110162421A
CN110162421A CN201910347841.2A CN201910347841A CN110162421A CN 110162421 A CN110162421 A CN 110162421A CN 201910347841 A CN201910347841 A CN 201910347841A CN 110162421 A CN110162421 A CN 110162421A
Authority
CN
China
Prior art keywords
watchdog
function
software
house dog
program
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910347841.2A
Other languages
Chinese (zh)
Other versions
CN110162421B (en
Inventor
殷永峰
闫亚琴
武宁
李秋儒
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beihang University
Original Assignee
Beihang University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beihang University filed Critical Beihang University
Priority to CN201910347841.2A priority Critical patent/CN110162421B/en
Publication of CN110162421A publication Critical patent/CN110162421A/en
Application granted granted Critical
Publication of CN110162421B publication Critical patent/CN110162421B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/24Resetting means
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • G06F11/0736Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in functional embedded systems, i.e. in a data processing system designed as a combination of hardware and software dedicated to performing a certain function
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0751Error or fault detection not based on redundancy
    • G06F11/0754Error or fault detection not based on redundancy by exceeding limits
    • G06F11/0757Error or fault detection not based on redundancy by exceeding limits by exceeding a time limit, i.e. time-out, e.g. watchdogs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0793Remedial or corrective actions

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The present invention relates to a kind of embedded software house dog test method and device containing interrupt function.For the program of no interrupt function, it is implanted directly into the endless loop code of triggering watchdog reset signal, whether there is or not the correctness for carrying out watchdog reset verifying software watchdog function realization for determining program.For there is the program of interrupt function, in the endless loop code that other than executing above-mentioned steps, need to be also implanted into triggering watchdog reset signal inside interrupt routine, whether there is or not the correctness for carrying out watchdog reset verifying software watchdog function realization for determining program.So that software correctly utilizes watchdog function, realizes and run winged rear Program reset function.So that traditional house dog test method is improved raising, is conducive to improve military product reliability, has good operability and observability.

Description

A kind of embedded software house dog test method and device containing interrupt function
Technical field
The invention belongs to software test verification technique fields more particularly to a kind of embedded software containing interrupt function to see Door dog test method and device.
Background technique
In the embedded system of commercialization, it can automatically reset to make system in abnormal cases, be typically necessary and draw Enter house dog.
House dog is exactly the counter that can be reset within a certain period of time.After house dog starting, counter is opened Dynamic counting is started from, by certain time, if be not reset, counter overflow, which will generate a reset signal to CPU, to be made System reboot (is commonly called as " being stung by dog ").When system operates normally, need in the time interval that house dog allows to house dog meter Number device resets and (is commonly called as " feeding dog "), does not allow reset signal to generate.If system does not go wrong, program guarantees " to feed dog " on time, one Denier program fleet does not have " feeding dog ", and system " being snapped " resets.
It can be mainly divided into two kinds of house dog in present embedded system:
1, house dog included inside CPU: such house dog is usually by the timer in a chip as guarding the gate By the initialization of program initial value is written, the time is overflowed in setting, and starts timer in dog.Program assigns initial value to timer on time (or reset), in order to avoid be snapped.This house dog is can be forbidden (as long as stopping this timer).
Advantage: the time can be overflowed by routine change, can disabled at any time.
Disadvantage: it needs to initialize;Fly or run after disabling to fly if program is run before initialization, start completion, house dog System can not be just resetted, the effect of such house dog is just without system recovery capability reduces.
2, independent watchdog chip: this house dog mainly have one for feed dog pin (generally with the GPIO of CPU It is connected) and a reset pin (being connected with the RESET pin of system), if feeding the electricity of dog foot without changing within a certain period of time Flat, reset pin will change state reset CPU.Such house dog one, which powers on, begins to work, can not disable.
Advantage: it without configuration, powers on and uses.It can not disable, system must feed dog on time, and system recovery capability is high.
Disadvantage: can not flexible configuration overflow the time, can not disable, flexibility reduce.
In existing military project system, considers the reliability and restorative requirement of product, product is needed to have high stability. Most of Military embedded software is all made of the watchdog reset technology of independent watchdog chip.
Traditional to the side in software watchdog test job, often taking implantation while (1) endless loop inside program Formula triggers watchdog reset.If house dog energy proper reset, then it represents that software watchdog function is realized normal.If cannot guard the gate Dog proper reset, then it represents that software watchdog function is realized abnormal.
But the above method does not consider the abnormal conditions in program containing interrupt function.When the inside of Interruption function into It has gone dog feeding operation, when the timing cycle of Interruption is less than the watchdog reset time, has been interrupted even if using conventional method Function external implants while (1) endless loop, and software watchdog can not also be resetted.At this point, software watchdog function is realized Failure.
Summary of the invention
To solve the above-mentioned problems, the present invention proposes a kind of army that has independent watchdog chip of the consideration containing interrupt function With embedded software house dog test method.It is answered outside the interrupt function of program with interrupt function internal trigger house dog respectively While (1) sentence and Complied executing of bit function monitor watchdog reset model, test verifying software watchdog function in real time The correctness being able to achieve.
A kind of embedded software house dog test method containing interrupt function, comprising the following steps:
Step 1: obtaining tested program, any position inserts while (1) endless loop in the software agent of tested program Code, compiling, which generates and executes not hello dog, successfully simulates main program;
Step 2: real-time monitoring watchdog reset signal reports watchdog function if software watchdog is not carried out reset operation It is abnormal;
Step 3: judging whether there is Interruption function in software if the software watchdog of step 2, which executes, resets operation;
If, when software watchdog, which executes, resets operation, report watchdog function is normal without timer interrupt routine in software;
If there is timer interrupt routine in software, any position inserts while (1) endless loop code in interrupt function, Not hello dog is generated again successfully simulates main program;
Step 4: real-time monitoring watchdog reset signal, when software watchdog is not carried out reset operation, report watchdog function It is abnormal;When software watchdog, which executes, resets operation, report watchdog function is normal.
Preferably, the software watchdog is not carried out reset operation and does not receive watchdog reset signal, software watchdog It executes to reset to operate and receives watchdog reset signal.
A kind of embedded software house dog test device containing interrupt function, be equipped in the test device with it is discrete The connected signal lamp of signal is measured, discrete magnitude 1, lamp is bright;Discrete magnitude is 0, and lamp goes out.
Preferably, the testing procedure of the test device are as follows:
Step 1: test device burning tested program, is added the signal variable of the discrete magnitude, signal in tested program Initialization of variable is 1;
Step 2: being inserted into house dog in test program realizes test function, by discrete magnitude signal inside test function It is set to 0;
Step 3: generating program using test method described in claim 1, judge whether house dog is realized normal;
Step 4: signal lamp cycle recycles light on and off when software watchdog function realizes normal;
Step 5: when software watchdog function realizes abnormal, signal lamp it is bright it is primary after be always maintained at lamp and go out.
Preferably, the test device is SCM Based control panel.
Beneficial effects of the present invention: The present invention gives have the embedded software of independent watchdog chip in watchdog function There is the test method of Interruption function special circumstances when realization, respectively outside the interrupt function of program and inside interrupt function While (1) sentence and Complied executing of watchdog reset function are triggered, monitors watchdog reset signal, test verifying in real time The correctness that software watchdog function is realized.And devise a kind of test device that the watchdog function that can directly observe is realized. So that traditional house dog test method is improved raising, is conducive to improve military product reliability, has good operability And observability.
Detailed description of the invention
Fig. 1 is house dog test method flow chart according to the present invention.
Fig. 2 is the structural representation of the test device of house dog test method output signal according to the present invention monitoring Figure.
Specific embodiment
Now in conjunction with attached drawing, invention is further described in detail:
As shown in Figure 1, a kind of Military embedded software house dog test for having independent watchdog chip for having interrupt function Method.It include: acquisition tested program;The side of any position implantation while (1) endless loop in procedure subject (non-interrupted function) Formula triggers watchdog reset.If being unable to house dog proper reset, then it represents that software watchdog function is realized abnormal.Judge software In whether there is or not interrupt functions: if without interrupt function in software, if house dog proper reset, then it represents that software watchdog function realize just Often;There is interrupt function in software, the mode of interrupt function inside any position implantation while (1) endless loop, triggering are seen again again Door dog resets.If being unable to house dog proper reset, then it represents that software watchdog function is realized abnormal.If house dog proper reset, It is normal then to indicate that software watchdog function is realized.
Detailed process is as follows:
One, tested program is obtained;
Two, any position inserts endless loop code in tested program main body (non-interrupted function), and compiling is generated and executed Dog is not fed successfully simulates main program;
Three, real-time monitoring watchdog reset signal;
Four, software watchdog is not carried out reset operation (not receiving watchdog reset signal), and report watchdog function is abnormal;
Five, Interruption function is judged whether there is, if without timer interrupt routine, when software watchdog, which executes, resets operation (receiving watchdog reset signal), report watchdog function are normal;
Six, if there is timer interrupt routine, then any position inserts endless loop code in interrupt function, generates again not It feeds dog and successfully simulates main program;
Seven, real-time monitoring watchdog reset signal:
When software watchdog is not carried out reset operation (not receiving watchdog reset signal), report watchdog function is abnormal;
(watchdog reset signal is received) when software watchdog, which executes, resets operation, and report watchdog function is normal.
As shown in Fig. 2, a kind of Military embedded software house dog test for having independent watchdog chip for having interrupt function Device.
It is included in inside software program and is inserted into signal testing function, it is discrete containing being connected with outer signals lamp in function Measure signal.The signal is initialized as 1 in function external, and lamp is bright.The discrete magnitude is set to 0 when going to inside the function, lamp It goes out.When carrying out house dog test using the scheme of first purpose, if watchdog function realize it is normal, signal lamp about with The loop cycle light on and off lamp of watchdog reset time.If house dog realize it is abnormal, signal lamp it is bright it is primary after be always maintained at and go out.
Detailed process is as follows:
One, the signal lamp being connected with discrete magnitude signal is installed in test device.Discrete magnitude is 1, and lamp is bright;Discrete magnitude is 0, Lamp goes out;
Two, increase discrete magnitude signal variable in tested program, and be initialized as 1;
Three, insertion house dog realizes test function, and discrete magnitude signal is set to 0 inside function;
Four, program is generated using the test method of Fig. 1, judges whether house dog is realized normal;
Five, when the realization of software watchdog function is normal, signal lamp cycle recycles light on and off, and principle is: working as watchdog function It realizes normally, reset operation, step 2 and step 3 constantly is carried out to system in the case where house dog is had an effect after being placed in failure Circulation is bright to going out by lamp, therefore signal lamp cycle recycles light on and off.
Six, when software watchdog function is realized it is abnormal when, signal lamp it is bright it is primary after be always maintained at lamp and go out.Principle: when guarding the gate Dog function realizes abnormal, only software reset's operation of progress after merging failure.Experienced step 2 and step 3 it is primary by Lamp is bright to the process gone out.Therefore signal lamp it is bright it is primary after be always maintained at lamp and go out.

Claims (5)

1. a kind of embedded software house dog test method containing interrupt function, which comprises the following steps:
Step 1: obtaining tested program, any position inserts while (1) endless loop code in the software agent of tested program, Compiling, which generates and executes not hello dog, successfully simulates main program;
Step 2: real-time monitoring watchdog reset signal, if software watchdog is not carried out reset operation, report watchdog function is different Often;
Step 3: judging whether there is Interruption function in software if the software watchdog of step 2, which executes, resets operation;
If, when software watchdog, which executes, resets operation, report watchdog function is normal without timer interrupt routine in software;
If there is timer interrupt routine in software, any position inserts while (1) endless loop code in interrupt function, again It generates not hello dog and successfully simulates main program;
Step 4: real-time monitoring watchdog reset signal, when software watchdog is not carried out reset operation, report watchdog function is different Often;When software watchdog, which executes, resets operation, report watchdog function is normal.
2. a kind of embedded software house dog test method containing interrupt function according to claim 1, feature exist In: the software watchdog is not carried out reset operation and does not receive watchdog reset signal, and software watchdog, which executes, resets operation Receive watchdog reset signal.
3. a kind of embedded software house dog test device containing interrupt function, it is characterised in that: pacify in the test device Equipped with the signal lamp being connected with discrete magnitude signal, discrete magnitude 1, lamp is bright;Discrete magnitude is 0, and lamp goes out.
4. a kind of embedded software house dog test device containing interrupt function according to claim 3, feature exist In the testing procedure of the test device are as follows:
Step 1: test device burning tested program, is added the signal variable of the discrete magnitude, signal variable in tested program It is initialized as 1;
Step 2: being inserted into house dog in test program realizes test function, discrete magnitude signal is set to inside test function 0;
Step 3: generating program using test method described in claim 1, judge whether house dog is realized normal;
Step 4: signal lamp cycle recycles light on and off when software watchdog function realizes normal;
Step 5: when software watchdog function realizes abnormal, signal lamp it is bright it is primary after be always maintained at lamp and go out.
5. a kind of embedded software house dog test device containing interrupt function according to claim 3 or 4, feature Be: the test device is SCM Based control panel.
CN201910347841.2A 2019-04-28 2019-04-28 Embedded software watchdog test method and device containing interrupt function Active CN110162421B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910347841.2A CN110162421B (en) 2019-04-28 2019-04-28 Embedded software watchdog test method and device containing interrupt function

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910347841.2A CN110162421B (en) 2019-04-28 2019-04-28 Embedded software watchdog test method and device containing interrupt function

Publications (2)

Publication Number Publication Date
CN110162421A true CN110162421A (en) 2019-08-23
CN110162421B CN110162421B (en) 2020-11-10

Family

ID=67640157

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910347841.2A Active CN110162421B (en) 2019-04-28 2019-04-28 Embedded software watchdog test method and device containing interrupt function

Country Status (1)

Country Link
CN (1) CN110162421B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110716821A (en) * 2019-10-14 2020-01-21 深圳市凌壹科技有限公司 Communication method and device for watchdog

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1790282A (en) * 2004-12-17 2006-06-21 日本电气株式会社 Context save method, information processor and interrupt generator
CN203838691U (en) * 2014-05-27 2014-09-17 山东美核自动化科技有限公司 Watchdog fault monitoring device
CN104899110A (en) * 2015-06-05 2015-09-09 宁波三星智能电气有限公司 Setting and feeding method for watchdog
US9652702B2 (en) * 2015-05-29 2017-05-16 Canon Kabushiki Kaisha Electronic apparatus
CN108205490A (en) * 2016-12-19 2018-06-26 比亚迪股份有限公司 Software watchdog test method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1790282A (en) * 2004-12-17 2006-06-21 日本电气株式会社 Context save method, information processor and interrupt generator
CN203838691U (en) * 2014-05-27 2014-09-17 山东美核自动化科技有限公司 Watchdog fault monitoring device
US9652702B2 (en) * 2015-05-29 2017-05-16 Canon Kabushiki Kaisha Electronic apparatus
CN104899110A (en) * 2015-06-05 2015-09-09 宁波三星智能电气有限公司 Setting and feeding method for watchdog
CN108205490A (en) * 2016-12-19 2018-06-26 比亚迪股份有限公司 Software watchdog test method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
网友: ""如何让led灯2秒闪烁闪,利用看门狗和计数器"", 《百度知道,HTTPS://ZHIDAO.BAIDU.COM/QUESTION/1116007654016870179.HTML》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110716821A (en) * 2019-10-14 2020-01-21 深圳市凌壹科技有限公司 Communication method and device for watchdog
CN110716821B (en) * 2019-10-14 2023-07-25 深圳市凌壹科技有限公司 Communication method and device for watchdog

Also Published As

Publication number Publication date
CN110162421B (en) 2020-11-10

Similar Documents

Publication Publication Date Title
Colin et al. An energy-interference-free hardware-software debugger for intermittent energy-harvesting systems
CN101706753B (en) Unit testing framework and method based on Perl
Jagannath et al. Improved multithreaded unit testing
US7630841B2 (en) Supervising and sequencing commonly driven power supplies with digital information
CN100568191C (en) The full-range dog-feeding method of embedded system
ES2778599T3 (en) Cardiac pacemaker system
Jee et al. A safety-assured development approach for real-time software
CN113157508B (en) Test method, system, device, equipment and storage medium of embedded system
CN106017727A (en) Multi-chip temperature testing and calibrating system and method
CN104125504B (en) Deployment method, device and system based on continuous integration
CN110162421A (en) A kind of embedded software house dog test method and device containing interrupt function
US5008885A (en) Event-controlled error injection system
CN104050050A (en) Watchdog control circuit and control method
CN101267623A (en) A booting construction method for a mobile phone
CN105527945A (en) System and method for realizing rapid mass production, detection and equipment information recording of intelligent health wearable equipment
CN207115391U (en) A kind of automatic reset circuit
US20180285241A1 (en) Energy-interference-free debugger for intermittent energy-harvesting systems
CN109918250A (en) A kind of method, apparatus and readable storage medium storing program for executing of server power supply timing sequence test
CN116225807A (en) Method, system, device, equipment and storage medium for testing embedded equipment
CN105700915B (en) A kind of method and apparatus for taking into account watchdog function and monitoring of software programming function
CN110109802A (en) A kind of real-time method and system for reading hard disk temperature
CN110659169B (en) Method for testing automatic dormancy awakening pressure of android system
CN106648951B (en) Watchdog control circuit and watchdog application circuit
KR20210033733A (en) Test method and test device of battery management system
CN106909382A (en) Output different type system starts the method and device of information

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant