CN102339227A - Multi-firmware embedded system and firmware update method thereof - Google Patents

Multi-firmware embedded system and firmware update method thereof Download PDF

Info

Publication number
CN102339227A
CN102339227A CN2010102394743A CN201010239474A CN102339227A CN 102339227 A CN102339227 A CN 102339227A CN 2010102394743 A CN2010102394743 A CN 2010102394743A CN 201010239474 A CN201010239474 A CN 201010239474A CN 102339227 A CN102339227 A CN 102339227A
Authority
CN
China
Prior art keywords
firmware
those
updated
firmwares
embedded system
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
CN2010102394743A
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.)
HUANXU ELECTRONICS CO Ltd
Universal Scientific Industrial Co Ltd
Universal Global Scientific Industrial Co Ltd
Original Assignee
HUANXU ELECTRONICS CO Ltd
Universal Global Scientific Industrial Co Ltd
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 HUANXU ELECTRONICS CO Ltd, Universal Global Scientific Industrial Co Ltd filed Critical HUANXU ELECTRONICS CO Ltd
Priority to CN2010102394743A priority Critical patent/CN102339227A/en
Publication of CN102339227A publication Critical patent/CN102339227A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention discloses a multi-firmware embedded system and a firmware update method thereof. The system comprises a processing unit, a main storage unit, and multiple kinds of system firmware which are stored in a plurality of storage blocks. The method comprises the following steps of: receiving firmware to be updated; searching addresses of the storage blocks, and identifying in-use firmware and non-use firmware in the system firmware; writing the firmware to be updated into the storage blocks corresponding to the non-use firmware to replace the non-use firmware; comparing the in-use firmware with an edition of the firmware to be updated so as to judge whether the firmware to be updated is an update edition or a backtracking edition of the in-use firmware; setting an update parameter according to a comparison result so as to indicate the update edition or the backtracking edition; and restarting the embedded system, and selecting the system firmware of which edition data corresponds to an update parameter from the storage blocks. Due to the adoption of an electronic product, updated firmware can be used for providing service, and the electronic product can still be kept operated without obstruction even after update failure.

Description

Many firmwares embedded system and firmware update thereof
Technical field
The present invention relates to the method for a kind of embedded system and firmware update thereof, particularly relate to a kind of embedded system of the changeable renewal of a plurality of system firmwares and update method between a plurality of firmware thereof of comprising.
Background technology
The function that electronic product possessed; Often upgrade or expansion along with technology rapid development, particularly be suitable for the consumption electronic products of embedded system, frequent especially mode through firmware update; Promptly the firmware with more recent version replaces the firmware that electronic product is suitable for originally; Revise the defective on the electronic product function, or increase and strengthen the function that it possesses, to promote the utilization benefit of product.
Yet the user carries out the puzzlement that firmware update the most often runs into for embedded system, is exactly more in the new technological process the too complicated difficult understanding of operating mistake or refresh routine to take place accidentally, and causes the failure of firmware update.After the firmware update failure, the user not only can't enjoy the benefit that promotes the product utilization benefit, even possibly original function all lose efficacy because of firmware originally damages in renewal process.Such setback not only lets the user can't normal operation produce many maintenance costs because of electronic product, also lets the fabricator because of maintenance product generation time cost simultaneously, has hindered the speed of technological continuation progress.
Summary of the invention
The technical matters that the present invention will solve is can't guarantee in the prior art that in order to overcome embedded system can load system firmware after the renewal makes the embedded system collapse with avoiding making a mistake in the renewal process defective; A kind of embedded system with a plurality of system firmwares is provided, and the firmware update of said embedded system.
The present invention solves above-mentioned technical matters through following technical proposals:
A kind of embedded system firmware update; This embedded system comprises a processing unit, a main memory unit; And a plurality of system firmwares, those system firmwares are stored in the plurality of memory blocks of a storage unit respectively one to one, are characterized in that this method comprises:
This embedded system receives a firmware to be updated that includes edition data in a user environment;
Seek the address of those memory block;
Firmware in a firmware and the non-use during in the middle of those system firmwares of identification use, each system firmware comprises corresponding edition data respectively;
Should write pairing this memory block of firmware in this non-use by firmware to be updated, to replace in this non-use firmware as a wherein system firmware of this embedded system;
Comparing the edition data of firmware and this firmware to be updated in this use, is that a upgraded version or of firmware is recalled version in this use to judge this firmware to be updated;
According to comparison result one undated parameter is set, maybe this recalls version to this undated parameter in order to indicate this upgraded version; And
Restart this embedded system, and choose the wherein system firmware that edition data corresponds to this undated parameter from those memory block.
Preferable, receive this firmware to be updated after, also comprise:
The integrality and the legitimacy of this firmware to be updated that checking receives.
Preferable, should firmware to be updated write in this non-use before pairing this memory block of firmware, also comprise:
Compare the edition data of this firmware to be updated and those system firmwares, whether identical to judge this firmware to be updated with the edition data of arbitrary system firmware; And
All different when the edition data of this firmware to be updated and those system firmwares, then carry out the step that writes this firmware to be updated.
Preferable, compare in the step of edition data of this firmware to be updated and those system firmwares, when this firmware to be updated is identical with the edition data of arbitrary system firmware, then stop upgrading the firmware of this embedded system.
Preferable, should firmware to be updated write in this non-use after pairing this memory block of firmware, also comprise:
Checking is stored in the integrality and the legitimacy of this firmware to be updated of this memory block.
Preferable, should firmware to be updated write in this non-use after pairing this memory block of firmware, also comprise:
It is an initial value that one count value is set; And
One certificate parameter of this firmware to be updated is set, and this certificate parameter is normal or mistake in order to indicate pairing this system firmware.
Preferable, restart this embedded system, and choose in the step of a system firmware wherein and comprise:
Detect those system firmwares that those memory block are stored respectively;
Read this undated parameter;
The edition data of those system firmwares that comparison is detected is to judge the version ordinal relation of those system firmwares that detected; And
According to the version ordinal relation of those system firmwares, specify edition data and the corresponding wherein system firmware of this undated parameter are mounted to this main memory unit.
Preferable, appointment will be mounted to after this main memory unit with corresponding this system firmware of this undated parameter, also comprise:
Judge whether this system firmware that is mounted to this main memory unit is successfully opened;
When successfully opening, corresponding this certificate parameter is set to point out that by this system firmware of carry served as normal; And
In the time can't successfully opening, corresponding this certificate parameter is set to point out that by this system firmware of carry be mistake.
Preferable, corresponding this certificate parameter is set to point out that by this system firmware of carry be after the mistake, also comprise:
Returning the step that restarts this embedded system carries out.
Preferable, appointment will be mounted to after this main memory unit with corresponding this system firmware of this undated parameter, also comprise:
Increase this count value.
Preferable, read before this undated parameter, also comprise:
Judge whether this count value has arrived or surpass a threshold value;
When this threshold value of this count value no show still, carry out the step that reads this undated parameter; And
When this count value has arrived or surpasses this threshold value; Judge that then pairing those certificate parameters of those system firmwares indicate corresponding those system firmwares and are normal or mistake; If those certificate parameters indicate those system firmwares and are all normally, then carry out the step that reads this undated parameter.
Preferable, it is characterized in that, judge that those certificate parameters indicate corresponding those system firmwares in normal or the wrong step, comprising:
If those certificate parameters indicate those system firmwares and are all mistake, then switching this undated parameter and reseting this count value is this initial value; And
The step of this undated parameter is read in execution.
Preferable, judge that those certificate parameters indicate corresponding those system firmwares in normal or the wrong step, comprising:
A system firmware is only arranged wherein for normal if those certificate parameters indicate, then specify to be indicated as normal this system firmware and to be mounted to this main memory unit; And
Carry out the step that increases this count value.
Preferable, detect after those system firmwares that those memory block store respectively, also comprise:
Judge the quantity of the effective system firmware that this storage unit is stored;
If this storage unit comprises a plurality of effectively those system firmwares, then carry out the step that reads this undated parameter; And
If this storage unit only comprises an efficient system firmware, then specifying effectively, this system firmware is mounted to this main memory unit.
And a kind of many firmwares embedded system, be characterized in comprising:
One storage unit comprises:
Plurality of memory blocks, each memory block is in order to store a system firmware, and each system firmware comprises corresponding edition data; And
One reference record block writes down a undated parameter, and this undated parameter indicates a upgraded version or and recalls version;
One main memory unit, a wherein system firmware of being stored in order to those memory block of carry is a firmware in the use, makes this embedded system get into a user environment; And
One processing unit; Reception includes a firmware to be updated of edition data; And this firmware to be updated write pairing this memory block of firmware in the non-use in those system firmwares; Replacing firmware in this non-use, and the version ordinal relation of comparing firmware and this firmware to be updated in this use, so that this undated parameter to be set.
Preferable; When this processing unit starts in this embedded system; Read and compare the version ordinal relation of those system firmwares that those memory block store; And, choose the wherein system firmware of edition data, to be mounted to this main memory unit corresponding to this undated parameter according to this undated parameter and version ordinal relation.
Preferable, this storage unit also comprises:
One power-on management module comprises that a firmware chooses module, and this processing unit is chosen the instruction of module according to this firmware, when this embedded system starts, according to this undated parameter and version ordinal relation, chooses a wherein system firmware.
Preferable, this reference record block also comprises:
A plurality of certificate parameters, those system firmwares in order to indicate those memory block to store one to one respectively are mounted to and normally open behind this main memory unit or make a mistake;
One count value, after writing down this firmware to be updated and writing wherein a memory block, the number of times that this embedded system restarts;
Wherein, this processing unit is chosen the instruction of module according to this firmware, when this count value arrives or surpass a threshold value, checks those certificate parameters, should be mounted to a wherein system firmware of this main memory unit with decision.
Preferable, when this count value arrives or surpasses this threshold value, and those certificate parameters all indicate those system firmwares when wrong, and this processing unit is chosen the instruction of module according to this firmware, switches the content of this undated parameter, and to reset this count value be an initial value.
Preferable, when this count value arrives or surpasses this threshold value, and those certificate parameters indicate and only have that wherein a system firmware is for just often, and this processing unit specifies carry to be indicated as this system firmware normally.
Positive progressive effect of the present invention is:
Upgrade the firmware of electronic product for the user and provide convenience, make electronic product service is provided, even after upgrading failure, still can keep electronic product nothing serious running with the firmware after upgrading.
Description of drawings
Fig. 1 is the circuit block diagram of embedded system embodiment of the present invention.
Fig. 2 is the process flow diagram of embedded system firmware update embodiment of the present invention.
Fig. 3 is the process flow diagram of embedded system firmware update embodiment of the present invention.
The primary clustering symbol description
1 embedded system
10 storage unit
100 power-on management modules
1002 firmwares are chosen module
102 reference record blocks
104 first memory block
106 second memory block
12 main memory units
14 processing units
16 network control units
The S201-S223 process step
The S301-S329 process step
Embodiment
Provide preferred embodiment of the present invention below in conjunction with accompanying drawing, to specify technical scheme of the present invention.
Fig. 1 is the circuit block diagram of embedded system embodiment of the present invention.Described embedded system 1 includes a storage unit 10, a main memory unit 12, a processing unit 14 and a network control unit 16.
Storage unit 10 also comprises having power-on management module 100, the reference record block 102 that a firmware is chosen module 1002, and plurality of memory blocks.Each memory block system firmware of videoing; In other words, the embedded system 1 of present embodiment includes a plurality of system firmwares.Storage unit 10 described in the present embodiment can be a flash memory (Flash memory); Said memory block then can be the memory techniques equipment subregion (memory technology deviceblock) of the analog block equipment that is used for (block device), and system firmware can be root file system (root file system).
Present embodiment is with two memory block: first memory block 104 and second memory block 106 are that example describes.Wherein, first memory block, 104 reflections, first firmware, second memory block, 106 reflections, second firmware.The system firmware that memory block is videoed is an image file (image); Behind embedded system 1 each the startup; Processing unit 14 can be according to the control of power-on management module 100; The image file carry (mount) of one of them system firmware is arrived main memory unit 12, with the user environment that provides the user to operate.
The header of the image file of each system firmware (header) all records the version number of said image file, can supply to discern the sequencing that (release) developed or disengaged to the different system firmware.Generally speaking, big more this firmware program of representative of version number time of disengaging is more late, contents of program is new more.In the present embodiment, the version of first firmware and second firmware is different.
Fig. 2 is the process flow diagram of embedded system firmware update embodiment of the present invention; Please in the lump with reference to the circuit block diagram of embedded system embodiment shown in Figure 1; Be beneficial to understand association of each inter-module in the circuit block diagram of embedded system embodiment shown in Figure 1 and uses thereof, and the flow process of firmware update.
When first firmware of embedded system 1 carry or second firmware to main memory unit 12; Go forward side by side behind the access customer environment; The user is if there is the demand of renewal (update) system firmware; Can download and receive a firmware to be updated (S201) by processing unit 14 through server or the website of network control unit 16 to the firmware supplier.Described firmware to be updated is also for being compatible with the system firmware of embedded system 1; Processing unit 14 can carry out the checking (S203) of data integrity and legitimacy earlier to the firmware to be updated that is received; For example pass through type identification, the magic number (Magic Number) of firmware to be updated itself; Or utilize CRC (like CRC32) algorithm to verify, identical to guarantee the received firmware to be updated of embedded system 1 with the firmware that the supplier is provided.
For successful update system firmware, guarantee the accident that embedded system 1 does not produce in the reason firmware update process simultaneously and can't start once again that present embodiment is to replace firmware in the present non-use with firmware to be updated.Therefore; Processing unit 14 also must know present embedded system 1 just in use firmware be first firmware or second firmware; And system firmware first memory block 104 of videoing and the place of second memory block 106, will be to pick out with the substituted system firmware of firmware to be updated (S205).
Processing unit 14 is according to the title of the firmware program in the main memory unit 12, version number or corresponding to the firmware storage address of storage unit 10; Compare with the corresponding data of first firmware that is write down in the storage unit 10 and second firmware, can judge in the present use why person of firmware; Simultaneously, according to the block design of 1 pair of storage unit 10 of different embedded systems, can hunt out the memory block place that each system firmware is videoed in storage unit 10.Judge in the present use behind the firmware memory block that also can learn firmware in the non-use and videoed (for example be arranged in regular turn power-on management module 100 with reference record block 102 after).
For example; In the linux system platform; With storage unit 10 is virtual when being block equipment; What first memory techniques equipment subregion possibly placed is the table of comparisons of other block device content, and second memory techniques equipment subregion possibly placed correlation parameter, and the ensuing the 3rd and the 4th memory techniques equipment subregion just possibly deposited first and second firmware in regular turn; Certainly, the position of these subregions can be different and different along with employed system platform with sequencing.If firmware is first firmware in using, firmware is second firmware in the then non-use.By this, processing unit 14 can determine the firmware to be updated that will pass through checking to write pairing second memory block 106 of second firmware, to replace second firmware originally.
Present embodiment upgrades the practice of system firmware in the non-use; Its advantage is: even suffer from accident in the process of firmware update, for example cut off the power supply or user's misoperation, and make firmware to be updated can't correctly be written into corresponding memory block; First firmware is still complete effectively; Can ensure to also have first firmware normally to open at least after embedded system 1 restarts, provide the user to get into user environment after, receive firmware to be updated once again and upgrade the chance of firmware.
Find out first firmware, second firmware; And find out and want after second memory block 106 that substituted second firmware videos; Before beginning renewal; Processing unit 14 also can be compared the version ordinal relation (S207) between first, second firmware and the firmware to be updated earlier, with judge firmware to be updated whether with storage unit 10 in any one version identical (S209) in original system firmware.
The purpose of above-mentioned steps S209; System is for fear of system resource waste; When the version number of processing unit 14 with first and second firmware of version number comparison of firmware to be updated; When finding that version number with first or second firmware is identical, one of them is with a firmware mapping file to represent firmware to be updated and first and second firmware, does not promptly have necessity of renewal once more.At this moment, processing unit 14 can stop upgrading the work (S211) of firmware, and can be with this information indicating user.
If the version of firmware to be updated is neither identical with the version of first and second firmware; 14 continuation of processing unit write second memory block 106 (S213) with firmware to be updated; Accomplish the program of displacement second firmware; After making that displacement is accomplished, first memory block, 104 reflections, first firmware, and second memory block, 106 reflections firmware to be updated.
Generally speaking; The user upgrades firmware mostly when thinking upgrading (upgrade) embedded system 1; That is to say that firmware to be updated is a upgraded version, in order to the function that first or second firmware do not provided to be provided or to revise the mistake that exists in first or second firmware program; Yet sometimes in order to be compatible with the equipment of old type, the user possibly recall (downgrade) embedded system 1 to early version, and therefore, the firmware to be updated of downloading or receiving also possibly recalled version for one.
For this reason; When processing unit 14 writes second memory block 106 with firmware to be updated; The version number of first firmware that also can judge firmware to be updated and not be updated; And a undated parameter (S215) that is write down in the reference record block 102 is set, a flag (flag) for example is to start the foundation of back selecting system firmware as embedded system 1.In this example, the version that undated parameter promptly identifies firmware to be updated is as upgraded version or recalls version compared to first firmware in using.For example: when firmware to be updated was upgraded version, undated parameter was recorded as 1; When recalling version, undated parameter then is recorded as 0.Simultaneously, processing unit 14 also can be after firmware to be updated writes, and the count value in the reference record block 102 is set to an initial value, is beneficial to follow-up operation of restarting embedded system 1.Described initial value can be 0, and the related description of count value will be set forth in the back.
After firmware update was accomplished, when embedded system 1 is restarted (S217), power-on management module 100 (the for example LILO of linux system) promptly began to prepare to load the system firmware of core.In the present embodiment, power-on management module 100 included firmwares are chosen module 1002 and are responsible for hunting out several system firmwares (S219) that storage unit 10 is stored, and in the middle of the system firmware that searches, select one and be mounted to main memory unit 12.
After above-mentioned firmware update process, stored system firmware is respectively first firmware and firmware to be updated in first memory block 104 and second memory block 106 at this moment.Processing unit 14 reads the undated parameter (S221) that reference record block 102 is write down according to the instruction that firmware is chosen module 1002; With identification the version of the system firmware that should choose be upgraded version or recall version; And choose corresponding system firmware in view of the above; For power-on management module 100 it is mounted to main memory unit 12 (S223), accomplishes the start-up routine of embedded system 1.
If undated parameter points out that the firmware to be updated that is write before embedded system 1 is restarted is a upgraded version; Processing unit 14 promptly can read the edition data that header write down of the system firmware image file of depositing in two memory block 104,106; Inquiry also compares out how person's version is newer in two system firmwares; And the newer system firmware of decision version is set to the firmware with carry; Transfer to power-on management module 100 and be mounted to main memory unit 12, begin to carry out the initialization operation of each item default, accomplish the program that starts embedded system 1.If undated parameter points out, what write embedded system 1 is to recall version, and firmware is chosen 1002 of modules and selected version system firmware early in the storage unit 10, transfers in addition carry of power-on management module 100.
Fig. 3 shown when starting embedded system, and embedded system is chosen the method embodiment process flow diagram of the firmware data that the user upgrades.Please consult the circuit block diagram of embedded system shown in Figure 11 simultaneously.
At first be noted that; Reference record block 102 is except record undated parameter and count value; Also comprise the reference position of system firmware in storage unit 10; For example: the start address of first memory block 104 and second memory block 106, use for power-on management module 100 according to the corresponding system firmware of start address access.Reference record block 102 also writes down the certificate parameter of each system firmware respectively, in order to indicate system firmware by the result after verifying.
Before embedded system 1 was not carried out firmware update as yet, undated parameter can be a parameter preset (like factory-default), for example is defaulted as 1, chose newer version in the middle of first firmware and second firmware with indication embedded system 1; And count value also can be set to initial value in advance when embedded system 1 is dispatched from the factory.When embedded system 1 after upgrading system firmware under the user environment, no matter be with embedded system 1 upgrading or recall, undated parameter and count value all can through and modification and be recorded in reference record block 102.
Therefore, when embedded system 1 starts (S301), processing unit 14 beginnings according to the instruction of power-on management module 100 prepare to detect, operation such as carry system firmware.Before the carry system firmware; Can choose the instruction of module 1002 and the system firmware start address in the reference record block 102 according to firmware; Whether the detecting of corresponding address has plural system firmware (S303) in the storage unit 10, for detecting whether two system firmwares is arranged in this example; And can detect the legitimacy and the integrality of the system firmware that has storage unit 10.If finding only to have a system firmware, firmware to choose module 1002, the detecting result promptly directly specify unique system firmware that carry storage unit 10 stored to main memory unit 12 (S305).Though perhaps detect two system firmwares, only one of them system firmware is through the check of legitimacy and integrality, and when confirming as the efficient system firmware, firmware is chosen module 1002 and promptly specified this efficient system firmware of carry to main memory unit 12.
If the detecting result finds that two system firmwares all are stored in storage unit 10 and are all the efficient system firmware, then further read count value, judge whether count value has met or exceeded a threshold value (S307).If do not meet or exceed threshold value as yet, processing unit 14 continues to choose according to firmware the instruction of module 1002, reads undated parameter (S309), to judge that undated parameter indicates a upgraded version or and recalls version.In addition and the version number that is write down in the header according to two system firmware image files, judge the version ordinal relation (S319) of two system firmwares.Then, specify the system firmware (S321) of carry corresponding to undated parameter according to the indication of undated parameter and the version ordinal relation between system firmware.
Appointment will the system firmware of carry after, processing unit 14 increases numerical value (S323): read the count value in the reference record block 102, write reference record block 102 again after adding 1.Then judge appointed system firmware whether normally be unlocked (S325); Judge just whether appointed system firmware image file successfully is mounted to main memory unit 12; And untie the initialization that image file carries out the system core smoothly, make embedded system 1 get into user environment.If specify the system firmware of carry normally to be unlocked, then to upgrade by the pairing certificate parameter of the system firmware of carry, its certificate parameter is set to point out system firmware normal (S329), for example certificate parameter is set to 1, normally opens with the representative system firmware.
Even through the checking of integrality and legitimacy, still might cause the system firmware execution that can't correctly be unlocked before the memory block of system firmware write storage unit 10 because of a variety of causes.Therefore, if the system of designated carry can't normally start with part, the pairing certificate parameter of then said system firmware is set to point out system firmware mistake (S327), for example is set to 0; Restart embedded system 1 again, attempt loading system firmware (returning execution in step S301 and following) once again.
In addition; Judge whether the count value of reference record block 102 arrives or surpass the result of threshold value according to step S307; If count value has at that time arrived really or surpass threshold value, judge further then whether each certificate parameter in the reference record block 102 indicates each system firmware all normal (S311); In other words, just according to certificate parameter judge each system firmware whether formerly start-up routine all once successfully loaded and opened.If, then still continue indication according to undated parameter, choose in addition carry (below the step S309) of corresponding system firmware.
But if be not that each certificate parameter points out that all corresponding system firmware is for normal; Judge whether that then each certificate parameter points out that all corresponding system firmware is wrong (S313); If; Then representative is previous through starting for several times embedded system 1, and specifies the specific system firmware of carry all get nowhere according to the indication of undated parameter, then switches the undated parameter content design value (S317) of laying equal stress at this moment.For example: undated parameter is indicated 1 of carry upgraded version by script; Switch to the indication carry and recall 0 of version; So that when firmware is chosen module 1002 and is continued to carry out the step that reads undated parameter (S309); According to the undated parameter of switching, reelect and get version system firmware early, attempt version system firmware early is mounted to main memory unit 12; Also count value is reset to 0 simultaneously, makes firmware choose module 1002, all specify carry version system firmware early with the undated parameter after switching restarting before number of times reaches threshold value.
If judge the system firmware in the storage unit 10 neither all be shown as normal (step S311 result is not) according to certificate parameter; The non-again mistake (step S313 result for not) that all is shown as, then representing only has a system firmware for normal in the middle of two system firmwares that storage unit 10 stores.In the case, firmware is chosen module 1002 and is promptly no longer chosen according to the indication of undated parameter, points out to be normal particular system firmware (S315) and change direct specific authentication parameter into, for carry.And behind the system firmware of having specified carry normally to open, increase count value (S323).
In above-mentioned flow process, behind embedded system 1 each the startup, no matter whether system firmware is successfully opened, and count value all can add up; And since embedded system 1 before under user environment with firmware update to be updated after the storage unit 10, count value will be reset to 0, so the number of times that on behalf of embedded system 1, count value can restart later in firmware update.
Judge whether count value arrives or surpass threshold value at step S307; And do the means of different disposal according to judged result; The system firmware after renewal is chosen in the indication that provides embedded system 1 to according to undated parameter, a kind of mechanism of correction is provided also simultaneously, so that when embedded system 1 can't be opened the system firmware that upgraded smoothly according to the indication of undated parameter; Still have an opportunity to open the system firmware that is not modified, prevent embedded system 1 collapse (crash).
For instance; Given threshold is 2; If count value is less than 2, just from system firmware through after upgrading, embedded system 1 is for the first time or when starting for the second time; No matter whether each system firmware in the storage unit 10 can normally be opened, firmware is chosen module 1002 all can specify the system firmware of carry corresponding to undated parameter.For example: undated parameter is to indicate 1 of upgraded version, firmware choose module 1002 will specify with the version order after system firmware be mounted to main memory unit 12, and whether successfully open according to system firmware behind the carry and to write down corresponding certificate parameter.
When the count value arrival of embedded system 1 or above threshold value; When just startup is above for the third time; Firmware is chosen module 1002 will judge each certificate parameter that is write down in the reference record block 102; If each certificate parameter is all pointed out corresponding system firmware and is normal (for example parameter value is 1), represent the embedded system 1 previous system firmware that loads for several times all normal, then can continue to keep original start flow process; Each when starting embedded system 1, all according to the record of undated parameter and choose the system firmware that upgraded.
If in count value arrival or above threshold value; And when finding to have only a system firmware normally to open according to certificate parameter; No matter this moment, this openable system firmware was first firmware of the firmware to be updated that before had been written into or script, firmware is chosen module 1002, and all can directly to specify the carry certificate parameter be 1 system firmware, can open normal system firmware smoothly to guarantee embedded system 1; Get into user environment, attempt opening wrong system firmware to avoid embedded system 1 to continue.
Even finding that each system firmware all is registered as mistake (being that certificate parameter is 0), firmware is chosen module 1002 still can constantly attempt loading different system firmwares, with the chance that provides embedded system 1 to get into user environment.
Under the situation that system firmware all can't normally be opened; The count value of embedded system 1 arrives before the threshold value, and firmware is chosen module 1002 and still chosen corresponding system firmware according to the content of undated parameter, when count value arrives threshold value; Because appointed system firmware (firmware for example to be updated) can't normally be unlocked all the time originally; Then switch the content of undated parameter this moment, for example: switch to 0 by 1, make embedded system 1 when the selecting system firmware; The corresponding undated parameter of being switched and reelect another system firmware (for example first firmware), the trial unlatching.
Except switching undated parameter, also count value is reset to 0 simultaneously, make the system firmware of newly choosing (being first firmware in this example) also have the chance of as much (as being secondary in this example) and be mounted to main memory unit 12.When count value arrives threshold value once again, if still can't successfully start, then switch the content of undated parameter once more, attempt loading another system firmware (firmware to be updated in this example).Utilize this means of switching repeatedly, attempt system firmware is mounted in the main memory unit 12.The deviser can formulate one switches number of times, when undated parameter is switched to when reaching predetermined switching times, then stops to continue to attempt loading procedure.Embedded system 1 can be transferred to the work that other detection or repair procedure are repaired.
According to the embedded system shown in the foregoing description with and firmware update; The user not only can use the newer system firmware of version to upgrade as embedded system; Can also upgrade embedded system by version system firmware early; Make embedded system date back to more early stage state, the user tests or the demand of other operations to meet.
Except can be with arbitrarily with embedded system upgrading or recalling; Embedded system is when starting; Choose the practice of the system firmware that should load according to the content of undated parameter set behind the exchange system firmware,, can both select the system firmware of renewal exactly no matter make embedded system be through upgrading or recall; Just the user hopes the system firmware of use; So that after being loaded into main memory unit, can smoothly image file be untied, to get into the user environment of user's desired procedure.
When even the system firmware that the user upgrades can't normally be opened; As long as record a normal openable system firmware in the storage unit; The present invention can guarantee that still embedded system can utilize normal openable system firmware to start smoothly, lets the user can continue to operate embedded system.Many firmwares embedded system of the present invention and firmware update thereof can be avoided making a mistake or user's misoperation in the exchange system firmware process; And the situation that causes embedded system to damage fully, can't open is guaranteed stability of embedded system.
Though more than described embodiment of the present invention, it will be understood by those of skill in the art that these only illustrate, protection scope of the present invention is limited appended claims.Those skilled in the art can make numerous variations or modification to these embodiments under the prerequisite that does not deviate from principle of the present invention and essence, but these changes and modification all fall into protection scope of the present invention.

Claims (20)

1. embedded system firmware update; This embedded system comprises a processing unit, a main memory unit, and a plurality of system firmware, and those system firmwares are stored in the plurality of memory blocks of a storage unit respectively one to one; It is characterized in that this method comprises:
This embedded system receives a firmware to be updated that includes edition data in a user environment;
Seek the address of those memory block;
Firmware in a firmware and the non-use during in the middle of those system firmwares of identification use, each system firmware comprises corresponding edition data respectively;
Should write pairing this memory block of firmware in this non-use by firmware to be updated, to replace in this non-use firmware as a wherein system firmware of this embedded system;
Comparing the edition data of firmware and this firmware to be updated in this use, is that a upgraded version or of firmware is recalled version in this use to judge this firmware to be updated;
According to comparison result one undated parameter is set, maybe this recalls version to this undated parameter in order to indicate this upgraded version; And
Restart this embedded system, and choose the wherein system firmware that edition data corresponds to this undated parameter from those memory block.
2. embedded system firmware update as claimed in claim 1 is characterized in that, receives after this firmware to be updated, also comprises:
The integrality and the legitimacy of this firmware to be updated that checking receives.
3. embedded system firmware update as claimed in claim 1 is characterized in that, should firmware to be updated writes in this non-use before pairing this memory block of firmware, also comprises:
Compare the edition data of this firmware to be updated and those system firmwares, whether identical to judge this firmware to be updated with the edition data of arbitrary system firmware; And
All different when the edition data of this firmware to be updated and those system firmwares, then carry out the step that writes this firmware to be updated.
4. embedded system firmware update as claimed in claim 3; It is characterized in that; Compare in the step of edition data of this firmware to be updated and those system firmwares,, then stop upgrading the firmware of this embedded system when this firmware to be updated is identical with the edition data of arbitrary system firmware.
5. embedded system firmware update as claimed in claim 1 is characterized in that, should firmware to be updated writes in this non-use after pairing this memory block of firmware, also comprises:
Checking is stored in the integrality and the legitimacy of this firmware to be updated of this memory block.
6. embedded system firmware update as claimed in claim 1 is characterized in that, should firmware to be updated writes in this non-use after pairing this memory block of firmware, also comprises:
It is an initial value that one count value is set; And
One certificate parameter of this firmware to be updated is set, and this certificate parameter is normal or mistake in order to indicate pairing this system firmware.
7. embedded system firmware update as claimed in claim 6 is characterized in that, restarts this embedded system, and chooses in the step of a system firmware wherein and comprise:
Detect those system firmwares that those memory block are stored respectively;
Read this undated parameter;
The edition data of those system firmwares that comparison is detected is to judge the version ordinal relation of those system firmwares that detected; And
According to the version ordinal relation of those system firmwares, specify edition data and the corresponding wherein system firmware of this undated parameter are mounted to this main memory unit.
8. embedded system firmware update as claimed in claim 7 is characterized in that, appointment will be mounted to after this main memory unit with corresponding this system firmware of this undated parameter, also comprise:
Judge whether this system firmware that is mounted to this main memory unit is successfully opened;
When successfully opening, corresponding this certificate parameter is set to point out that by this system firmware of carry served as normal; And
In the time can't successfully opening, corresponding this certificate parameter is set to point out that by this system firmware of carry be mistake.
9. embedded system firmware update as claimed in claim 8 is characterized in that, corresponding this certificate parameter is set to point out that by this system firmware of carry be after the mistake, also comprises:
Returning the step that restarts this embedded system carries out.
10. embedded system firmware update as claimed in claim 9 is characterized in that, appointment will be mounted to after this main memory unit with corresponding this system firmware of this undated parameter, also comprise:
Increase this count value.
11. embedded system firmware update as claimed in claim 10 is characterized in that, reads before this undated parameter, also comprises:
Judge whether this count value has arrived or surpass a threshold value;
When this threshold value of this count value no show still, carry out the step that reads this undated parameter; And
When this count value has arrived or surpasses this threshold value; Judge that then pairing those certificate parameters of those system firmwares indicate corresponding those system firmwares and are normal or mistake; If those certificate parameters indicate those system firmwares and are all normally, then carry out the step that reads this undated parameter.
12. embedded system firmware update as claimed in claim 11 is characterized in that, judges that those certificate parameters indicate corresponding those system firmwares in normal or the wrong step, comprising:
If those certificate parameters indicate those system firmwares and are all mistake, then switching this undated parameter and reseting this count value is this initial value; And
The step of this undated parameter is read in execution.
13. embedded system firmware update as claimed in claim 11 is characterized in that, judges that those certificate parameters indicate corresponding those system firmwares in normal or the wrong step, comprising:
A system firmware is only arranged wherein for normal if those certificate parameters indicate, then specify to be indicated as normal this system firmware and to be mounted to this main memory unit; And
Carry out the step that increases this count value.
14. embedded system firmware update as claimed in claim 7 is characterized in that, detects after those system firmwares that those memory block store respectively, also comprises:
Judge the quantity of the effective system firmware that this storage unit is stored;
If this storage unit comprises a plurality of effectively those system firmwares, then carry out the step that reads this undated parameter; And
If this storage unit only comprises an efficient system firmware, then specifying effectively, this system firmware is mounted to this main memory unit.
15. firmware embedded system more than a kind is characterized in that comprising:
One storage unit comprises:
Plurality of memory blocks, each memory block is in order to store a system firmware, and each system firmware comprises corresponding edition data; And
One reference record block writes down a undated parameter, and this undated parameter indicates a upgraded version or and recalls version;
One main memory unit, a wherein system firmware of being stored in order to those memory block of carry is a firmware in the use, makes this embedded system get into a user environment; And
One processing unit; Reception includes a firmware to be updated of edition data; And this firmware to be updated write pairing this memory block of firmware in the non-use in those system firmwares; Replacing firmware in this non-use, and the version ordinal relation of comparing firmware and this firmware to be updated in this use, so that this undated parameter to be set.
16. many firmwares embedded system as claimed in claim 15; It is characterized in that; When this processing unit starts in this embedded system, read and compare the version ordinal relation of those system firmwares that those memory block store, and according to this undated parameter and version ordinal relation; Choose the wherein system firmware of edition data, to be mounted to this main memory unit corresponding to this undated parameter.
17. many firmwares embedded system as claimed in claim 16 is characterized in that, this storage unit also comprises:
One power-on management module comprises that a firmware chooses module, and this processing unit is chosen the instruction of module according to this firmware, when this embedded system starts, according to this undated parameter and version ordinal relation, chooses a wherein system firmware.
18. many firmwares embedded system as claimed in claim 16 is characterized in that, this reference record block also comprises:
A plurality of certificate parameters, those system firmwares in order to indicate those memory block to store one to one respectively are mounted to and normally open behind this main memory unit or make a mistake;
One count value, after writing down this firmware to be updated and writing wherein a memory block, the number of times that this embedded system restarts;
Wherein, this processing unit is chosen the instruction of module according to this firmware, when this count value arrives or surpass a threshold value, checks those certificate parameters, should be mounted to a wherein system firmware of this main memory unit with decision.
19. many firmwares embedded system as claimed in claim 18; It is characterized in that; When this count value arrives or surpasses this threshold value, and those certificate parameters all indicate those system firmwares when wrong, and this processing unit is chosen the instruction of module according to this firmware; Switch the content of this undated parameter, and to reset this count value be an initial value.
20. many firmwares embedded system as claimed in claim 18; It is characterized in that; When this count value arrives or surpasses this threshold value, and those certificate parameters indicate and only have that wherein a system firmware is for just often, and this processing unit specifies carry to be indicated as this system firmware normally.
CN2010102394743A 2010-07-28 2010-07-28 Multi-firmware embedded system and firmware update method thereof Pending CN102339227A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010102394743A CN102339227A (en) 2010-07-28 2010-07-28 Multi-firmware embedded system and firmware update method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010102394743A CN102339227A (en) 2010-07-28 2010-07-28 Multi-firmware embedded system and firmware update method thereof

Publications (1)

Publication Number Publication Date
CN102339227A true CN102339227A (en) 2012-02-01

Family

ID=45514971

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010102394743A Pending CN102339227A (en) 2010-07-28 2010-07-28 Multi-firmware embedded system and firmware update method thereof

Country Status (1)

Country Link
CN (1) CN102339227A (en)

Cited By (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104572217A (en) * 2015-01-27 2015-04-29 广东欧珀移动通信有限公司 Updating method and system of wearable intelligent device
CN104765628A (en) * 2015-03-10 2015-07-08 惠州Tcl移动通信有限公司 Method and system for updating touch screen firmware of movable terminal
CN106484469A (en) * 2016-09-29 2017-03-08 广州芯德通信科技股份有限公司 A kind of embedded system data processing method and its device
CN107924443A (en) * 2015-07-23 2018-04-17 菲尼克斯电气公司 Firmware upgrade method and its system for the control device of process control
CN108595199A (en) * 2018-04-19 2018-09-28 济南浪潮高新科技投资发展有限公司 A kind of method of key upgrading embedded system firmware
CN109189451A (en) * 2018-10-25 2019-01-11 京信通信系统(中国)有限公司 A kind of firmware upgrade method and device
CN109671229A (en) * 2019-01-31 2019-04-23 环胜电子(深圳)有限公司 The method of cashing machine and its safety verification
CN109857356A (en) * 2019-02-15 2019-06-07 青岛海信移动通信技术股份有限公司 A kind of screen display method, electronic equipment and storage medium
CN110309018A (en) * 2019-07-02 2019-10-08 深圳市小兔充充科技有限公司 Charging equipment system switching method, charging equipment and readable storage medium storing program for executing
CN110389774A (en) * 2018-04-16 2019-10-29 英飞凌科技股份有限公司 Restored using the low-power equipment of backup firmware image
CN110737449A (en) * 2019-08-23 2020-01-31 上海商米科技集团股份有限公司 Method, apparatus, and machine-readable storage medium for processing device firmware
WO2020118639A1 (en) * 2018-12-13 2020-06-18 深圳市大疆软件科技有限公司 Unmanned aerial vehicle and firmware upgrade method thereof
CN111316235A (en) * 2019-03-29 2020-06-19 深圳市大疆创新科技有限公司 Method for starting system, electronic device and machine-readable storage medium
CN112015447A (en) * 2020-08-10 2020-12-01 上海高仙自动化科技发展有限公司 System updating method and device for electronic equipment, electronic equipment and storage medium
CN112230959A (en) * 2020-10-16 2021-01-15 广州极飞科技有限公司 Battery firmware processing method and device, intelligent battery and storage medium
CN112612524A (en) * 2020-12-22 2021-04-06 西人马(西安)测控科技有限公司 Method, device and equipment for starting Linux system and storage medium
CN114422356A (en) * 2022-01-19 2022-04-29 中国电子科技集团公司第五十四研究所 Method for switching firmware of skynet module
TWI797932B (en) * 2021-12-30 2023-04-01 新唐科技股份有限公司 Firmware verification system and firmware verification method
TWI819930B (en) * 2022-12-21 2023-10-21 新唐科技股份有限公司 Automatic firmware switching method and electrical device using the same
US11894977B1 (en) * 2022-10-24 2024-02-06 Dell Products L.P. Hardware drift determination and remediation
CN117971283A (en) * 2024-03-28 2024-05-03 深流微智能科技(深圳)有限公司 Firmware upgrading method of graphic processor, terminal equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1495610A (en) * 2002-09-13 2004-05-12 国际商业机器公司 Method and device for firmware renewal
CN1924821A (en) * 2005-08-31 2007-03-07 明基电通股份有限公司 Firmware renewing system and method
CN101055526A (en) * 2006-04-14 2007-10-17 英保达股份有限公司 Method and system for firmware update using digital broadcasting system
CN101526903A (en) * 2008-03-07 2009-09-09 鸿富锦精密工业(深圳)有限公司 Communication device and method for updating firmware thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1495610A (en) * 2002-09-13 2004-05-12 国际商业机器公司 Method and device for firmware renewal
CN1924821A (en) * 2005-08-31 2007-03-07 明基电通股份有限公司 Firmware renewing system and method
CN101055526A (en) * 2006-04-14 2007-10-17 英保达股份有限公司 Method and system for firmware update using digital broadcasting system
CN101526903A (en) * 2008-03-07 2009-09-09 鸿富锦精密工业(深圳)有限公司 Communication device and method for updating firmware thereof

Cited By (28)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104572217A (en) * 2015-01-27 2015-04-29 广东欧珀移动通信有限公司 Updating method and system of wearable intelligent device
CN104765628A (en) * 2015-03-10 2015-07-08 惠州Tcl移动通信有限公司 Method and system for updating touch screen firmware of movable terminal
CN107924443A (en) * 2015-07-23 2018-04-17 菲尼克斯电气公司 Firmware upgrade method and its system for the control device of process control
CN107924443B (en) * 2015-07-23 2021-08-10 菲尼克斯电气公司 Firmware upgrading method and system for process control device
CN106484469B (en) * 2016-09-29 2019-07-02 广州芯德通信科技股份有限公司 A kind of embedded system data processing method and its device
CN106484469A (en) * 2016-09-29 2017-03-08 广州芯德通信科技股份有限公司 A kind of embedded system data processing method and its device
CN110389774B (en) * 2018-04-16 2023-10-27 英飞凌科技股份有限公司 Electronic equipment, tire pressure monitoring system and method
CN110389774A (en) * 2018-04-16 2019-10-29 英飞凌科技股份有限公司 Restored using the low-power equipment of backup firmware image
CN108595199A (en) * 2018-04-19 2018-09-28 济南浪潮高新科技投资发展有限公司 A kind of method of key upgrading embedded system firmware
CN109189451A (en) * 2018-10-25 2019-01-11 京信通信系统(中国)有限公司 A kind of firmware upgrade method and device
WO2020118639A1 (en) * 2018-12-13 2020-06-18 深圳市大疆软件科技有限公司 Unmanned aerial vehicle and firmware upgrade method thereof
CN109671229A (en) * 2019-01-31 2019-04-23 环胜电子(深圳)有限公司 The method of cashing machine and its safety verification
CN109671229B (en) * 2019-01-31 2022-01-25 环旭(深圳)电子科创有限公司 Cash register and safety verification method thereof
CN109857356A (en) * 2019-02-15 2019-06-07 青岛海信移动通信技术股份有限公司 A kind of screen display method, electronic equipment and storage medium
WO2020199027A1 (en) * 2019-03-29 2020-10-08 深圳市大疆创新科技有限公司 Method for starting system, electronic device, and machine readable storage medium
CN111316235A (en) * 2019-03-29 2020-06-19 深圳市大疆创新科技有限公司 Method for starting system, electronic device and machine-readable storage medium
CN110309018A (en) * 2019-07-02 2019-10-08 深圳市小兔充充科技有限公司 Charging equipment system switching method, charging equipment and readable storage medium storing program for executing
CN110309018B (en) * 2019-07-02 2022-03-01 深圳市小兔充充科技有限公司 Charging equipment system switching method, charging equipment and readable storage medium
CN110737449A (en) * 2019-08-23 2020-01-31 上海商米科技集团股份有限公司 Method, apparatus, and machine-readable storage medium for processing device firmware
CN112015447A (en) * 2020-08-10 2020-12-01 上海高仙自动化科技发展有限公司 System updating method and device for electronic equipment, electronic equipment and storage medium
CN112015447B (en) * 2020-08-10 2024-03-22 上海高仙自动化科技发展有限公司 System updating method and device of electronic equipment, electronic equipment and storage medium
CN112230959A (en) * 2020-10-16 2021-01-15 广州极飞科技有限公司 Battery firmware processing method and device, intelligent battery and storage medium
CN112612524A (en) * 2020-12-22 2021-04-06 西人马(西安)测控科技有限公司 Method, device and equipment for starting Linux system and storage medium
TWI797932B (en) * 2021-12-30 2023-04-01 新唐科技股份有限公司 Firmware verification system and firmware verification method
CN114422356A (en) * 2022-01-19 2022-04-29 中国电子科技集团公司第五十四研究所 Method for switching firmware of skynet module
US11894977B1 (en) * 2022-10-24 2024-02-06 Dell Products L.P. Hardware drift determination and remediation
TWI819930B (en) * 2022-12-21 2023-10-21 新唐科技股份有限公司 Automatic firmware switching method and electrical device using the same
CN117971283A (en) * 2024-03-28 2024-05-03 深流微智能科技(深圳)有限公司 Firmware upgrading method of graphic processor, terminal equipment and storage medium

Similar Documents

Publication Publication Date Title
CN102339227A (en) Multi-firmware embedded system and firmware update method thereof
CN101281469B (en) Embedded type system and start-up load application method
CN100456246C (en) Method and device for updating firmware program
CN101589592B (en) Multi-protocol removable storage device
US6904457B2 (en) Automatic firmware update of processor nodes
TW454147B (en) Recoverable software installation process and apparatus for a computer system
CN102289397B (en) Method and device for automatically restoring embedded system of set top box
CN103136012B (en) Computer system and update method of basic input-output system thereof
CN102301573B (en) Photovoltaic plant having a plurality of inverters, inverter, usb mass storage device and method for carrying out software updates on inverters
CN105094927B (en) A kind of device firmware upgrade method and apparatus
KR100952585B1 (en) Method and system for automatic recovery of an embedded operating system
CN103455354A (en) Method and equipment for preventing hardware update from failing
CN102110000A (en) Method, device and equipment for controlling software for auto-updating
US7085884B2 (en) System and method for storing operational data of a storage automation device to a removable nonvolatile memory component
CN101719072A (en) Embedded type terminal equipment software upgrading method and upgrading device
CN101667128B (en) Method for updating and repairing basic input and output system
CN102929665B (en) For the system of drive installation
CN102426531A (en) Intelligent terminal and application program updating system and method
CN105653405B (en) A kind of fault handling method and system of Generic Bootstrap
CN103970564A (en) Automatic repairing and upgrading method of embedded operating system and embedded operating system with automatic repairing and upgrading functions
CN103092659A (en) Digital signal processor (DSP) software upgrading system and upgrading method separated from support environment of emulator
CN103514065A (en) Electronic device with automatic detection and recovery function and method
CN106775674B (en) Equipment based on universal boot loader and starting method thereof
CN103577214A (en) Method and device for updating application program
CN100395713C (en) Method of automatic repairing basic input output system element and module

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20120201