CN103793032B - Method and apparatus for determining electrification reset - Google Patents
Method and apparatus for determining electrification reset Download PDFInfo
- Publication number
- CN103793032B CN103793032B CN201210433242.0A CN201210433242A CN103793032B CN 103793032 B CN103793032 B CN 103793032B CN 201210433242 A CN201210433242 A CN 201210433242A CN 103793032 B CN103793032 B CN 103793032B
- Authority
- CN
- China
- Prior art keywords
- reset
- verification
- electronic equipment
- electrification
- types
- 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.)
- Active
Links
Landscapes
- Read Only Memory (AREA)
- Techniques For Improving Reliability Of Storages (AREA)
Abstract
The embodiments of the invention provide a kind of method and apparatus for determining electrification reset.Methods described, which is applied to one, has the electronic equipment of internal memory, and the internal memory includes verification region, and the verification region is used to be stored in the calibration reference do not lost in non-electrification reset and verification variable.Methods described includes:When being resetted in the electronic equipment, the verification variable and calibration reference in the verification region are read, performing verification to the verification variable calculates, and obtains result of calculation;Compare the result of calculation and the calibration reference, whether the reset types that the electronic equipment is determined according to the result of calculation are electrification resets;And when determination is electrification reset, the verification variable and the calibration reference are re-write into the verification region, determined for reset types next time.It is described to be used to determine that the method and apparatus of electrification reset carry out simple, effective, reliable electrification reset type on the basis of other hardware devices are not increased and judge.
Description
Technical field
The present embodiments relate to the field of electronic technology, and more particularly, to one kind for determining electronic equipment
Electrification reset type method and apparatus.
Background technology
With the development of electronic technology, a variety of functions, the electricity are realized using a variety of electronic equipments
Sub- equipment is, for example, micro-control unit (Micro Control Unit), digital signal processor (Digital Signal
Processing), the electronic module such as CPU (Central Processing Unit).In the electronic equipment
, it is necessary to carry out various types of resets during use, electrification reset, hardware reset, software reset, dog reset etc..Pin
To a variety of reset types, it is necessary to carry out different configurations, therefore it is required that being capable of determining that phase when electronic equipment resets
The reset types answered.
For the determination of the electrification reset in the reset types, mainly there are following two modes at present:One is using multiple
Bit register determines electrification reset and non-electrification reset;Another is to determine electrification reset and non-by PLD
Electrification reset.
In the case of the electrification reset and non-electrification reset of electronic equipment are determined using reseting register, it can only utilize
Reseting register determines whether it is software reset.When it is determined that reset types are not software resets, reseting register not can determine that
It is hardware reset or electrification reset, leads to not distinguish hardware reset and electrification reset
Determine that the process of electrification reset and non-electrification reset is as follows by PLD, enable programmable logic device
The register electrification reset of part can preparatory function so that after electrification reset, the reset values of correspondence register are predisposed to A;
PLD is programmed, the reset values of register are configured differently than to A B, after system starts, reading pair
The value of register is answered, if A, is then judged as electrification reset, is otherwise judged as band reset.Utilizing PLD
In the case of determining electrification reset and non-electrification reset, the volume of PLD is larger, for some miniature devices, increases
Plus a huge PLD is unacceptable, and the program is dependent on the PLD after upper electricity
Preparatory function.
In consideration of it, present invention contemplates that simply and reliably determine whether under conditions of not by other devices be on electricity
Reset.
The content of the invention
The embodiment of the present invention provides a kind of method and apparatus for being used to determine the electrification reset type of electronic equipment, and it can
Simple, effective, reliable electrification reset type is carried out on the basis of other hardware devices are not increased to judge.
There is provided a kind of method for determining reset types for first aspect, it is characterised in that this method is applied to one with interior
The electronic equipment deposited, the internal memory includes verification region, and the verification region is used to be stored in the verification do not lost in non-electrification reset
Benchmark and verification variable, the calibration reference are obtained, methods described by calculating the verification variable execution verification
Including:When being resetted in the electronic equipment, the verification variable and calibration reference in the verification region are read, to described
Verify variable and perform the verification calculating, and obtain result of calculation;Compare the result of calculation and the calibration reference, when described
When result of calculation is not equal to the calibration reference, the reset types for determining the electronic equipment are electrification resets, are calculated when described
When being as a result equal to the calibration reference, the reset types for determining the electronic equipment are non-electrification resets;And it is described when determining
The reset types of electronic equipment are electrification resets, and the verification variable and the verification base are re-write into the verification region
Standard, is determined for reset types next time.
It is described that the school is performed to the verification variable with reference in a first aspect, in a kind of implementation of first aspect
Testing calculating includes:The calculating that XOR subtracts one is performed to each verification variable in the verification variable.
It is described by increase in another implementation of first aspect with reference to first aspect and its above-mentioned implementation
The number of verification variable fixes exactness really to improve reset types.
With reference to first aspect and its above-mentioned implementation, in another implementation of first aspect, the electronic equipment
Also include reseting register, methods described also includes:When being resetted in the electronic equipment, the reseting register is utilized
To determine whether the reset types of electronic equipment are software resets;It is determined that the reset types are not the situations of software reset
Under, perform the reading, verification and calculate and determine operation to determine that the reset types are that electrification reset is also non-electrification reset.
With reference to first aspect and its above-mentioned implementation, in another implementation of first aspect, the electronic equipment
Also include heartbeat register, when it is determined that the reset types are non-electrification resets, methods described also includes:Utilize the heartbeat
Register is that electrification reset is also non-electrification reset come the reset types for determining the electronic equipment.
With reference to first aspect and its above-mentioned implementation, in another implementation of first aspect, the internal memory is electricity
Internal memory in sub- equipment or the internal memory being connected with the electronic equipment.
There is provided a kind of electronic equipment for second aspect, it is characterised in that including:Internal memory, including verification region, the verification
Region is used to be stored in the calibration reference do not lost in non-electrification reset and verification variable, and the calibration reference is by described
Verify variable and perform what verification was calculated and obtained;Reset types determining module.The reset types determining module includes:Calculate single
Member, during for being resetted in the electronic equipment, reads the verification variable and calibration reference in the verification region,
The verification calculating is performed to the data value of the verification variable, and obtains result of calculation;First determining unit, for comparing
Result of calculation and the calibration reference are stated, when the result of calculation is not equal to the calibration reference, the electronic equipment is determined
Reset types be electrification reset, when the result of calculation is equal to the calibration reference, determine the reset of the electronic equipment
Type is non-electrification reset;Assignment unit, for it is determined that the reset types of the electronic equipment are electrification resets, to the school
Test in region and re-write the verification variable and the calibration reference, determined for reset types next time.
With reference to second aspect, in a kind of implementation of second aspect, the computing unit can be by the verification
The calculating that each verification variable execution XOR in variable subtracts one calculates to perform the verification.
With reference to second aspect and its above-mentioned implementation, in another implementation of second aspect, the computing unit
By increasing the number of the verification variable to improve reset types exactness can be fixed really.
With reference to second aspect and its above-mentioned implementation, in another implementation of second aspect, the electronic equipment
Reseting register can also be included, the reset types determining module may also include:Second determining unit, it is described multiple for utilizing
Whether bit register is software reset come the reset types for determining electronic equipment;Wherein, determined in the second determining unit described multiple
In the case that position type is not software reset, the computing unit and first determining unit are operated to determine the electricity
The reset types of sub- equipment are that electrification reset is also non-electrification reset.
With reference to second aspect and its above-mentioned implementation, in another implementation of second aspect, the electronic equipment
Heartbeat register is may also include, the reset types determining module may also include:3rd determining unit, for when the first determination list
When the member determination reset types are non-electrification resets, the reset class of the electronic equipment is determined using the heartbeat register
Type is that electrification reset is also non-electrification reset.
With reference to second aspect and its above-mentioned implementation, in another implementation of second aspect, the internal memory is position
Internal memory in electronic equipment or the internal memory being connected with the electronic equipment.
The embodiment of the present invention as verification region can carry out upper electricity using the given number byte that is selected from internal memory
The determination of reset, sentences so as to carry out simple, effective, reliable electrification reset type on the basis of other hardware devices are not increased
It is disconnected.
Brief description of the drawings
In order to illustrate the technical solution of the embodiments of the present invention more clearly, below will be in embodiment or description of the prior art
The required accompanying drawing used is briefly described, it should be apparent that, drawings in the following description are only some realities of the present invention
Example is applied, for those of ordinary skill in the art, on the premise of not paying creative work, can also be according to these accompanying drawings
Obtain other accompanying drawings.
Fig. 1 is the schematic illustration in verification region according to embodiments of the present invention;
Fig. 2 is to show the flow chart for being used to determine the method for electrification reset according to embodiments of the present invention;
Fig. 3 is diagrammatically illustrated for realizing the journey for being used to determine the method for electrification reset according to embodiments of the present invention
Sequence;
Fig. 4 is to show the flow chart according to another embodiment of the present invention for being used to determine the method for electrification reset;
Fig. 5 is to show the block diagram for being used to determine the device of electrification reset according to embodiments of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Site preparation is described, it is clear that described embodiment is a part of embodiment of the invention, rather than whole embodiments.Based on this hair
Embodiment in bright, the every other implementation that those of ordinary skill in the art are obtained under the premise of creative work is not made
Example, belongs to the scope of protection of the invention.
It is briefly described as follows the principle of the embodiment of the present invention.Value in the internal memory of electronic equipment is in such as hardware reset, soft
It can be preserved in the non-electrification reset of part reset etc, but if electronic equipment power down, then the value in the internal memory can lose.In electricity
After sub- equipment is re-powered, if the value not carried out actively to the internal memory in assignment, the internal memory is mess code.It is based on
This, from the interior verification base deposited verification variable in the presence of selection specific region and obtained according to the verification variable of electronic equipment
It is accurate;When the use process of electronic equipment resets, if performing verification to verification variable calculates obtained check results
Unequal with the calibration reference, then the value in explanation verification region turns into mess code due to power down, and the type of the reset is
Electrification reset;If the check results are equal with the calibration reference, the value in verification region is not mess code, the electronics
The type of reset in equipment is non-electrification reset (i.e. band reset).
The method for being used to determine electrification reset according to embodiments of the present invention is applied to any electronic equipment with internal memory,
The electronic equipment for example can be micro-control unit, digital signal processor, CPU, field programmable gate array electricity
Road etc., as long as it has internal memory.
The internal memory includes verification region, and the verification region is used to be stored in the calibration reference do not lost in non-electrification reset
With verification variable, the calibration reference is obtained by performing verification calculating to the verification variable.It should be noted that in described
The internal memory that can be internal memory in electronic equipment or be connected with the electronic equipment is deposited, it is, for example, that arbitrary access is deposited
Reservoir (RAM, Random Access Memory) internal memory.
As an example, for example selecting to open from the base address (that is, the address of the 0th byte) of internal memory in the internal memory of electronic equipment
128 bytes begun are used as the verification region.In addition, the start address of the internal memory is not limited to base address, it can be according to reality
Trample needs to flexibly set, it for example can also be the address of the 100th byte of the internal memory;The certain number of byte
128 bytes are also not limited to, it, in practice can be according to above replying by cable such as can also be 32 bytes, 64 bytes
The determination accuracy requirement of position verifies the byte number in region suitably to set.Generally, the byte number is bigger, then electrification reset
Determine that the degree of accuracy is higher.
The verification region is used to be stored in the calibration reference do not lost in non-electrification reset and verification variable.Fig. 1 is root
According to the schematic illustration in the verification region of the embodiment of the present invention.In Fig. 1, the calibration reference CR takes preceding the two of verification region
Individual byte, the verification variable data 1, data 2 ... data 63 takes the remainder bytes in verification region, and each verification becomes
Amount takes two bytes.It should be noted that the byte number for being used to deposit calibration reference CR can also be a byte or four words
Section, it is not limited to two.
If electronic equipment power down, the value of each byte is mess code in the verification region after upper electricity.
In the state after electronic equipment is normally run, the mode of verification sum can be used to deposit the verification region
Take.The calibration reference can for example be obtained by way of the verification variable XOR subtracts one.That is,
WhereinRepresent XOR.Furthermore, it is possible to take other modes to obtain the calibration reference, for example, take and follow
The modes such as ring redundant code (CRC, Cyclic Redundancy Code) verification.In practice, can using existed or
The various modes occurred in the future from the verification variable obtain the calibration reference, and specific mode is not constituted to the present invention's
Limitation.
Fig. 2 is to show the flow chart for being used to determine the method 200 of electrification reset according to embodiments of the present invention.The side
Method 200 includes:When being resetted in the electronic equipment, the verification variable and calibration reference in the verification region are read,
The verification is performed to the verification variable to calculate, and obtains result of calculation (210);Compare the result of calculation and the verification
Benchmark, when the result of calculation is not equal to the calibration reference, the reset types for determining the electronic equipment are electrification resets,
When the result of calculation is equal to the calibration reference, the reset types for determining the electronic equipment are non-electrification reset (220);
And when the reset types for determining the electronic equipment are electrification resets, the verification is re-write into the verification region and is become
Amount and the calibration reference, (230) are determined for reset types next time.
In 210, when being resetted in the electronic equipment, the verification variable in the verification region and verification are read
Benchmark, performs the verification to the verification variable and calculates, and obtains result of calculation.
By the corresponding verification mode in the way of obtaining the calibration reference according to verification variable, the verification is become
Amount is verified and obtains check results, is compared the check results and calibration reference will pass through and is determined reset types.
If as an example, obtaining the calibration reference (i.e. each school from the verification variable by above-mentioned formula 1
Variable is tested to carry out XOR and subtract one), then by performing XOR computing that subtracts one to each verification variable in verification region in 210
To be verified, and obtain check results.
Alternatively, if obtaining the calibration reference by performing Cyclic Redundancy Code calculating to each verification variable,
Verified in 210 accordingly by CRC is performed to each verification variable in verification region, and
To check results.
In 220, compare the result of calculation and the calibration reference, when the result of calculation is not equal to the verification base
On time, the reset types for determining the electronic equipment are electrification resets, when the result of calculation is equal to the calibration reference, really
The reset types of the fixed electronic equipment are non-electrification resets
As it was previously stated, verification region in calibration reference and verification variable value such as hardware reset, software reset it
It can be preserved in the non-electrification reset of class, but if electronic equipment power down, then the calibration reference in the verification region and verification becomes
The value of amount can lose.It is described if not carrying out assignment actively to the verification region after electronic equipment is re-powered
The value verified in region is mess code.
In the reset carried out on an electronic device in the initialization after electricity, the school after being re-powered due to electronic equipment
The value tested in region is mess code, verifies so being performed to each verification variable in verification region and obtains check results generally not
Equal to the calibration reference, so that it is electrification reset to accurately determine out the reset carried out in the initialization.
In the case of the reset occurred in the charging operation of electronic equipment, calibration reference and verification in verification region become
The value of amount can be preserved without losing, and verified so being performed to each verification variable in verification region and obtained check results etc.
In the calibration reference, so that it is determined that it is non-electrification reset to go out the reset occurred in charging operation.
In 230, when it is determined that the reset types of the electronic equipment are electrification resets, being write again into the verification region
Enter the verification variable and the calibration reference, determined for reset types next time.If because electronic equipment
Reset types be electrification reset, then the value of each byte verified in region is mess code, is now needed in the verification region
The middle tape verifying benchmark that carries out writes internal memory, so as to determine reset types in the reset then occurred.
In the embodiment of method for determining electrification reset described above in conjunction with Fig. 2, utilize and selected from internal memory
Given number byte as verification region carry out the determination of electrification reset, so as to not increase the basis of other hardware devices
It is upper to carry out simple, effective, reliable electrification reset type judgement.
Fig. 3 is diagrammatically illustrated for realizing the journey for being used to determine the method for electrification reset according to embodiments of the present invention
Sequence.The program is write with C language.Simplified in figure 3, verification region for 32 bytes, verification variable is only
For data1 and data2, dwCheckRamdata functions are used to perform the behaviour that the verification variable XOR in 210 in Fig. 2 subtracts one
Make, and identified reset types are provided by variable byRstType.In addition, those skilled in the art can use it
Its programming language and/or combine the configuration of electronic equipment and realize the embodiment of the present invention.
Fig. 4 is to show the flow chart according to another embodiment of the present invention for being used to determine the method for electrification reset.At this
In Fig. 4, verified combining the utilization that Fig. 2 describes on the basis of region determines electrification reset, be further combined it is determined that multiple
The mode of position type, i.e., whether the reset types that electronic equipment is determined using reseting register are software reset and utilization
Heartbeat register is that electrification reset is also non-electrification reset come the reset types for determining the electronic equipment.
Below to determining the mode of reset types using reseting register and determining reset types using heartbeat register
Mode carries out following exemplary illustration.
There is system register (such as reseting register) in the electronic equipment of such as micro-control unit to indicate electronics
The state of equipment, can be provided for indicating the bit that whether there occurs software reset in the reseting register, then pass through
The bit of reseting register can be to determine whether reset occurred is software reset.
In FPGA, define a logic specific address as heartbeat register address, and by the way of appropriate come
Judge whether the logic in the address is normally being run, for example, taking the mode of logical inversion to be judged.Specifically,
Data are write to the address of the heartbeat register, if opposite number (is normally run each other for the data of retaking of a year or grade and the data of write-in
Logic can be to the data-conversion of write-in), then represent logic heartbeat and normally running.If logic heartbeat is normally being run, send out
The type of raw reset is non-electrification reset;If logic heartbeat is not run normally, the type of the reset occurred is upper electricity
Reset., can be so that reseting register or logic heartbeat deposit be utilized using appropriate by the way of as needed in specific practice
Device determines reset types, and specific determination mode is not construed as limiting the invention.
Specifically Fig. 4 is described as follows.Whether the reset types that electronic equipment is determined using reseting register are that software is answered
Position (410).If determining that reset types are software reset (460), are terminated in 410.If determining reset types in 410
Software reset, then carry out the embodiment of the present invention the reset types that electronic equipment is determined using region is verified whether be on
Reset (420).If determining that reset types are electrification reset (440), are terminated in 420.If determining to reset in 420
Type is not electrification reset (i.e. non-electrification reset), then the reset types of the electronic equipment are determined using heartbeat register is
No is electrification reset (430).If determining that the reset types of electronic equipment are electrification reset (in 430 be) in 430, really
It is electrification reset (440) to determine reset types, is then terminated.If the reset types that electronic equipment is determined in 430 are replied by cable on being
Position (no in 430), it is determined that reset types are non-electrification reset (450), are then terminated.
In Fig. 4, by the reset types that electronic equipment is determined using region is verified of the embodiment of the present invention whether be on
Whether reset (420) is software reset (410) and utilization with the reset types that electronic equipment is determined using reseting register
Whether heartbeat register is that both electrification resets (430) are combined to determine to reset class come the reset types for determining the electronic equipment
Type.
Specific reset types determination in, can by the reset types determination mode in 420 only with 410 and 430
A reset types determination mode be applied in combination.
In the case of electronic equipment also includes reseting register, when being resetted in the electronic equipment, institute is utilized
Whether the reset types for stating reseting register to determine electronic equipment are software reset (410);It is determined that the reset types not
In the case of being software reset, the verification (210 in Fig. 2) of the verification variable in the verification region is performed, and so
220 in Fig. 2 are performed afterwards to determine whether reset types are electrification resets.In this case, it is soft first to eliminate reset types
The situation that part resets, then further carries out the determination of electrification reset, this efficiency for improving reset types determination and the degree of accuracy.
Alternatively, electronic equipment include heartbeat register in the case of, in by Fig. 2 210,220 and 230 and it is true
When the fixed reset types are non-electrification resets, further the reset of the electronic equipment is determined using the heartbeat register
Type is that electrification reset is also non-electrification reset (430).In this case, by taking two ways to determine that reset types are
No is electrification reset, improves the degree of accuracy of electrification reset determination.
In specific practice, the electrification reset type determination mode of the embodiment of the present invention (can also be utilized verification
Region determines whether reset types are electrification resets) it is applied in combination with other reset types determination modes, it is no longer detailed here
Thin description.
Fig. 5 is to show the block diagram for being used to determine the electronic equipment 500 of electrification reset according to embodiments of the present invention.
The electronic equipment 500 for being used to determine electrification reset is applied to any electronic equipment with internal memory, the electronics
Equipment can be micro-control unit, digital signal processor, CPU, field programmable gate array as previously described
Deng as long as it has internal memory.The internal memory can be internal memory in electronic equipment or connect with the electronic equipment
The internal memory connect, it is, for example, random access memory (RAM, Random Access Memory) internal memory.
The electronic equipment 500 includes internal memory 510 and reset types determining module 520.The internal memory 510 includes check field
Domain 511, the verification region 511 is used to be stored in the calibration reference do not lost in non-electrification reset and verification variable, the verification
Benchmark is obtained by performing verification calculating to the verification variable.The reset types determining module 520 includes:Calculate
Unit 521, during for being resetted in the electronic equipment, reads the verification variable in the verification region and verification
Benchmark, the verification calculating is performed to the data value of the verification variable, and obtains result of calculation;First determining unit 522, is used
In the relatively result of calculation and the calibration reference, when the result of calculation is not equal to the calibration reference, described in determination
The reset types of electronic equipment are electrification resets, when the result of calculation is equal to the calibration reference, determine that the electronics is set
Standby reset types are non-electrification resets;Assignment unit 523, for it is determined that the reset types of the electronic equipment be on reply by cable
Position, the verification variable and the calibration reference is re-write into the verification region, for reset types next time
It is determined that.It is specifically described below.
Certain number of byte can be selected from the internal memory 510 as the verification region 511, to be stored on non-
The calibration reference and verification variable do not lost in reset.As an example, the base from the internal memory 510 of electronic equipment can be selected
128 bytes that location (that is, the address of the 0th byte) starts are as the verification region 511, it is also an option that from the internal memory 510
64 bytes that start of the 100th byte as the verification region 511.The start address and byte number in the verification region 511
The limitation to the embodiment of the present invention is not constituted.In practice, can be according to the determination accuracy requirement of electrification reset come suitably
The byte number in verification region is set.The byte number is bigger, then to fix exactness really higher for electrification reset.On calibration reference and school
Test the description that storage of the variable in the verification region 511 may refer to carry out above in conjunction with Fig. 1.Equally, the calibration reference
Byte number be not limited to two, it can also be a byte or four bytes.
If electronic equipment power down, the value of each byte is mess code in the verification region 511 after upper electricity.
In the state after electronic equipment 500 normally operation, the mode of verification sum can be used to the verification region 511
Enter line access.The calibration reference can for example be obtained by foregoing formula (1), and other modes can also be taken to obtain
The calibration reference, for example, take the modes such as Cyclic Redundancy Code (CRC, Cyclic Redundancy Code) verification.Specifically
Mode is not construed as limiting the invention.
Computing unit 521 in the reset types determining module 520 is used to reset in the electronic equipment 500
When, the verification variable and calibration reference in the verification region 511 are read, institute is performed to the data value of the verification variable
State verification to calculate, and obtain result of calculation.Computing unit 521 by with the calibration reference is obtained according to verification variable in the way of
Corresponding verification mode, obtains check results to be verified to the verification variable, compares the check results will pass through
Reset types are determined with calibration reference.
The first determining unit 522 in the reset types determining module 520 be used for by relatively more described calibration reference and
The check results are that electrification reset is also non-electrification reset come the reset types for determining the electronic equipment.Specifically, it is described
First determining unit 522 compares the result of calculation and the calibration reference, is not equal to the verification base in the result of calculation
On time, the reset types for determining the electronic equipment are electrification resets, when the result of calculation is equal to the calibration reference, really
The reset types of the fixed electronic equipment are non-electrification resets.
In the reset carried out in initialization on electronic equipment 500 after electricity, electronic equipment 500 is described after re-powering
The value verified in region is mess code.Now, the first determining unit 522 determines to perform verification to each verification variable by comparing
And obtain check results and be not equal to the calibration reference so that accurately determine out the reset carried out in the initialization be on electricity
Reset.
In the case of the reset occurred in the charging operation of electronic equipment, calibration reference and school in verification region 511
Testing the value of variable can preserve without losing.It is described that first determining unit 522 determines that the check results are equal to by comparing
Calibration reference, so that it is determined that it is non-electrification reset to go out the reset occurred in charging operation.
Assignment unit 523 in the reset types determining module 520 is used for it is determined that the reset of the electronic equipment 500
Type is electrification reset, the verification variable and the calibration reference is re-write into the verification region 511, under
Reset types once are determined.If because the reset types of electronic equipment are electrification resets, verified each in region
The value of individual byte is mess code, now needs to carry out tape verifying benchmark in the verification region to write internal memory, so as to then send out
Reset types are determined in raw reset.
Determined above in conjunction with being used for of describing of Fig. 5 in the embodiment of electronic equipment 500 of electrification reset, using from internal memory
The given number byte selected in 510 carries out the determination of electrification reset as verification region 511, so that other hard not increasing
Simple, effective, reliable electrification reset type is carried out on the basis of part device to judge.
Alternatively, verify during region determines the electronic equipment 500 of electrification reset combining the utilization that Fig. 5 describes, can be with
Other reset types determination modes are further combined, so as to improve efficiency and/or the degree of accuracy of reset types determination.
As an example, the electronic equipment 500 can also include reseting register 512, the electronic equipment 500 can be with
Including the second determining unit 526, for determined using the reseting register 512 electronic equipment 500 reset types whether
It is software reset.In the case where the second determining unit 526 determines that the reset types are not software reset, the computing unit
521 and first determining unit 522 to be operated with the reset types for determining the electronic equipment be electrification reset also right and wrong
Electrification reset.In this case, the situation that reset types are software resets is first eliminated, electrification reset is then further carried out
It is determined that, this improves efficiency and the degree of accuracy that electronic equipment 500 determines reset types.
As another example, the electronic equipment can also include heartbeat register 513, and the electronic equipment 500 can be with
Including the 3rd determining unit 527.When it is non-electrification reset that the first determining unit 522, which determines the reset types, the 3rd determines
Unit 527 determines that the reset types of the electronic equipment 500 are that electrification reset is also on non-using the heartbeat register 513
Reset.In this case, determine whether reset types are electrification resets by taking two ways, improve electrification reset
The degree of accuracy of determination.
Include the situation of both the second determining unit 526 and the 3rd determining unit 527 on electronic equipment 500, please be specific
Referring to the description for combining Fig. 4 progress.
In specific practice, the electrification reset type determination mode of the embodiment of the present invention (can also be utilized verification
Region determines whether reset types are electrification resets) it is applied in combination with other reset types determination modes, it is no longer detailed here
Thin description.
It is apparent to those skilled in the art that, for convenience and simplicity of description, the device of foregoing description
With the specific work process of unit, the corresponding process in preceding method embodiment is may be referred to, be will not be repeated here.
Those of ordinary skill in the art are it is to be appreciated that the list of each example described with reference to the embodiments described herein
Member and algorithm steps, can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually
Performed with hardware or software mode, depending on the application-specific and design constraint of technical scheme.Professional and technical personnel
Described function can be realized using distinct methods to each specific application, but this realization is it is not considered that exceed
The scope of the present invention.
, can be with several embodiments provided herein, it should be understood that disclosed systems, devices and methods
Realize by another way.For example, device embodiment described above is only schematical, for example, the unit
Divide, only a kind of division of logic function there can be other dividing mode when actually realizing.
If the function is realized using in the form of SFU software functional unit and is used as independent production marketing or in use, can be with
It is stored in a computer read/write memory medium.Understood based on such, technical scheme is substantially in other words
The part contributed to prior art or the part of the technical scheme can be embodied in the form of software product, the meter
Calculation machine software product is stored in a storage medium, including some instructions are to cause a computer equipment (can be individual
People's computer, server, or network equipment etc.) perform all or part of step of each of the invention embodiment methods described.
The foregoing is only a specific embodiment of the invention, but protection scope of the present invention is not limited thereto, any
Those familiar with the art the invention discloses technical scope in, change or replacement can be readily occurred in, should all be contained
Cover within protection scope of the present invention.Therefore, protection scope of the present invention described should be defined by scope of the claims.
Claims (12)
1. a kind of method for determining reset types, it is characterised in that this method, which is applied to one, has the electronic equipment of internal memory, and this is interior
Bag deposit includes verification region, and the verification region is used to be stored in the calibration reference do not lost in non-electrification reset and verification variable, institute
Stating calibration reference is obtained by performing verification calculating to the verification variable, and methods described includes:
When being resetted in the electronic equipment, the verification variable and calibration reference in the verification region are read, to described
Verify variable and perform the verification calculating, and obtain result of calculation;
Compare the result of calculation and the calibration reference, when the result of calculation is not equal to the calibration reference, determine institute
The reset types for stating electronic equipment are electrification resets, when the result of calculation is equal to the calibration reference, determine the electronics
The reset types of equipment are non-electrification resets;And
Become when it is determined that the reset types of the electronic equipment are electrification resets, re-writing the verification into the verification region
Amount and the calibration reference, are determined for reset types next time.
2. method according to claim 1, it is characterised in that described to include to the verification variable execution verification calculating:
The calculating that XOR subtracts one is performed to each verification variable in the verification variable.
3. method according to claim 2, it is characterised in that improve reset types by increasing the number of the verification variable
Really exactness is fixed.
4. method according to claim 1, it is characterised in that the electronic equipment also includes reseting register, and methods described is also
Including:
When being resetted in the electronic equipment, determined using the reseting register electronic equipment reset types whether
It is software reset;
In the case of it is determined that the reset types are not software reset, perform it is described read, verification calculate and determine operation with
It is that electrification reset is also non-electrification reset to determine the reset types.
5. method according to claim 1, it is characterised in that the electronic equipment also includes heartbeat register, when it is determined that described
When reset types are non-electrification resets, methods described also includes:
The reset types for determining the electronic equipment using the heartbeat register are that electrification reset is also non-electrification reset.
6. method according to claim 1, it is characterised in that the internal memory is internal memory in electronic equipment or set with the electronics
The internal memory of standby connection.
7. a kind of electronic equipment, it is characterised in that including:
Internal memory, including verification region, the verification region is used to be stored in the calibration reference do not lost in non-electrification reset and verification
Variable, the calibration reference is obtained by performing verification calculating to the verification variable;
Reset types determining module, including:
Computing unit, during for being resetted in the electronic equipment, reads the verification variable in the verification region
And calibration reference, the verification calculating is performed to the data value of the verification variable, and obtain result of calculation;
First determining unit, for comparing the result of calculation and the calibration reference, is not equal to described in the result of calculation
During calibration reference, the reset types that determine the electronic equipment be electrification reset, be equal to the verification base in the result of calculation
On time, the reset types for determining the electronic equipment are non-electrification resets;
Assignment unit, for it is determined that the reset types of the electronic equipment are electrification resets, into the verification region again
The write-in verification variable and the calibration reference, are determined for reset types next time.
8. electronic equipment according to claim 7, it is characterised in that the computing unit passes through to each in the verification variable
The calculating that individual verification variable execution XOR subtracts one calculates to perform the verification.
9. electronic equipment according to claim 8, it is characterised in that improve reset by increasing the number of the verification variable
Type fixes exactness really.
10. electronic equipment according to claim 7, it is characterised in that the electronic equipment also includes reseting register, described multiple
Position determination type module also includes:
Second determining unit, for determining whether the reset types of electronic equipment are that software is answered using the reseting register
Position;
Wherein, in the case where the second determining unit determines that the reset types are not software reset, the computing unit and institute
It is that electrification reset is also non-electrification reset to state the first determining unit and operated with the reset types for determining the electronic equipment.
11. electronic equipment according to claim 7, it is characterised in that the electronic equipment also includes heartbeat register, described multiple
Position determination type module also includes:
3rd determining unit, for when it is non-electrification reset that the first determining unit, which determines the reset types, utilizing the heart
It is that electrification reset is also non-electrification reset come the reset types for determining the electronic equipment to jump register.
12. electronic equipment according to claim 7, it is characterised in that the internal memory be the internal memory that is located in electronic equipment or with
The internal memory of the electronic equipment connection.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210433242.0A CN103793032B (en) | 2012-11-02 | 2012-11-02 | Method and apparatus for determining electrification reset |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210433242.0A CN103793032B (en) | 2012-11-02 | 2012-11-02 | Method and apparatus for determining electrification reset |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103793032A CN103793032A (en) | 2014-05-14 |
CN103793032B true CN103793032B (en) | 2017-09-29 |
Family
ID=50668801
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210433242.0A Active CN103793032B (en) | 2012-11-02 | 2012-11-02 | Method and apparatus for determining electrification reset |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103793032B (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105644369B (en) * | 2014-11-13 | 2018-04-20 | 比亚迪股份有限公司 | Electric machine controller and its reset processing method and device |
CN105045146B (en) * | 2015-07-03 | 2018-06-26 | 深圳市普博科技有限公司 | A kind of system with reset function and its restart control method |
CN105117298A (en) * | 2015-08-10 | 2015-12-02 | 中颖电子股份有限公司 | Electrostatic discharge protection system and method for display screen driving chip |
EP3480608B1 (en) * | 2017-09-19 | 2021-01-13 | Shenzhen Goodix Technology Co., Ltd. | Method and system for measuring power-on reset time |
CN112989440B (en) * | 2021-04-21 | 2021-09-14 | 北京芯愿景软件技术股份有限公司 | Chip, processor driving method and electronic equipment |
CN114860052B (en) * | 2022-04-29 | 2024-04-02 | 上海瑞浦青创新能源有限公司 | Program execution judging method, device, equipment and readable storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6694452B1 (en) * | 1998-12-25 | 2004-02-17 | Nec Electronics Corporation | Data processor and method of processing data |
CN1770106A (en) * | 2004-11-04 | 2006-05-10 | 华为技术有限公司 | Reset information saving method for communication equipment |
CN1776566A (en) * | 2005-11-25 | 2006-05-24 | 港湾网络有限公司 | Method for distinguishing system power-on reset and live-line reset |
CN101008900A (en) * | 2007-01-31 | 2007-08-01 | 华为技术有限公司 | Method and device for distinguish cool start and hot start |
CN101856913A (en) * | 2009-04-01 | 2010-10-13 | 精工爱普生株式会社 | Storage device, substrate, liquid container, system, data store control method |
-
2012
- 2012-11-02 CN CN201210433242.0A patent/CN103793032B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6694452B1 (en) * | 1998-12-25 | 2004-02-17 | Nec Electronics Corporation | Data processor and method of processing data |
CN1770106A (en) * | 2004-11-04 | 2006-05-10 | 华为技术有限公司 | Reset information saving method for communication equipment |
CN1776566A (en) * | 2005-11-25 | 2006-05-24 | 港湾网络有限公司 | Method for distinguishing system power-on reset and live-line reset |
CN101008900A (en) * | 2007-01-31 | 2007-08-01 | 华为技术有限公司 | Method and device for distinguish cool start and hot start |
CN101856913A (en) * | 2009-04-01 | 2010-10-13 | 精工爱普生株式会社 | Storage device, substrate, liquid container, system, data store control method |
Also Published As
Publication number | Publication date |
---|---|
CN103793032A (en) | 2014-05-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103793032B (en) | Method and apparatus for determining electrification reset | |
CN105280240B (en) | A kind of read method of Nand Flash parameters | |
CN107247859A (en) | Verification method, device, electronic equipment and the storage medium of Logic Circuit Design | |
US8365118B2 (en) | Broken-spheres methodology for improved failure probability analysis in multi-fail regions | |
CN102567166B (en) | Testing method and testing system of graphics card | |
CN107480039A (en) | The small documents readwrite performance method of testing and device of a kind of distributed memory system | |
US8271252B2 (en) | Automatic verification of device models | |
CN109947368A (en) | Data reliability detection method, device, computer equipment and storage medium | |
CN108133732A (en) | Performance test methods, device, equipment and the storage medium of flash chip | |
CN103208313B (en) | Detection method and detection system | |
CN108959055A (en) | Readwrite performance test method, device and the equipment of xfs file system | |
CN107729231A (en) | A kind of fault filling method and device based on operating system | |
US9003342B1 (en) | Lumped aggressor model for signal integrity timing analysis | |
CN106024066A (en) | SRAM detection method and system | |
CN107678894A (en) | A kind of internal storage testing method, apparatus and system | |
CN103268272B (en) | Scenario-based processor system-level verification completeness measurement method | |
US9678824B2 (en) | Durability and availability evaluation for distributed storage systems | |
CN107293330A (en) | The method and simulation checking system of simulating, verifying are carried out to random access memory ram | |
CN109783297A (en) | A kind of solid state hard disk uses the wide method for improving of temperature and solid state hard disk | |
CN106886487A (en) | Method for evaluating FPGA software reliabilities | |
CN103839592A (en) | Built-in self-test method and device for embedded-type flash memory | |
CN106557412A (en) | A kind of method and device of fuzz testing | |
CN107894900A (en) | A kind of method and system of MCU upgradings | |
CN109902001A (en) | To the detection method and terminal device of uninitialized variable | |
CN113568798A (en) | Server fault positioning method and device, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |