CN1200341C - Method for realizing flush type system firmware program online updating - Google Patents

Method for realizing flush type system firmware program online updating Download PDF

Info

Publication number
CN1200341C
CN1200341C CN 02121474 CN02121474A CN1200341C CN 1200341 C CN1200341 C CN 1200341C CN 02121474 CN02121474 CN 02121474 CN 02121474 A CN02121474 A CN 02121474A CN 1200341 C CN1200341 C CN 1200341C
Authority
CN
China
Prior art keywords
program
firmware program
firmware
upgrade
storage
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.)
Expired - Fee Related
Application number
CN 02121474
Other languages
Chinese (zh)
Other versions
CN1464386A (en
Inventor
王利民
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Lenovo Beijing Ltd
Original Assignee
Lenovo Beijing 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 Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Priority to CN 02121474 priority Critical patent/CN1200341C/en
Publication of CN1464386A publication Critical patent/CN1464386A/en
Application granted granted Critical
Publication of CN1200341C publication Critical patent/CN1200341C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

The present invention discloses a method for realizing firmware program on-line upgrade in an embedded type system. In the method, a firmware program supporting on-line upgrade is separated from a system function firmware program, and the firmware program supporting the on-line upgrade is stored in permanent residence space of a program memory; afterwards, the system is electrified to be started, the firmware program supporting the on-line upgrade is directly transferred to be executed, after the firmware program supporting the on-line upgrade initializes necessary hardware resources, whether the on-line upgrade is to be implemented is determined, and if the on-line upgrade is to be implemented, instruction codes which upgrade the system function firmware program and write the upgrading firmware program into the program memory are stored in a dynamic memory; the instruction codes in the dynamic memory are transferred to, and the upgrading firmware program is written into address space beyond the permanent residence space in the program memory. The present invention provides a universal firmware on-line upgrade method independent of a hardware platform.

Description

The implementation method of firmware program on-line upgrading in the embedded system
Technical field
The present invention relates to computer software technical field, specifically, relate to the implementation method of firmware program on-line upgrading in a kind of embedded system.
Background technology
Along with the develop rapidly of computer software technology and perfect, the increasing function of embedded system need realize by software, so that embedded system realizes different functions on the general hardware platform.Firmware (Firmware) is the software systems of embedded system, has the characteristic of typical hardware and software concurrently, and as alterability, portability, it runs on certain hardware platform, realizes the major function of embedded system.
Referring to shown in Figure 1.The hardware configuration of embedded system generally comprises CPU/ASIC special IC 10, standard communication interface 11, program storage 12, actuator interface 13, the dynamic storage of being made up of CPU and special IC (ASIC) (DRAM) 14, wherein CPU/ASIC special IC 10 is core components of embedded system, and it finishes execution work, data processing, the transmission of information and the control function of operation of Firmware software; Program storage 12 is deposited the instruction code and the related data of Firmware application program, and this program storage is generally flash memory (FlashROM), perhaps scratch pad memory; Dynamic storage 14 is used for store data, and wherein data can be lost after system's power down; Standard communication interface 11 provides the standard traffic passage of an embedded system and external system, and different with different embedded systems, for example in printer system, it can be standard parallel port, USB (universal serial bus) mouth (USB) or the like; Actuator interface 13 be system finish specific function and with the connecting interface of topworks.
Along with the computer software performance improve constantly and perfect, the Firmware software systems of embedded system also need to bring in constant renewal in the replacement to adapt to new application demand, and the Firmware software systems of embedded system support that online upgrading becomes an essential function gradually.
The online upgrading of Firmware software systems is meant that system can start under the running status, obtain the Firmware code of upgrading from the outside by standard communication, and its form is according to the rules write FlashROM, and then system can carry out the program code after the upgrading.
The Firmware software systems online upgrading of embedded system can cooperate relevant upgrade software to realize by the hardware system support usually.Degree of support according to hardware system, the system that realizes Firmware software systems online upgrading can be divided into two classes, one class is under the degree of support condition with higher of hardware system, hardware system has directly been finished the initial work of system's necessity when starting, just give Firmware application program control then, the Firmware application program is directly finished the function of online upgrading on this basis.The online upgrading process of this mode can be interrupted at any time, and then can carry out the online upgrading operation again, the online upgrading process is to be perfectly safe reliably, can not cause system crash because of illegal the interruption, and promptly hardware system can still normally start when the Firmware application crash.Therefore, this mode needs hardware supported degree height, generally has special-purpose CPU.
An other class is under the lower situation of the degree of support of hardware system, hardware system is directly given Firmware application program control when starting, finish the initial work of system's necessity by the Firmware application program, this hardware system versatility is stronger, generally has general CPU.It is as follows that it carries out the online upgrading process:
System's electrifying startup, go to the firmware program of supporting online upgrading from system program, this program is a upstate with standard communication interface and DRAM and other necessary hardware initializing resources, then judge whether to carry out the online upgrading of Firmware, if do not need then to withdraw from the firmware program of supporting online upgrading, enter system's normal procedure, otherwise, be downloaded in the dynamic storage with the Firmware program of upgrading with to the instruction code that program storage writes this upgrading Firmware program, by carrying out the instruction code that writes upgrading Firmware program to program storage, take over original Firmware application program, make the instruction code in the dynamic storage obtain control, Firmware program write-in program storer with upgrading, refresh original Firmware program, then, give the Firmware program of having upgraded in the program storage after upgrading control once more, enter the normal operational scheme of system again.
By above process as seen, the Firmware software program is one section continuous instruction code, support the firmware program of online upgrading and code not strict differentiation on the memory address space of program storage of other systemic-function part, suitable association is arranged, if break down when Firmware debugging or operation, for example, error code takes place writing to program storage in the upgrading Firmware program implementation process, phenomena of the failure such as interruption, perhaps the unexpected power down of DRAM causes the program that is stored in wherein to be lost in the escalation process, the address space that perhaps writes FlashROM makes a mistake, even only owing to other systemic-function code partly breaks down, the capital causes system normally to start or to crash, thereby cause system deadlock, this moment, the online upgrading function just had no chance to play a role at all, and can be fallen by accidental destruction.
Therefore, under the lower situation of the degree of support of hardware system, when Firmware collapsed, total system promptly collapsed, and can't normally finish its function, comprised online upgrade function; And system can not interrupt in the process of Firmware upgrading, otherwise can cause the system crash deadlock, thereby online upgrading is insecure, and when phenomenons such as Firmware software generation deadlock, system also can collapse.
Summary of the invention
The object of the present invention is to provide the implementation method of firmware on line upgrading in a kind of embedded system, under the lower situation of the degree of support of hardware system, realize the reliable online upgrading of Firmware.
The present invention is achieved by the following technical solutions:
The implementation method of firmware program on-line upgrading in a kind of embedded system, this method comprises at least:
A. will support the firmware program of online upgrading to separate, and will support the firmware program of online upgrading to be stored in the permanent staying space that is arranged on program storage with the firmware program of systemic-function;
B. behind system's electrifying startup, directly go to and carry out the firmware program of supporting online upgrading, support the firmware program initialization necessary hardware resource of online upgrading, judge whether to carry out online upgrading, if, then execution in step C and D successively, otherwise, go to and carry out the firmware program of realizing systemic-function;
C. with the firmware program of upgrade-system function, after the instruction code that program storage writes the firmware program of upgrade-system function is stored in the dynamic storage, go to carry out to be stored in and write the instruction code of the firmware program of upgrade-system function to program storage in the dynamic storage;
D. in the dynamic storage to the instruction code of firmware program that program storage writes the upgrade-system function with the firmware program write-in program storer of upgrade-system function in address space outside the permanent staying space, go to the firmware program of executive system function, finish online upgrading.
Wherein, be provided with the described permanent staying space of steps A the firmware program of the middle systemic-function of program storage use less than address space, preferably, the most significant end address space of the described permanent staying space program storage of steps A is set, and the plot of the firmware program of the described upgrade-system function of step C is less than the start address of permanent staying space in the program storage.
Further, the described hardware resource initialization of step B comprises the initialization of dynamic storage, the initialization of standard communication interface at least.The firmware program of the described upgrade-system function of step C is downloaded to dynamic storage by standard communication interface, the described instruction code that writes the firmware program of upgrade-system function to program storage downloads in the dynamic storage by standard communication interface, perhaps is copied to dynamic storage from program storage.Described program storage is a flash memory, perhaps is scratch pad memory.
Firmware on line upgrading implementation method in the embedded system provided by the present invention, make the online upgrading program separate with the Firmware software program of realizing systemic-function, make when accident is interrupted in Firmware software program existing problems that realize systemic-function or the online upgrading process, the online upgrading program still can be worked or operate again as usual, for a kind of embedded system Firmware online upgrading method that is independent of hardware platform and concrete applied environment is provided, has higher independence under the lower situation of hardware system degree of support, reliability, versatility.
Write the instruction code of upgrading Firmware program by upgrading Firmware program that receive to download from the standard traffic port and to program storage, make this instruction code take over control system; Also the data and the code that can replace with specific use to the upgrading Firmware program of downloading and above-mentioned instruction code carried out special operation by this code to the adapter of system, can make system have better extensibility.
Use method provided by the present invention, make the Firmware software function of embedded system not only can upgrade by the personnel of designing and developing, and domestic consumer can carry out long-range online upgrading operation voluntarily by the Firmware software download facilities under the guidance of operation instruction, in addition, for the personnel of designing and developing also provide a lot of convenience in the development phase of the Firmware of system, has better convenience.
Description of drawings
Fig. 1 is the embedded system hardware structural drawing.
Fig. 2 is the implementation procedure synoptic diagram of embodiment of the invention online upgrading software.
Fig. 3 is under the lower situation of the degree of support of hardware system, the process flow diagram of online upgrading.
Embodiment
For make purpose of the present invention, technical scheme, and advantage clearer, below with reference to the accompanying drawing embodiment that develops simultaneously, the present invention is described in more detail.
The present invention adopts the method for separate type online upgrading software, that is to say, and is with realizing the Firmware program part of systemic-function and supporting the Firmware program part of online upgrading thoroughly to separate on structure, independent fully between the two.Simultaneously, the Firmware program of supporting online upgrading is simplified the degree of simplifying most, reduce the factor that it is made mistakes, and the firmware program that is located systemic-function in program storage use less than address space, for example on the specific address space of the afterbody of program storage, promptly reside in this space, address, this sector address space only just can be arrived by the CPU read access when carrying out the online upgrading function.Further; in order to guarantee that this section Firmware program do not fallen by accidental destruction, also need special protection is done in this sector address space, therefore; in the instruction code that writes upgrading Firmware program to program storage, the address realm that writes should not comprise this sector address space.
Like this, support the Firmware program part of online upgrading to be responsible for the DRAM initialization of hardware system, the initialization of standard communication interface earlier, and other necessary hardware initializing resource work; Judge whether then to carry out online upgrading, if the Firmware program of download and upgrade and write the instruction code of upgrading Firmware program to program storage then, and store dram space into; At last control is given the instruction code that writes upgrading Firmware program to program storage, with Firmware program write-in program storage space with upgrading.
The instruction code that writes upgrading Firmware program to program storage be dynamic download in system dram, can customize its function and operation voluntarily by the deviser.Key is that the address space of its write-in program storer must guarantee not comprise the occupied address space of Firmware program part of above-mentioned support online upgrading.
Be exclusively used in the permanent staying space that online upgrading Firmware program is supported in storage by in program storage, being provided with, guaranteed that above-mentioned support online upgrading Firmware program is modified never, unless chip generation physical damage.When the Firmware software program of realizing systemic-function breaks down or moves deadlock, even when accidental interruption situation such as power down takes place in the online escalation process, online upgrading Firmware program in the above-mentioned permanent staying space is still intact, can finish the initial work of system start-up, necessity and support Firmware online upgrading function.
Be that example illustrates application of the present invention with a kind of laser printer control card system below.
In laser printer control card system, PowerPC is a kind of very common CPU that embedded system adopted, adopted a special ASIC to realize special printing, its standard communication interface is the standard parallel port in addition, can link to each other with the parallel port of PC, program storage is FlashROM.In order to realize system's online upgrading function, Firmware software need among the initialization ASIC dram controller with and standard communication interface, and it is initialized as simple working pattern to simplify code.
Referring to shown in Figure 2, Fig. 2 is the implementation procedure synoptic diagram of embodiment of the invention online upgrading software.In the drawings, the FlashROM medium square partly is permanent staying space, stored and supported online upgrade software, left oblique line partly is the part that its content will be refreshed during the online upgrading among the FlashROM, for guaranteeing that refreshing part does not cover permanent staying space, can be provided with the start address that the upgrading Firmware program plot that writes is positioned permanent staying space among the FlashROM; Right oblique line has partly been stored upgrading Firmware program of downloading and the instruction code that writes upgrading Firmware program to FlashROM among the DRAM.
Referring to shown in Figure 3, Fig. 3 is under the lower situation of the degree of support of hardware system, the online upgrading process flow diagram of Firmware program.Its implementation procedure is such:
A. system's electrifying startup, system program directly jumps to the permanent staying space place of the online ROMPaq of support (among Fig. 2 from program entry, process 20), execution in step 301,302,303 supports that online ROMPaq is a upstate with standard communication interface and DRAM and other necessary hardware initializing resources;
B. execution in step 304, support that online ROMPaq is finished necessary initial work after, judge whether the user wants to enter online upgrading, if do not carry out updating operation, then execution in step 307, and directly redirect is returned normal program circuit (among Fig. 2, process 21), enter the normal operational scheme of executive system; Otherwise, execution in step C;
C. execution in step 305,306, write the instruction code of this upgrading Firmware program by the standard parallel port from the Firmware program of PC main frame download and upgrade and to FlashROM, and store among the DRAM.
The above-mentioned instruction code that writes this upgrading Firmware program to FlashROM can obtain by the standard traffic port, deposits among the DRAM of system, also can copy among the DRAM from FlashROM.Because the write operation method difference of the FlashROM of different model, therefore the latter can only carry out the online upgrading operation at a certain pre-specified FlashROM chip model, and the former can be by the wiring method code of standard traffic port acquisition at the FlashROM chip model of various needs, and dirigibility is better.
D. jump to and stored the place, address (among Fig. 2, process 22) of dram space that writes the instruction code of upgrading Firmware program to FlashROM, execution in step 308 writes the corresponding address space of FlashROM with the Firmware program of upgrading;
E. after finishing online upgrading work, rerun the Firmware program after the renewal, promptly jump to the Firmware porch after the upgrading, the Firmware normal flow (among Fig. 2, process 23) after operation is upgraded.
The present invention will support the program of online upgrading part thoroughly to separate with the Firmware program part of realizing systemic-function among the Firmware, making it does not have correlativity, and make Firmware program itself not need to consider the online upgrading process again, a universal method that is independent of hardware platform and concrete environment of applications is provided.The program of supporting the online upgrading part among the Firmware is forever resided at the specific address space of FlashROM, and it is very little to take up room, to system without any influence, and make and support among the Firmware program of online upgrading part in escalation process, not to be modified, guaranteed that escalation process can repeatedly carry out again, has improved the security of system.The instruction code that writes upgrading Firmware program to FlashROM by the standard parallel port from PC main frame dynamic download to DRAM, can dynamically select the model of employed FlashROM chip according to different system applies, use very flexible.
Above embodiment is the unrestricted technical scheme of the present invention in order to explanation only, although the present invention is had been described in detail with reference to the foregoing description, those of ordinary skill in the art is to be understood that: still can make amendment or be equal to replacement the present invention, and not breaking away from any modification or partial replacement of the spirit and scope of the present invention, it all should be encompassed in the middle of the claim scope of the present invention.

Claims (7)

1, the implementation method of firmware program on-line upgrading in a kind of embedded system is characterized in that this method comprises at least:
A. will support the firmware program of online upgrading to separate, and will support the firmware program of online upgrading to be stored in the permanent staying space that is arranged on program storage with the firmware program of realizing systemic-function;
B. behind system's electrifying startup, directly go to and carry out the firmware program of supporting online upgrading, support the firmware program initialization necessary hardware resource of online upgrading, judge whether to carry out online upgrading, if, then execution in step C and D successively, otherwise, go to and carry out the firmware program of realizing systemic-function;
C. with the firmware program of upgrade-system function, after the instruction code that program storage writes the firmware program of upgrade-system function is stored in the dynamic storage, go to carry out to be stored in and write the instruction code of the firmware program of upgrade-system function to program storage in the dynamic storage;
D. in the dynamic storage to the instruction code of firmware program that program storage writes the upgrade-system function with the firmware program write-in program storer of upgrade-system function in address space outside the permanent staying space, go to the firmware program of carrying out the upgrade-system function, finish online upgrading.
2, implementation method according to claim 1 is characterized in that, the most significant end address space of the described permanent staying space of steps A at program storage is set.
3, implementation method according to claim 2 is characterized in that, the start address of the firmware program plot of the described upgrade-system function of step C less than permanent staying space in the program storage is set.
According to claim 1,2 or 3 described implementation methods, it is characterized in that 4, the described hardware resource initialization of step B comprises the initialization of dynamic storage, the initialization of standard communication interface at least.
According to claim 1,2 or 3 described implementation methods, it is characterized in that 5, the firmware program of the described upgrade-system function of step C is downloaded to dynamic storage by standard communication interface.
6, according to claim 1,2 or 3 described implementation methods, it is characterized in that, the described instruction code that writes the firmware program of upgrade-system function to program storage of step C downloads in the dynamic storage by standard communication interface, perhaps is copied to dynamic storage from program storage.
According to claim 1,2 or 3 described implementation methods, it is characterized in that 7, described program storage is a flash memory, perhaps is scratch pad memory.
CN 02121474 2002-06-25 2002-06-25 Method for realizing flush type system firmware program online updating Expired - Fee Related CN1200341C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 02121474 CN1200341C (en) 2002-06-25 2002-06-25 Method for realizing flush type system firmware program online updating

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 02121474 CN1200341C (en) 2002-06-25 2002-06-25 Method for realizing flush type system firmware program online updating

Publications (2)

Publication Number Publication Date
CN1464386A CN1464386A (en) 2003-12-31
CN1200341C true CN1200341C (en) 2005-05-04

Family

ID=29742990

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 02121474 Expired - Fee Related CN1200341C (en) 2002-06-25 2002-06-25 Method for realizing flush type system firmware program online updating

Country Status (1)

Country Link
CN (1) CN1200341C (en)

Families Citing this family (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100346299C (en) * 2004-01-05 2007-10-31 华硕电脑股份有限公司 Firmware update treating method and application
CN100370431C (en) * 2004-08-16 2008-02-20 上海华为技术有限公司 Method and system for monitoring embedded system on line
TWI275019B (en) 2004-12-09 2007-03-01 Lite On Technology Corp Embedded system and related method capable of automatically updating system software
CN100375959C (en) * 2004-12-28 2008-03-19 光宝科技股份有限公司 Equipment and method of system software capable of updating embedded type system automatically
CN100340982C (en) * 2005-03-03 2007-10-03 中兴通讯股份有限公司 After-error recovery method of transmission equipment card software on-line update
CN100371908C (en) * 2005-05-10 2008-02-27 展讯通信(上海)有限公司 Method for correcting ROM code in embedded system
CN100371909C (en) * 2005-05-10 2008-02-27 展讯通信(上海)有限公司 Method for correcting ROM code in embedded system
CN100405297C (en) * 2005-05-18 2008-07-23 鸿富锦精密工业(深圳)有限公司 Updating method for preset value initial setting program of embedded system
CN100384122C (en) * 2005-05-25 2008-04-23 深圳创维数字技术股份有限公司 On-line promotion method for network terminal product
CN100424644C (en) * 2005-12-30 2008-10-08 北京华旗资讯数码科技有限公司 Firmware program on-line upgrading method and hardware equipment
CN100386728C (en) * 2006-03-24 2008-05-07 清华大学 On-line software updating method of implantation medical equipment
CN101355434B (en) * 2007-07-24 2012-03-07 中兴通讯股份有限公司 Method and apparatus for upgrading software of multimedia remote terminal
US8122445B2 (en) * 2007-08-24 2012-02-21 Mediatek Inc. Processing system capable of downloading firmware code and being tested at same site during MP phase
CN102270147A (en) * 2010-12-31 2011-12-07 北京谊安医疗***股份有限公司 Method and device for field upgrading of anaesthesia machine software
CN103064692A (en) * 2011-10-19 2013-04-24 北京市三希电子科技开发公司 Firmware update method and firmware update device
JP5653568B1 (en) * 2013-12-03 2015-01-14 三菱電機株式会社 Network system
CN105094877B (en) * 2014-05-21 2018-09-25 炬芯(珠海)科技有限公司 The method and host-side device and system of a kind of firmware upgrade
CN105573766A (en) * 2014-10-09 2016-05-11 中兴通讯股份有限公司 Software upgrading method and device and electronic equipment
CN106155715A (en) * 2015-03-30 2016-11-23 北京自动化控制设备研究所 A kind of software based on real-time MCU guides curing
CN105988851A (en) * 2015-05-15 2016-10-05 乐视致新电子科技(天津)有限公司 Terminal setting method and device
CN104965744A (en) * 2015-07-10 2015-10-07 上海斐讯数据通信技术有限公司 System upgrading method and embedded system
CN107506208A (en) * 2017-07-14 2017-12-22 广州慧睿思通信息科技有限公司 A kind of anti-DSP firmware on line upgrading methods burnt to death of equipment
CN114780122A (en) * 2022-04-11 2022-07-22 乐鑫信息科技(上海)股份有限公司 Embedded equipment firmware updating method and embedded equipment

Also Published As

Publication number Publication date
CN1464386A (en) 2003-12-31

Similar Documents

Publication Publication Date Title
CN1200341C (en) Method for realizing flush type system firmware program online updating
CN1258702C (en) Method for communication between firmware written for different instruction set architectures
CN1273891C (en) Method for atomically updating a plurality of files
US7702894B2 (en) System and method for loading programs from HDD independent of operating system
CN100543677C (en) The system and method for simulation real-mode memory access with access to extended memory
CN1506813A (en) Reliably and safelf refreshing and recovering firmware from large scale memory equipment
CN1330324A (en) Data processing unit and method for controlling overwrited by non-volatility storage device
WO2000019317A1 (en) Protection of boot block code while allowing write accesses to the boot block
TW200414042A (en) Firmware architecture supporting safe updates and multiple processor types
CN103365696A (en) BIOS (Basic Input Output System) image file obtaining method and device
US20060294298A1 (en) System and method for protecting hidden protected area of HDD during operation
CN1469256A (en) Safe memory element and its manufacture
CN111258666A (en) Reading method and device of computer file, computer system and storage medium
US6490668B2 (en) System and method for dynamically moving checksums to different memory locations
CN1786910A (en) BIOS on-line upgrading method
CN1040156C (en) Multi-mode microprocessor with electrical pin for selective re-initial ization of processor state
EP3028141B1 (en) Generating a second code from a first code
CN115033267A (en) Method for verifying equipment tree mirror image version and terminal equipment
CN1818824A (en) High-reliable personal computer and operating system thereof
CN101295274B (en) Method and equipment for reducing data error of shared memory
US7882353B2 (en) Method for protecting data in a hard disk
CN1294481C (en) Method for updating and recovering system by bootstrap program
US20220147343A1 (en) Tranistionary firmware packages
JP2010282645A (en) Linux program start-up system
US6665830B2 (en) System and method for building a checksum

Legal Events

Date Code Title Description
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20050504

Termination date: 20210625

CF01 Termination of patent right due to non-payment of annual fee