CN105824717A - Method and device for controlling chip operation and chip - Google Patents

Method and device for controlling chip operation and chip Download PDF

Info

Publication number
CN105824717A
CN105824717A CN201610151508.0A CN201610151508A CN105824717A CN 105824717 A CN105824717 A CN 105824717A CN 201610151508 A CN201610151508 A CN 201610151508A CN 105824717 A CN105824717 A CN 105824717A
Authority
CN
China
Prior art keywords
program code
code
check value
conditioned
judging
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.)
Pending
Application number
CN201610151508.0A
Other languages
Chinese (zh)
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.)
Analogix Semiconductor Beijing Inc
Analogix International LLC
Original Assignee
Analogix Semiconductor Beijing Inc
Analogix International LLC
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 Analogix Semiconductor Beijing Inc, Analogix International LLC filed Critical Analogix Semiconductor Beijing Inc
Priority to CN201610151508.0A priority Critical patent/CN105824717A/en
Publication of CN105824717A publication Critical patent/CN105824717A/en
Pending legal-status Critical Current

Links

Classifications

    • 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/0793Remedial or corrective actions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/654Updates using techniques specially adapted for alterable solid state memories, e.g. for EEPROM or flash memories

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Storage Device Security (AREA)

Abstract

The invention discloses a method and a device for controlling a chip operation and a chip. The chip comprises a memory, wherein the memory comprises a first storage area and a second storage area; the first storage area is used for storing a first program code; the second storage area is used for storing a second program code. The method comprises the following steps: after the chip is electrified, detecting whether an abnormality exists in the first program code or not; when a condition that no abnormality exists in the first program code is detected, controlling the chip to execute the first program code; when the condition that the abnormality exists in the first program code is detected, controlling the chip to execute the second program code. According to the method, the device and the chip disclosed by the invention, the technical problem that the chip cannot work because of problems such as program writing or updating is solved.

Description

Method, device and the chip that control chip runs
Technical field
The present invention relates to integrated circuit fields, method, device and the chip run in particular to a kind of control chip.
Background technology
Along with chip integration is more and more higher, in order to improve the performance of chip and reduce cost, programming device in increasing integrated chip sheet, such as, in sheet, single-chip microcomputer (On_ChipMicroController is called for short OCM), substantially increase motility and the autgmentability of chip.Under normal circumstances, programming device in sheet, such as, OCM, the single program's memory space of only one of which, to reduce cost, as shown in Figure 1.But so can introduce a risk, once go wrong during program burn writing or upgrading, chip can be caused cannot to work completely, serious meeting causes system to run.
Go wrong the problem causing chip to work in the process such as program burn writing or upgrading in correlation technique, the most not yet propose effective solution.
Summary of the invention
Embodiments provide method, device and chip that a kind of control chip runs, at least to solve to go wrong the technical problem causing chip to work due to the process such as program burn writing or upgrading.
An aspect according to embodiments of the present invention, provide a kind of method that control chip runs, chip includes memorizer, memorizer includes the first memory block and the second memory block, first memory block is for storage the first program code, second memory block is for storage the second program code, and method includes: after chip powers on, and detects whether the first program code exists exception;When detecting that the first program code does not exists abnormal, control chip performs the first program code;And when detecting that the first program code exists abnormal, control chip performs the second program code.
Further, detect whether the first program code exists abnormal including: after chip powers on, obtain the code information of the first program code;Judge whether the code information of the first program code meets pre-conditioned;When the code information judging the first program code meets pre-conditioned, it is determined that the first program code does not exist exception;And when the code information judging the first program code is unsatisfactory for pre-conditioned, it is determined that the first program code exists abnormal.
Further, code information includes marking code, it is judged that whether the code information of the first program code meets pre-conditioned including: judge that marking code is the most consistent with the first preset value;When judging marking code and the first preset value is consistent, it is determined that the code information of the first program code meets pre-conditioned;And when judging marking code and the first preset value is inconsistent, it is determined that the code information of the first program code is unsatisfactory for pre-conditioned.
Further, code information includes the check value of the first program code, it is judged that whether the code information of the first program code meets pre-conditioned including: judge whether the check value of the first program code presets check value with first consistent;The check value and first judging the first program code preset check value consistent time, it is determined that the code information of the first program code meets pre-conditioned;And the check value and first judging the first program code preset check value inconsistent time, it is determined that the code information of the first program code is unsatisfactory for pre-conditioned.
Further, it is judged that whether the code information of the first program code meets pre-conditioned including: judge that the marking code of the first program code is the most consistent with the second preset value;When the marking code and the second preset value judging the first program code is inconsistent, it is determined that the code information of the first program code is unsatisfactory for pre-conditioned;When the marking code and the second preset value judging the first program code is consistent, then continue to obtain the check value of the first program code;Judge that the check value and second of the first program code presets check value the most consistent;The check value and second judging the first program code preset check value consistent time, it is determined that the code information of the first program code meets pre-conditioned;And the check value and second judging the first program code preset check value inconsistent time, it is determined that the code information of the first program code is unsatisfactory for pre-conditioned.
Further, the check value obtaining the first program code includes: obtain the code length of the first program code;And the check value of the first program code is calculated according to the code length of the first program code.
Another aspect according to embodiments of the present invention, additionally provide the device that a kind of control chip runs, chip includes memorizer, memorizer includes the first memory block and the second memory block, first memory block is for storage the first program code, and the second memory block is for storage the second program code, and device includes: detector unit, after powering at chip, detect whether the first program code exists exception;First control unit, for when detecting that the first program code does not exists abnormal, control chip performs the first program code;And second control unit, for when detecting that the first program code exists abnormal, control chip performs the second program code.
Further, detector unit includes: acquisition module, for after chip powers on, obtains the code information of the first program code;Judge module, for judging whether the code information of the first program code meets pre-conditioned;And determine module, during for meeting pre-conditioned in the code information judging the first program code, then determine that the first program code does not exist exception, when the code information judging the first program code is unsatisfactory for pre-conditioned, it is determined that the first program code exists abnormal.
Further, code information includes marking code, it is judged that module includes: first judges submodule, is used for judging that marking code is the most consistent with the first preset value;And first determine submodule, for when judging marking code and the first preset value is consistent, then determine that the code information of the first program code meets pre-conditioned, when judging marking code and the first preset value is inconsistent, it is determined that the code information of the first program code is unsatisfactory for pre-conditioned.
Further, code information includes the check value of the first program code, it is judged that module includes: second judges submodule, consistent for judging whether the check value of the first program code presets check value with first;And second determine submodule, for preset at the check value and first of judging the first program code check value consistent time, then determine that the code information of the first program code meets pre-conditioned, the check value and first judging the first program code preset check value inconsistent time, it is determined that the code information of the first program code is unsatisfactory for pre-conditioned.
Further, it is judged that module includes: the 3rd judges submodule, for judging that the marking code of the first program code is the most consistent with the second preset value;3rd determines submodule, for when the marking code and the second preset value judging the first program code is inconsistent, it is determined that the code information of the first program code is unsatisfactory for pre-conditioned;Obtain submodule, for when the marking code and the second preset value judging the first program code is consistent, then continue to obtain the check value of the first program code;4th judges submodule, the most consistent for judging that the check value and second of the first program code presets check value;And the 4th determine submodule, for preset at the check value and second of judging the first program code check value consistent time, then determine that the code information of the first program code meets pre-conditioned, the check value and second judging the first program code preset check value inconsistent time, it is determined that the code information of the first program code is unsatisfactory for pre-conditioned.
Another aspect according to embodiments of the present invention, additionally provides a kind of chip, the device run including any of the above-described control chip.
In embodiments of the present invention, chip includes that memorizer, memorizer include the first memory block and the second memory block, first memory block is for storage the first program code, second memory block, for storage the second program code, uses after chip powers on, detects whether the first program code exists exception;When detecting that the first program code does not exists abnormal, control chip performs the first program code;And when detecting that the first program code exists abnormal, control chip performs the mode of the second program code, when the existence exception of the first program code being detected, control chip performs the second program code, such that it is able to the problem avoiding causing chip to work when exception occurs in the first program code programming or upgrading, it is achieved thereby that improve chip safety in operation and the technique effect of stability, and then solve owing to the process such as program burn writing or upgrading goes wrong the technical problem causing chip to work.
Accompanying drawing explanation
Accompanying drawing described herein is used for providing a further understanding of the present invention, constitutes the part of the application, and the schematic description and description of the present invention is used for explaining the present invention, is not intended that inappropriate limitation of the present invention.In the accompanying drawings:
Fig. 1 is according to the schematic diagram of the chip of single-chip microcomputer in a kind of integration slice of prior art;
Fig. 2 is the flow chart of the method that control chip according to embodiments of the present invention runs;
Fig. 3 is the schematic diagram of EEPROM subregion according to embodiments of the present invention;
Fig. 4 is the flow chart of the method that a kind of control chip alternatively according to embodiments of the present invention runs;And
Fig. 5 is the schematic diagram of the device that control chip according to embodiments of the present invention runs.
Detailed description of the invention
In order to make those skilled in the art be more fully understood that the present invention program, below in conjunction with the accompanying drawing in the embodiment of the present invention, technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the embodiment of a present invention part rather than whole embodiments.Based on the embodiment in the present invention, the every other embodiment that those of ordinary skill in the art are obtained under not making creative work premise, all should belong to the scope of protection of the invention.
It should be noted that term " first " in description and claims of this specification and above-mentioned accompanying drawing, " second " etc. are for distinguishing similar object, without being used for describing specific order or precedence.Should be appreciated that the data of so use can be exchanged in the appropriate case, in order to embodiments of the invention described herein can be implemented with the order in addition to those here illustrating or describing.In addition, term " includes " and " having " and their any deformation, it is intended to cover non-exclusive comprising, such as, contain series of steps or the process of unit, method, system, product or equipment be not necessarily limited to those steps or the unit clearly listed, but can include the most clearly listing or for intrinsic other step of these processes, method, product or equipment or unit.
According to embodiments of the present invention, provide the embodiment of the method that a kind of control chip runs, it should be noted that, can perform in the computer system of such as one group of computer executable instructions in the step shown in the flow chart of accompanying drawing, and, although showing logical order in flow charts, but in some cases, can be to be different from the step shown or described by order execution herein.
Fig. 2 is the flow chart of the method that control chip according to embodiments of the present invention runs, the chip of the embodiment of the present invention includes memorizer, memorizer includes the first memory block and the second memory block, first memory block is for storage the first program code, second memory block is for storage the second program code, as in figure 2 it is shown, the method comprises the steps:
Step S102, after chip powers on, detects whether the first program code exists exception.
Step S104, when detecting that the first program code does not exists abnormal, control chip performs the first program code.
Step S106, when detecting that the first program code exists abnormal, control chip performs the second program code.
First memory block of the embodiment of the present invention can be user expansion area, realizing the program code of chip repertoire for storage or user customizes the program code of function, the first program code can be to realize the program code of chip repertoire or user customizes the program code of function;Second memory block of the embodiment of the present invention can be place of safety, the program code of chip basic function is realized for storage, such as, the program code of the initial version of storage in memorizer during chip production, the second program code can be the program code realizing chip basic function.
In embodiments of the present invention, the when of running into new demand or need Function Extension during chip uses, it is only necessary to the part of online updating user expansion area;Updating unsuccessful in user expansion area part, even during the incoherent program of burning, the chip of the embodiment of the present invention can also run the program code being in place of safety, it is ensured that the operation of chip basic function.
In embodiments of the present invention, chip includes that memorizer, memorizer include the first memory block and the second memory block, first memory block is for storage the first program code, second memory block, for storage the second program code, by after chip powers on, detects whether the first program code exists exception;When detecting that the first program code does not exists abnormal, control chip performs the first program code;And when detecting that the first program code exists abnormal, control chip performs the mode of the second program code, when the existence exception of the first program code being detected, control chip performs the second program code, such that it is able to the problem avoiding causing chip to work when exception occurs in the first program code programming or upgrading, it is achieved thereby that improve chip safety in operation and the technique effect of stability, and then solve owing to the process such as program burn writing or upgrading goes wrong the technical problem causing chip to work.
Alternatively, detect whether the first program code exists abnormal including: after chip powers on, obtain the code information of the first program code;Judge whether the code information of the first program code meets pre-conditioned;When the code information judging the first program code meets pre-conditioned, it is determined that the first program code does not exist exception;And when the code information judging the first program code is unsatisfactory for pre-conditioned, it is determined that the first program code exists abnormal.
The code information of the embodiment of the present invention can be one or more in code of the identifier of program code, program length, check code or predeterminated position etc., the pre-conditioned setting of the embodiment of the present invention is corresponding to above-mentioned code information, such as, take the identifier that code information is program code, the most pre-conditioned for presetting identifier or default identifier list etc..
Alternatively, code information includes marking code, it is judged that whether the code information of the first program code meets pre-conditioned including: judge that marking code is the most consistent with the first preset value;When judging marking code and the first preset value is consistent, it is determined that the code information of the first program code meets pre-conditioned;And when judging marking code and the first preset value is inconsistent, it is determined that the code information of the first program code is unsatisfactory for pre-conditioned.
The marking code of the embodiment of the present invention is for identifying the program code of the embodiment of the present invention, different marking codes can correspond to differently program code, specifically, could be arranged to store the marking code of the first program code in the position of specifying of the first memory block, such as, the front two arranging the first memory block stores the marking code of the first program code.
The embodiment of the present invention is after the marking code getting the first program code, the marking code got and the first preset value can be compared, wherein, first preset value can be one or more default marks, when the marking code got is identical with any one default mark, then description code mark is consistent with the first preset value, now, then determine that the code information of the first program code meets pre-conditioned, when the marking code got all differs with any one default mark, then description code mark is inconsistent with the first preset value, now, then determine that the code information of the first program code is unsatisfactory for pre-conditioned.
Alternatively, code information includes the check value of the first program code, it is judged that whether the code information of the first program code meets pre-conditioned including: judge whether the check value of the first program code presets check value with first consistent;The check value and first judging the first program code preset check value consistent time, it is determined that the code information of the first program code meets pre-conditioned;And the check value and first judging the first program code preset check value inconsistent time, it is determined that the code information of the first program code is unsatisfactory for pre-conditioned.
The check value of the first program code of the embodiment of the present invention can be the check code that the length computation according to the first program code obtains, or it being arranged on the identifying code etc. that in the first program code, specific bit is put, the embodiment of the present invention illustrates as a example by the check value of the first program code is for the check code that obtains according to the length computation of the first program code.
nullSpecifically,Certain the appointment position that can be set in advance in the first memory block stores the length of the first program code,Such as,The 3rd of first memory block and the 4th length for storage the first program code,After the length getting the first program code,The check value of the first program code is calculated according to default operational rule,Such as,The result each data bit addition of the length of the first program code obtained is as the check value of the first program code,And this check value and first are preset check value compare,Wherein,First presets check value can be pre-stored within the first memory block,Check value and first at the first program code preset check value identical time,Then illustrate that the code information of the first program code meets pre-conditioned,Check value and first at the first program code presets check value when differing,Then illustrate that the code information of the first program code is unsatisfactory for pre-conditioned.
Preferably, in order to improve the accuracy for program code abnormality detection result, it is judged that whether the code information of the first program code meets pre-conditioned including: judge that the marking code of the first program code is the most consistent with the second preset value;When the marking code and the second preset value judging the first program code is inconsistent, it is determined that the code information of the first program code is unsatisfactory for pre-conditioned;When the marking code and the second preset value judging the first program code is consistent, then continue to obtain the check value of the first program code;Judge that the check value and second of the first program code presets check value the most consistent;The check value and second judging the first program code preset check value consistent time, it is determined that the code information of the first program code meets pre-conditioned;And the check value and second judging the first program code preset check value inconsistent time, it is determined that the code information of the first program code is unsatisfactory for pre-conditioned.
Specifically, the embodiment of the present invention is after the marking code and the second preset value judging the first program code for the first time is identical, the check value continuing to obtain the first program code judges again, only the check value and second judging the first program code preset check value consistent time, just determine that the code information of the first program code meets pre-conditioned, by marking code and the check value of comprehensive first program code, the embodiment of the present invention detects whether first code program exists exception, such that it is able to improve the accuracy of testing result.
It should be noted that the embodiment of the present invention comprehensively Multiple Code information can detect first code program the most extremely, however it is not limited to above two, such as, it is the most abnormal that comprehensive three kinds of code informations perform to judge to detect program in machine code three times;The execution sequence that the order performing repeatedly to judge is also not necessarily limited in above-described embodiment, such as, the embodiment of the present invention can also be that first to judge whether the check value of the first program code presets check value with second consistent, the check value and second judging the first program code preset check value consistent time, further judge that the marking code of the first program code and the second preset value are the most consistent.
Alternatively, the check value obtaining the first program code includes: obtain the code length of the first program code;And the check value of the first program code is calculated according to the code length of the first program code.
Specifically, certain the appointment position that can be set in advance in the first memory block stores the length of the first program code, such as, the 3rd of first memory block and the 4th length for storage the first program code, after the length getting the first program code, calculate the check value of the first program code according to default operational rule, such as, the result each data bit addition of the length of the first program code obtained is as the check value of the first program code.It should be noted that preset operational rule to be not limited to above-mentioned operational rule, for example, it is also possible to be that the check value of the first program code is carried out Hash operation.
Below in conjunction with Fig. 3 and Fig. 4, the embodiment of the present invention is described in detail.
As shown in Figure 3, internal for single-chip microcomputer in sheet that capacity is 2K EEPROM is divided into two memory blocks, default code district (i.e. place of safety) and personal code work district (i.e. user expansion area), wherein, place of safety (SafeCode) address section is: 0x000_0x17F;User expansion area (UserCode) address section: 0x180_0x7FF.It is defined as follows first 5 of each district, sees Tables 1 and 2:
Table 1
Table 2
Specifically, dividing corresponding with the memory construction shown in Fig. 3, as shown in Figure 4, the method that the control chip of the embodiment of the present invention runs comprises the steps:
Step S202, chip powers on.
Step S204, loads EEPROM.
Specifically, in the embodiment of the present invention, after chip powers on, single-chip microcomputer in PLD in sheet, such as sheet, can remove the program code in load store device (such as, above-mentioned EEPROM) automatically.
Step S206, obtains the marking code of storage in personal code work district.
Alternatively, as it is shown on figure 3, read marking code from EEPROM [0x180] and EEPROM [0x181].
Step S208, whether marking code meets desired value.
Judge whether the marking code read meets desired value (such as, above-mentioned first preset value or above-mentioned second preset value), if it is judged that the marking code read meets desired value, perform step S210, if it is judged that the marking code read does not meets desired value, perform step S220.
Step S210, obtains the code length of storage in personal code work district.
Alternatively, as it is shown on figure 3, read code length from EEPROM [0x182] and EEPROM [0x183].
Step S212, calculates check value CRC.
It is alternatively possible to be to be added each data bit of the code length read to obtain check value CRC.
Step S214, relatively calculated CRC and the check value prestored.
Alternatively, as it is shown on figure 3, read the check value prestored from EEPROM [0x184], and calculated CRC and the check value prestored are compared.
Step S216, the CRC of OCM code is the most effective.
The program code of the OCM code the most above-mentioned user expansion area of the embodiment of the present invention, specifically, can be when the check value judging calculated CRC with prestore is identical, then determine that the CRC of OCM code is effective, perform step S218, when judging that calculated CRC and the check value prestored differ, it is determined that the CRC invalidation of OCM code, perform step S220.
Step S218, performs user's custom code.
The most above-mentioned first program code of user's custom code of the embodiment of the present invention.Specifically, perform user's custom code to comprise the steps:
Step S2181, OCM initializes.
Step S2182, configuration completes.
Step S2183, user customizes function.
Step S2184, OCM circulates.
Step S220, performs safe mode code.
The safe mode code of the embodiment of the present invention can be OCM versatility code (OCMGenericcode), the most above-mentioned second program code of safe mode code.Specifically, perform safe mode code to comprise the steps:
Step S2201, OCM initializes.
Step S2202, configuration completes.
Step S2203, OCM circulates.
Pass through above-mentioned steps, can ensure that chip is in the case of only one of which program's memory space, can safely and steadily run, unexpected mistake is avoided to cause the exception of system, the problem avoiding causing chip to work when exception occurs in programming or the upgrading of user's custom program code, it is achieved thereby that improve chip safety in operation and the technique effect of stability, and then solve owing to the process such as program burn writing or upgrading goes wrong the technical problem causing chip to work.
Another aspect according to embodiments of the present invention, additionally provide the device that a kind of control chip runs, the chip of the embodiment of the present invention includes memorizer, memorizer includes the first memory block and the second memory block, first memory block is for storage the first program code, and the second memory block is for storage the second program code, and Fig. 5 is the schematic diagram of the device that control chip according to embodiments of the present invention runs, as it is shown in figure 5, this device includes:
Detector unit 50, for after chip powers on, detects whether the first program code exists exception.
First control unit 52, for when detecting that the first program code does not exists abnormal, control chip performs the first program code.
Second control unit 54, for when detecting that the first program code exists abnormal, control chip performs the second program code.
Alternatively, detector unit 50 includes: acquisition module, for after chip powers on, obtains the code information of the first program code;Judge module, for judging whether the code information of the first program code meets pre-conditioned;And determine module, during for meeting pre-conditioned in the code information judging the first program code, then determine that the first program code does not exist exception, when the code information judging the first program code is unsatisfactory for pre-conditioned, it is determined that the first program code exists abnormal.
Alternatively, code information includes marking code, it is judged that module includes: first judges submodule, is used for judging that marking code is the most consistent with the first preset value;And first determine submodule, for when judging marking code and the first preset value is consistent, then determine that the code information of the first program code meets pre-conditioned, when judging marking code and the first preset value is inconsistent, it is determined that the code information of the first program code is unsatisfactory for pre-conditioned.
Alternatively, code information includes the check value of the first program code, it is judged that module includes: second judges submodule, consistent for judging whether the check value of the first program code presets check value with first;And second determine submodule, for preset at the check value and first of judging the first program code check value consistent time, then determine that the code information of the first program code meets pre-conditioned, the check value and first judging the first program code preset check value inconsistent time, it is determined that the code information of the first program code is unsatisfactory for pre-conditioned.
Alternatively, it is judged that module includes: the 3rd judges submodule, for judging that the marking code of the first program code is the most consistent with the second preset value;3rd determines submodule, for when the marking code and the second preset value judging the first program code is inconsistent, it is determined that the code information of the first program code is unsatisfactory for pre-conditioned;Obtain submodule, for when the marking code and the second preset value judging the first program code is consistent, then continue to obtain the check value of the first program code;4th judges submodule, the most consistent for judging that the check value and second of the first program code presets check value;And the 4th determine submodule, for preset at the check value and second of judging the first program code check value consistent time, then determine that the code information of the first program code meets pre-conditioned, the check value and second judging the first program code preset check value inconsistent time, it is determined that the code information of the first program code is unsatisfactory for pre-conditioned.
In embodiments of the present invention, chip includes memorizer, memorizer includes the first memory block and the second memory block, first memory block is for storage the first program code, second memory block is for storage the second program code, use the device that the control chip including following structure runs: detector unit 50, for after chip powers on, detect whether the first program code exists exception;First control unit 52, for when detecting that the first program code does not exists abnormal, control chip performs the first program code;And second control unit 54, for when detecting that the first program code exists abnormal, control chip performs the second program code, when the existence exception of the first program code being detected, control chip performs the second program code, such that it is able to the problem avoiding causing chip to work when exception occurs in the first program code programming or upgrading, it is achieved thereby that improve chip safety in operation and the technique effect of stability, and then solve owing to the process such as program burn writing or upgrading goes wrong the technical problem causing chip to work.
Another aspect according to embodiments of the present invention, additionally provides a kind of chip, the device run including any of the above-described control chip.
The invention described above embodiment sequence number, just to describing, does not represent the quality of embodiment.
In the above embodiment of the present invention, the description to each embodiment all emphasizes particularly on different fields, and does not has the part described in detail, may refer to the associated description of other embodiments in certain embodiment.
In several embodiments provided herein, it should be understood that disclosed technology contents, can realize by another way.Wherein, device embodiment described above is only schematically, the division of the most described unit, can be that a kind of logic function divides, actual can have other dividing mode when realizing, the most multiple unit or assembly can in conjunction with or be desirably integrated into another system, or some features can be ignored, or does not performs.Another point, shown or discussed coupling each other or direct-coupling or communication connection can be the INDIRECT COUPLING by some interfaces, unit or module or communication connection, can be being electrical or other form.
The described unit illustrated as separating component can be or may not be physically separate, and the parts shown as unit can be or may not be physical location, i.e. may be located at a place, or can also be distributed on multiple unit.Some or all of unit therein can be selected according to the actual needs to realize the purpose of the present embodiment scheme.
It addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, it is also possible to be that unit is individually physically present, it is also possible to two or more unit are integrated in a unit.Above-mentioned integrated unit both can realize to use the form of hardware, it would however also be possible to employ the form of SFU software functional unit realizes.
If described integrated unit is using the form realization of SFU software functional unit and as independent production marketing or use, can be stored in a computer read/write memory medium.Based on such understanding, completely or partially can embodying with the form of software product of part that prior art is contributed by technical scheme the most in other words or this technical scheme, this computer software product is stored in a storage medium, including some instructions with so that a computer equipment (can be for personal computer, server or the network equipment etc.) performs all or part of step of method described in each embodiment of the present invention.And aforesaid storage medium includes: USB flash disk, read only memory (ROM, Read-OnlyMemory), the various media that can store program code such as random access memory (RAM, RandomAccessMemory), portable hard drive, magnetic disc or CD.
The above is only the preferred embodiment of the present invention; it should be pointed out that, for those skilled in the art, under the premise without departing from the principles of the invention; can also make some improvements and modifications, these improvements and modifications also should be regarded as protection scope of the present invention.

Claims (12)

1. the method that a control chip runs, it is characterised in that described chip includes memorizer, described memorizer includes the first memory block and the second memory block, described first memory block is for storage the first program code, and described second memory block is for storage the second program code, and described method includes:
On the chip after electricity, detect whether described first program code exists exception;
When detecting that described first program code does not exists abnormal, control described chip and perform described first program code;And
When detecting that described first program code exists abnormal, control described chip and perform described second program code.
Method the most according to claim 1, it is characterised in that detect described first program code and whether there is abnormal including:
On the chip after electricity, obtain the code information of described first program code;
Judge whether the code information of described first program code meets pre-conditioned;
The code information judging described first program code meet described pre-conditioned time, it is determined that there is not exception in described first program code;And
The code information judging described first program code be unsatisfactory for described pre-conditioned time, it is determined that described first program code exists abnormal.
Method the most according to claim 2, it is characterised in that described code information includes marking code, it is judged that whether the code information of described first program code meets pre-conditioned including:
Judge that described marking code is the most consistent with the first preset value;
When judging that described marking code is consistent with described first preset value, it is determined that the code information of described first program code meets described pre-conditioned;And
When judging that described marking code and described first preset value are inconsistent, it is determined that the code information of described first program code is unsatisfactory for described pre-conditioned.
Method the most according to claim 2, it is characterised in that described code information includes the check value of described first program code, it is judged that whether the code information of described first program code meets pre-conditioned including:
Judge whether the check value of described first program code presets check value with first consistent;
Judge the check value of described first program code preset with described first check value consistent time, it is determined that the code information of described first program code meets described pre-conditioned;And
Judge the check value of described first program code with described first preset check value inconsistent time, it is determined that the code information of described first program code is unsatisfactory for described pre-conditioned.
Method the most according to claim 2, it is characterised in that judge whether the code information of described first program code meets pre-conditioned including:
Judge that the marking code of described first program code is the most consistent with the second preset value;
When the marking code judging described first program code is inconsistent with described second preset value, it is determined that the code information of described first program code is unsatisfactory for described pre-conditioned;
When the marking code judging described first program code is consistent with described second preset value, then continue to obtain the check value of described first program code;
Judge that the check value and second of described first program code presets check value the most consistent;
Judge the check value of described first program code preset with described second check value consistent time, it is determined that the code information of described first program code meets described pre-conditioned;And
Judge the check value of described first program code with described second preset check value inconsistent time, it is determined that the code information of described first program code is unsatisfactory for described pre-conditioned.
Method the most according to claim 5, it is characterised in that the check value obtaining described first program code includes:
Obtain the code length of described first program code;And
Code length according to described first program code calculates the check value of described first program code.
7. the device that a control chip runs, it is characterised in that described chip includes memorizer, described memorizer includes the first memory block and the second memory block, described first memory block is for storage the first program code, and described second memory block is for storage the second program code, and described device includes:
Detector unit, after electricity on the chip, detects whether described first program code exists exception;
First control unit, for when detecting that described first program code does not exists abnormal, controls described chip and performs described first program code;And
Second control unit, for when detecting that described first program code exists abnormal, controlling described chip and perform described second program code.
Device the most according to claim 7, it is characterised in that described detector unit includes:
Acquisition module, after electricity on the chip, obtains the code information of described first program code;
Judge module, for judging whether the code information of described first program code meets pre-conditioned;And
Determine module, for meet in the code information judging described first program code described pre-conditioned time, then determine that described first program code does not exist exception, the code information judging described first program code be unsatisfactory for described pre-conditioned time, it is determined that described first program code exists abnormal.
Device the most according to claim 8, it is characterised in that described code information includes that marking code, described judge module include:
First judges submodule, is used for judging that described marking code is the most consistent with the first preset value;And
First determines submodule, for when judging that described marking code is consistent with described first preset value, then determine that the code information of described first program code meets described pre-conditioned, when judging that described marking code and described first preset value are inconsistent, it is determined that the code information of described first program code is unsatisfactory for described pre-conditioned.
Device the most according to claim 8, it is characterised in that described code information includes the check value of described first program code, described judge module includes:
Second judges submodule, consistent for judging whether the check value of described first program code presets check value with first;And
Second determines submodule, for judge the check value of described first program code preset with described first check value consistent time, then determine that the code information of described first program code meets described pre-conditioned, judge the check value of described first program code with described first preset check value inconsistent time, it is determined that the code information of described first program code is unsatisfactory for described pre-conditioned.
11. devices according to claim 8, it is characterised in that described judge module includes:
3rd judges submodule, for judging that the marking code of described first program code is the most consistent with the second preset value;
3rd determines submodule, for when the marking code judging described first program code is inconsistent with described second preset value, it is determined that the code information of described first program code is unsatisfactory for described pre-conditioned;
Obtain submodule, for when the marking code judging described first program code is consistent with described second preset value, then continue to obtain the check value of described first program code;
4th judges submodule, the most consistent for judging that the check value and second of described first program code presets check value;And
4th determines submodule, for judge the check value of described first program code preset with described second check value consistent time, then determine that the code information of described first program code meets described pre-conditioned, judge the check value of described first program code with described second preset check value inconsistent time, it is determined that the code information of described first program code is unsatisfactory for described pre-conditioned.
12. 1 kinds of chips, it is characterised in that include the device that the control chip according to any one of claim 7 to 11 runs.
CN201610151508.0A 2016-03-16 2016-03-16 Method and device for controlling chip operation and chip Pending CN105824717A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610151508.0A CN105824717A (en) 2016-03-16 2016-03-16 Method and device for controlling chip operation and chip

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610151508.0A CN105824717A (en) 2016-03-16 2016-03-16 Method and device for controlling chip operation and chip

Publications (1)

Publication Number Publication Date
CN105824717A true CN105824717A (en) 2016-08-03

Family

ID=56524646

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610151508.0A Pending CN105824717A (en) 2016-03-16 2016-03-16 Method and device for controlling chip operation and chip

Country Status (1)

Country Link
CN (1) CN105824717A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106648754A (en) * 2016-11-24 2017-05-10 硅谷数模半导体(北京)有限公司 Controller running method and device
CN110060726A (en) * 2019-01-30 2019-07-26 北京品驰医疗设备有限公司 The program detecting method and implantable medical device of flash memory
CN110059005A (en) * 2019-01-30 2019-07-26 北京品驰医疗设备有限公司 The program detecting method and implantable medical device of flash memory
CN110083393A (en) * 2019-01-30 2019-08-02 北京品驰医疗设备有限公司 Flash memory and implantable medical device
CN110442298A (en) * 2018-05-02 2019-11-12 杭州海康威视系统技术有限公司 Store unit exception detection method and device, distributed memory system
CN110928499A (en) * 2019-11-18 2020-03-27 珠海泰芯半导体有限公司 Flash memory embedded in chip, chip and starting method of chip
CN112597450A (en) * 2020-12-22 2021-04-02 深圳市道通科技股份有限公司 Programmable chip program detection and storage method and programmable chip

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102289395A (en) * 2011-07-14 2011-12-21 深圳市共进电子有限公司 Method for using double-code mirror image operation on embedded equipment
CN102906710A (en) * 2011-08-30 2013-01-30 华为技术有限公司 Bootrom backup method and apparatus
CN103226505A (en) * 2013-04-22 2013-07-31 华为技术有限公司 Method and equipment for checking basic input output system (BIOS)
CN103761112A (en) * 2011-12-30 2014-04-30 深圳市大富科技股份有限公司 Vehicle-mounted multimedia device and control method thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102289395A (en) * 2011-07-14 2011-12-21 深圳市共进电子有限公司 Method for using double-code mirror image operation on embedded equipment
CN102906710A (en) * 2011-08-30 2013-01-30 华为技术有限公司 Bootrom backup method and apparatus
CN103761112A (en) * 2011-12-30 2014-04-30 深圳市大富科技股份有限公司 Vehicle-mounted multimedia device and control method thereof
CN103226505A (en) * 2013-04-22 2013-07-31 华为技术有限公司 Method and equipment for checking basic input output system (BIOS)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106648754A (en) * 2016-11-24 2017-05-10 硅谷数模半导体(北京)有限公司 Controller running method and device
CN106648754B (en) * 2016-11-24 2019-12-03 硅谷数模半导体(北京)有限公司 Controller operation method and device
CN110442298A (en) * 2018-05-02 2019-11-12 杭州海康威视系统技术有限公司 Store unit exception detection method and device, distributed memory system
CN110442298B (en) * 2018-05-02 2021-01-12 杭州海康威视系统技术有限公司 Storage equipment abnormality detection method and device and distributed storage system
CN110083393B (en) * 2019-01-30 2022-12-16 北京品驰医疗设备有限公司 Flash memory and implantable medical device
CN110083393A (en) * 2019-01-30 2019-08-02 北京品驰医疗设备有限公司 Flash memory and implantable medical device
CN110059005A (en) * 2019-01-30 2019-07-26 北京品驰医疗设备有限公司 The program detecting method and implantable medical device of flash memory
CN110060726A (en) * 2019-01-30 2019-07-26 北京品驰医疗设备有限公司 The program detecting method and implantable medical device of flash memory
CN110060726B (en) * 2019-01-30 2022-12-16 北京品驰医疗设备有限公司 Program detection method of flash memory and implantable medical device
CN110059005B (en) * 2019-01-30 2022-12-16 北京品驰医疗设备有限公司 Program detection method of flash memory and implantable medical device
CN110928499A (en) * 2019-11-18 2020-03-27 珠海泰芯半导体有限公司 Flash memory embedded in chip, chip and starting method of chip
CN110928499B (en) * 2019-11-18 2023-11-14 珠海泰芯半导体有限公司 Flash memory embedded in chip, chip and starting method of chip
CN112597450A (en) * 2020-12-22 2021-04-02 深圳市道通科技股份有限公司 Programmable chip program detection and storage method and programmable chip

Similar Documents

Publication Publication Date Title
CN105824717A (en) Method and device for controlling chip operation and chip
CN103220411B (en) A kind of hot plug detection method, device and mobile terminal
CN105187230B (en) The switching method and device of server
CN104765657A (en) Data backup method, data recovery method and relative device
US20180107844A1 (en) Disabling counterfeit cartridges
CN101578925B (en) Universal electronic ballast for operating hg-free and hg-containing discharge lamps
CN109654666A (en) A kind of method, device and equipment for debugging unit
CN102929565A (en) Method, device and chip for reading boot loader based on system on chip (SoC)
CN104010077A (en) Information processing method and electronic equipment
CN101425930B (en) Method and equipment for ensuring single board operation software
CN104566859A (en) Anti-freezing control method and device of air conditioning unit
CN102736933A (en) BOOT file loading method and device
CN108170456A (en) The firmware upgrade method and device of electronic equipment
JP4411344B2 (en) A method for recognizing incompatibility in a bus system with multiple control devices
CN102571443B (en) Abnormality handling method and device
CN101179443A (en) Method, device and system of implementing configuration data conformance in system
CN105095098A (en) Method and device for controlling memories having different capacities
CN105653412A (en) Fingerprint device compatibility detection method and terminal
CN113325335B (en) Circuit failure detection circuit and method and intelligent electronic equipment
CN104216797B (en) Embedded system setting value initialization system, method and electronic installation
CN108319679B (en) Method and device for generating primary key
CN108021381A (en) The upgrading method for one-chip computer and device of equipment
CN113628359A (en) Vehicle-mounted historical fault information query system and method, vehicle-mounted equipment and vehicle
CN109428918B (en) Method and device for synchronizing mapping relationship between domain account and domain group
CN107395475B (en) CAN communication polarity control method, device and system and multi-connected air conditioning unit

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20160803

RJ01 Rejection of invention patent application after publication