WO2012071852A1 - Procédé et dispositif pour mettre à niveau un programme d'amorçage - Google Patents

Procédé et dispositif pour mettre à niveau un programme d'amorçage Download PDF

Info

Publication number
WO2012071852A1
WO2012071852A1 PCT/CN2011/073917 CN2011073917W WO2012071852A1 WO 2012071852 A1 WO2012071852 A1 WO 2012071852A1 CN 2011073917 W CN2011073917 W CN 2011073917W WO 2012071852 A1 WO2012071852 A1 WO 2012071852A1
Authority
WO
WIPO (PCT)
Prior art keywords
boot
program
boot program
booting
area
Prior art date
Application number
PCT/CN2011/073917
Other languages
English (en)
Chinese (zh)
Inventor
陈久松
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2012071852A1 publication Critical patent/WO2012071852A1/fr

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping

Definitions

  • the present invention relates to the field of communications, and in particular to a method and apparatus for upgrading a bootloader.
  • the bootloader (BOOTROM) was generally a write-once read-only memory (ROM or FLASH), regardless of online upgrades.
  • ROM read-only memory
  • FLASH write-once read-only memory
  • embedded devices are beginning to support online upgrades of I-guide programs.
  • the schemes currently used by embedded devices that support I-guided program upgrades generally have the following in common:
  • the bootloader address is switched by hardware and can be controlled by the bootloader.
  • the third feature above shows that the current dual bootloader or multibooter upgrade scheme requires the ability of the hardware to provide address switching.
  • the reason for this requirement for hardware is that the embedded I program must specify the address at which it is run at compile time. After the boot program is compiled, it must be stored at the correct address. This way in the general upgrade scenario, both bootloaders need to run at an address. Therefore, it is necessary to introduce hardware to provide address switching to solve: Which boot program is selected to work, and the storage area where the boot program is located is switched to the correct address. This type of solution has increased hardware complexity due to special hardware requirements, and applications are also limited.
  • the present invention has been made in view of the problems in the related art that both the first boot program and the second boot program need to be run at one address to introduce hardware to provide address switching.
  • the main object of the present invention is to provide a boot program. Upgrade methods and devices to solve the above problems.
  • a method of upgrading a boot program is provided.
  • the upgrade method of the boot program according to the present invention includes: dividing a first boot program area and a second boot program area in the erasable memory, wherein the first boot program area stores a first boot program for normal boot, and second A second boot program to be upgraded is stored in the boot program area; it is determined that the booting is successful using the second boot program; and the second boot program is determined to be the upgraded I boot program.
  • the start address of the first boot program is the position where the first boot program area starts, and the start address of the second boot program is the position where the second boot program area starts.
  • the method further includes: determining whether the version number of the second boot program is higher than the version number of the first boot program; if the determination result is yes, booting using the second boot program.
  • the method further includes: determining whether a boot failure flag corresponding to the second boot program is set, wherein the boot failure flag is used to indicate that the boot failure is performed using the second boot program; , then boot using the second bootloader.
  • the method further includes: determining whether a boot wait flag corresponding to the second boot program is set, wherein the boot wait flag is used to indicate waiting for booting using the second boot program; if the determination result is yes, A boot progress flag corresponding to the second boot program is set, wherein the boot progress flag is used to indicate that the booting is being performed using the second boot program.
  • the method further includes: determining whether a boot progress flag corresponding to the second boot program is set, wherein the boot progress flag is used to indicate that the booting is being performed using the second boot program; if the determination result is yes, Then, a boot failure flag corresponding to the second boot program is set, wherein the boot failure flag is used to indicate that the boot failure is performed using the second boot program.
  • the method further includes: restarting and booting using the first boot program.
  • the method further includes: determining whether a boot progress flag corresponding to the second boot program is set, wherein the boot progress flag is used to indicate that the booting is being performed using the second boot program; Yes, a boot success flag corresponding to the second boot program is set, wherein the boot success flag is used to indicate that the boot is successful using the second boot program.
  • the first bootloader area and the second bootloader area are both 512KBytes.
  • the upgrading apparatus of the boot program includes a dividing module configured to divide the first boot program area and the second boot program area in the erasable memory; the first storage module is configured to be stored in the first boot program area a first booting program for normal booting; a second storage module configured to store a second booting program to be upgraded in the second bootstrapping area; a first determining module configured to determine that the booting is successful using the second booting program; Determine the module, set to determine that the second bootloader is the upgraded bootloader.
  • the first boot program area and the second boot program area each have an unambiguous address, so that the first boot program and the second boot program have mutually different addresses, and the first boot program and the first in the related art are solved.
  • FIG. 1 is a flowchart of a method for upgrading an I-guide program according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram of a file compiling and merging process according to an embodiment of the present invention
  • FIG. 4 is a schematic diagram of a FLASH space division according to an embodiment of the present invention
  • FIG. 5 is a flowchart of a method for online upgrade of a boot program according to an embodiment of the present invention
  • FIG. 6 is a flowchart of the present invention.
  • the embodiment of the invention provides a method for upgrading a boot program.
  • 1 is a flowchart of a method for upgrading a boot program according to an embodiment of the present invention.
  • Step S102 dividing a first boot program area and a second boot program area in the erasable memory, wherein the first boot program area stores a first boot program for normal boot, and the second boot program area stores to be upgraded
  • the second boot program determining that the booting is successful using the second boot program.
  • Step S106 determining that the second boot program is the upgraded boot program.
  • both the first boot program and the second boot program need to run at one address, so that hardware is required to provide address switching.
  • the first boot program area and the second boot program area each have an explicit address, so that the first boot program and the second boot program have mutually different addresses, thereby avoiding the introduction of hardware address switching. Reduce hardware complexity and improve user experience.
  • the above erasable memory may preferably be FLASH.
  • the starting address of the first booting program is the starting position of the first booting program area
  • the starting address of the second booting program is the starting position of the second booting program area.
  • FIG. 2 is a schematic diagram of a file compilation and merge process according to an embodiment of the present invention. As shown in FIG. 2, the file may be compiled and merged through the following first to third steps.
  • the BOOTROM working address (hereinafter referred to as ROM_BASE_ADRS) is designated as the first BOOTROM area start address (hereinafter referred to as ROM_ADRS_lST), and the binary first boot program file (BOOT1.bin) is compiled.
  • the ROM_BASE_ADRS is designated as the start address of the second BOOTROM area (hereinafter referred to as ROM_ADRS_2ND), and the second boot program file (BOOT2.bin) of the binary is compiled.
  • the BOOTROM generated by the two steps on the 4th bar is merged into a binary file boot file (BOOTROM.bin).
  • BOOTl.bin is padded to the beginning of the start address of 0, and BOOT2.bin is padded to the beginning of the start address of 512KBbyte.
  • the BOOTROM area can also be the second BOOTROM area.
  • the second boot program area corresponds to the second BOOTROM area or the first BOOTROM area.
  • the method further includes: determining whether the version number of the second boot program is higher than the version number of the first boot program; if the determination result is yes, using the second boot program guide.
  • the method before determining to use the second boot program to successfully boot, the method further includes: determining whether a boot failure flag corresponding to the second boot program is set, wherein the boot failure flag is used to indicate that the boot failure is performed using the second boot program; If the result is no, the second boot program is used to boot.
  • the method further includes: determining whether a boot wait flag corresponding to the second boot program is set, wherein the boot wait flag is used to indicate that the second boot program is waiting to be used; Yes, a boot progress flag corresponding to the second boot program is set, wherein the boot progress flag is used to indicate that the booting is being performed using the second boot program.
  • the method further includes: determining whether a boot progress flag corresponding to the second boot program is set, wherein the boot progress flag is used to indicate that the booting is being performed using the second boot program; If so, a boot failure flag corresponding to the second boot program is set, wherein the boot failure flag is used to indicate that the boot failure is performed using the second boot program.
  • the method further comprises: restarting and booting using the first boot program.
  • the method further includes: determining whether a boot progress flag corresponding to the second boot program is set, wherein the boot progress flag is used to indicate that the booting is being performed using the second boot program; If the result of the determination is yes, a boot success flag corresponding to the second boot program is set, wherein the boot success flag is used to indicate that the boot is successful using the second boot program.
  • the above selection control of the first I guide program and the second boot program may be implemented by selecting a control program, and the selection control program may be stored in a selection control area divided by the FLASH, and the selection control area may be occupied by itself A FLASH block.
  • the selection control program may include information such as a presence flag, a version number, a trial operation state, and a start address of the first boot program and the second boot program.
  • the trial running states of the first booting program and the second booting program include four values of "waiting for trial running”, “coming trial running”, “trial running successful”, and "trial running failure". The following describes the changes in the trial state of the first boot program and the second boot program in a typical case.
  • test run status After upgrading the BOOTROM online, set the test run status to "waiting for trial run”. 2. When the device starts up, if it finds that the BOOTROM trial running status is "waiting for trial run”, select the BOOTROM to run and change it to "coming run”.
  • FIG. 3 is a flowchart of a method for selecting and controlling a boot program according to an embodiment of the present invention. As shown in FIG. 3, the following steps S302 to S324 are included. Step S302, powering on the basic configuration (in romlnit.s). Step S304, setting a stack pointer (the C function can be called after this step). Step S306, reading the boot selection control area. In step S308, the test run status of the first and second boot program parameter areas is checked, and if it is "coming run", it is changed to "test run failure".
  • Step S310 determining whether the presence flag of the second boot program area is valid, and if yes, proceeding to step S312, otherwise proceeding to step S324.
  • step S312 it is determined whether the second boot program area trial run flag is "waiting for trial run”, and if so, step S314 is performed, otherwise step S316 is performed.
  • step S314 the 4 bar second boot program trial run flag is changed to "coming run”, and then step S322 is performed.
  • step S316 it is determined whether the first boot program area trial run flag is "waiting for trial run", and if so, step S318 is performed, otherwise step S320 is performed.
  • Step S318, determining whether the second boot program area version number is greater than the first area version number, and if yes, proceeding to step S322, otherwise proceeding to step S324.
  • step S320 the 4 bar first boot program trial run flag is changed to "coming run", and then step S324 is performed.
  • the preferred embodiment implements a secure bootable bootloader upgrade based on two bootloaders on the embedded device.
  • both the first boot program area and the second boot program area are 512 KByte.
  • 4 is a schematic diagram of a FLASH space partition according to an embodiment of the present invention. As shown in FIG.
  • the first boot program area, the second boot program area, and the boot select control area are included, wherein the first boot program area and the second The boot program area is 512Kbyte, and the boot selection control area is 128Kbyte.
  • the FLASH needs to be erased first, and then the BootROM.bin file is written into the space of the first bootloader area and the second bootloader area. At this time, since the boot selection control area is empty, the contents of the second boot program area are ignored.
  • the present invention also provides a method of upgrading a boot program online. FIG.
  • Step 4 gathers S502 and upgrades online.
  • Step S504 reading the boot selection control area.
  • Step S506 determining whether the second boot program version number is greater than the first boot program version number, and if yes, proceeding to step S512, otherwise proceeding to step S508.
  • Step S508 the first half of the selection boot file (BOOT.bin file) is written into the first boot program area.
  • Step S510 setting the trial running state of the first booting program to "waiting for trial running", and then proceeding to step S516.
  • step S512 the second half of the boot file (BOOT.bin file) is selected to be written into the second boot program area.
  • Step S514 setting the trial running state of the second booting program to "waiting for trial running”.
  • the boot selection control area select BOOT1.bin or BOOT2.bin from the BOOTROM.bin file to write the corresponding first boot program area or second boot program area, and reset the I lead selection control area.
  • the device uses 64MByte FLASH as the boot chip (selected by the chip select 0 signal).
  • an interval in which the on-chip address is 0 to 512KByte is allocated as the first BOOTROM area in the FLASH, and an area in which the on-chip address is 512K to 1MByte is used as the second BOOTROM area, and the on-chip address is 1M ⁇ (lM+128K) Byte interval.
  • the BOOT selection control area As the BOOT selection control area.
  • the implementations in Figures 3 and 5 are added to the software.
  • the system software is based on the vxWorks system.
  • the BOOT area selection function code is added in the assembly code romlnit.s, the specific position is after initializing the SP pointer and before jumping to the romStart function.
  • the stack pointer is configured to call the C function.
  • the code of this function is implemented by assembly. For example, the status word is read and written, and the complex part is implemented by the C function, such as rewriting the field of "commissioning status".
  • the implementation details are shown in Figure 3.
  • the ROM BASE ADRS specified in Mkbootl is ROM ADRS 1ST
  • the ROM BASE ADRS specified in Mkboot2 is ROM ADRS 2ND.
  • Add a batch file, mkboot.bat which consists of three commands: compile BOOTROM with mkbootl as makefile, compile BOOTROM with mkboot2 as makefile, and merge files.
  • the tool for file merging is written by itself under VC.
  • use the special FLASH online burning tool 4 bar BOOTROM.bin to write to the first BOOTROM area and the second BOOTROM area of the FLASH, without setting the BOOT selection parameter area. After booting, the device boots from the first BootROM area.
  • the device boots from the second BootROM area. This process is a normal upgrade process.
  • the device boots from the first BootROM area. This process is a normal upgrade process.
  • Continue the third upgrade After restarting the device for 10 seconds (this time starting from the second BootROM area), the device restarts again, and the device starts from the first BootROM area.
  • the test status of the second BootROM area is set to "Trial Run”. failure”. This process is a process of upgrade failure and rollback. The usage is exactly as expected.
  • the embodiment of the invention provides an upgrade device for the I-guide program, and the upgrade device of the boot program can be used to implement the upgrade method of the boot program.
  • 6 is a booting program according to an embodiment of the present invention.
  • the structural block diagram of the upgrading apparatus includes a dividing module 61, a first storage module 62, a second storage module 63, a first determining module 64, and a second determining module 65. The structure is described in detail below.
  • the dividing module 61 is configured to divide the first booting program area and the second booting program area in the erasable memory; the first storage module 62 is connected to the dividing module 61, and is disposed in the first booting program area divided by the dividing module 61 Storing a first booting program for normal booting; a second storage module 63, connected to the dividing module 61, configured to store the second booting program to be upgraded in the second bootstrapping area divided by the dividing module 61; The module 64 is connected to the second storage module 63, and is configured to determine that the second boot program stored by the second storage module 63 is successfully booted; the second determining module 65 is connected to the first determining module 64 and the second storage module 63, and is configured to After the first determining module 64 determines that the second boot program is successfully booted, it is determined that the second boot program stored by the second storage module 63 is the upgraded boot program.
  • the above erasable memory may preferably be FLASH.
  • the above embodiment of the present invention provides a method and apparatus for upgrading a boot program. Since the first boot program area and the second boot program area each have an unambiguous address, so that the first boot program and the second boot program have mutually different addresses, the first boot program and the second boot program in the related art are solved. All need to run on an address and need to introduce hardware to provide address switching problem, which can avoid the introduction of hardware address switching, reduce hardware complexity, and improve user experience. It should be noted that the boot program described in the device embodiment is upgraded. The device corresponds to the foregoing method embodiment, and the specific implementation process has been described in detail in the method embodiment, and details are not described herein again.
  • modules or steps of the present invention can be implemented by a general-purpose computing device, which can be concentrated on a single computing device or distributed over a network composed of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device, such that they may be stored in the storage device by the computing device, or they may be separately fabricated into individual integrated circuit modules, or they may be Multiple modules or steps are made into a single integrated circuit module.
  • the invention is not limited to any specific combination of hardware and software.
  • the above is only the preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes can be made to the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the scope of the present invention are intended to be included within the scope of the present invention.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

L'invention concerne un procédé et un dispositif permettant de mettre à niveau un programme d'amorçage. Le procédé comprend les étapes consistant à: segmenter une première zone de programme d'amorçage et une seconde zone de programme d'amorçage dans une mémoire effaçable, la première zone de programme d'amorçage stockant un premier programme d'amorçage servant à mettre en oeuvre un amorçage normal, et la seconde zone programme d'amorçage stockant un second programme d'amorçage devant être mis à niveau (S102); déterminer que le second programme d'amorçage est utilisé pour pouvoir mettre en oeuvre un amorçage (S104); et déterminer que le second programme d'amorçage est le programme d'amorçage mis à niveau (S106). Ce protocole permet d'éviter de devoir introduire des commutateurs d'adresse matérielle, de réduire la complexité matérielle et d'améliorer le confort de l'utilisateur.
PCT/CN2011/073917 2010-12-03 2011-05-11 Procédé et dispositif pour mettre à niveau un programme d'amorçage WO2012071852A1 (fr)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201010572320.6A CN102486733B (zh) 2010-12-03 2010-12-03 引导程序的升级方法和装置
CN201010572320.6 2010-12-03

Publications (1)

Publication Number Publication Date
WO2012071852A1 true WO2012071852A1 (fr) 2012-06-07

Family

ID=46152231

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/073917 WO2012071852A1 (fr) 2010-12-03 2011-05-11 Procédé et dispositif pour mettre à niveau un programme d'amorçage

Country Status (2)

Country Link
CN (1) CN102486733B (fr)
WO (1) WO2012071852A1 (fr)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103677871A (zh) * 2012-09-10 2014-03-26 上海达实联欣科技发展有限公司 在线升级系统及方法
CN104375863A (zh) * 2014-11-17 2015-02-25 张毓 嵌入式系统中一种在线升级程序的方法
CN104699500B (zh) * 2015-01-06 2018-05-08 上海华测导航技术股份有限公司 智能设备中实现引导程序自动升级的方法
CN106257417B (zh) * 2015-06-17 2021-07-20 中兴通讯股份有限公司 引导程序升级方法、嵌入式设备、控制设备及嵌入式系统
CN104978223B (zh) * 2015-07-02 2018-03-30 上海市共进通信技术有限公司 实现Web方式升级设备固件的方法
CN106325911A (zh) * 2015-07-02 2017-01-11 中兴通讯股份有限公司 一种实现bootrom升级的方法及装置
CN106406955A (zh) * 2016-09-22 2017-02-15 深圳市金溢科技股份有限公司 RSU设备bootloader程序升级的方法、装置
CN106484475A (zh) * 2016-10-09 2017-03-08 珠海全志科技股份有限公司 固件启动方法、装置及嵌入式设备
CN106990982B (zh) * 2017-03-20 2021-07-02 北京新能源汽车股份有限公司 程序更新方法及装置
CN107247642B (zh) * 2017-06-27 2020-12-25 青岛智动精工电子有限公司 用于系统开机时确定可执行映像文件的方法及装置

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1786910A (zh) * 2004-12-09 2006-06-14 华为技术有限公司 一种bios在线升级方法
CN1808385A (zh) * 2006-01-20 2006-07-26 北京朗通环球科技有限公司 一种嵌入式系统的引导系统
CN101017441A (zh) * 2007-02-27 2007-08-15 华为技术有限公司 一种电子设备、电子设备的启动方法及bios升级方法

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3694005B2 (ja) * 2003-05-21 2005-09-14 沖電気工業株式会社 デジタル信号処理装置及びデジタル信号処理方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1786910A (zh) * 2004-12-09 2006-06-14 华为技术有限公司 一种bios在线升级方法
CN1808385A (zh) * 2006-01-20 2006-07-26 北京朗通环球科技有限公司 一种嵌入式系统的引导系统
CN101017441A (zh) * 2007-02-27 2007-08-15 华为技术有限公司 一种电子设备、电子设备的启动方法及bios升级方法

Also Published As

Publication number Publication date
CN102486733A (zh) 2012-06-06
CN102486733B (zh) 2015-10-21

Similar Documents

Publication Publication Date Title
WO2012071852A1 (fr) Procédé et dispositif pour mettre à niveau un programme d'amorçage
CN110231952B (zh) 一种ecu程序备份及循环升级控制方法及装置
US6317827B1 (en) Method and apparatus for fault tolerant flash upgrading
CN105027080B (zh) 用于多重启动装置的启动顺序
JP3372964B2 (ja) コンピュータシステム
KR101427755B1 (ko) Usb를 이용한 펌웨어 업그레이드 장치 및 방법
WO2022007656A1 (fr) Procédé et appareil de mise à jour de logiciel chargeur d'amorçage, contrôleur intégré et support de stockage
US20090113196A1 (en) Method and systems for advanced reprogrammable boot codes and in-application programming of embedded microprocessor systems
CN101344854B (zh) 通过SD卡对嵌入式Linux设备进行升级的方法
KR100415371B1 (ko) 컴퓨터
US8595716B2 (en) Failsafe firmware updates
KR20070039841A (ko) 디지털방송처리장치 및 디지털방송처리장치 부트로더의업그레이드 방법
WO2015154538A1 (fr) Procédé et dispositif de démarrage de mémoire
CN101872306B (zh) 一种实现软件更新和软件备份的嵌入式系统及其实现方法
US9367482B2 (en) Systems and methods to extend ROM functionality
CN112445540B (zh) 程序运行方法、系统、终端及存储介质
JP2010218103A (ja) 電子機器
CN113467797B (zh) 程序更新方法、装置和系统以及计算机可读存储介质
JP2011175352A (ja) ファームウエア更新装置、通信装置、電子機器、ファームウエア更新システム、ファームウエア更新方法及びプログラム
CN114968299A (zh) 基于Multiboot设备固件升级及异常处理方法
JP2010117944A (ja) ソフトウェア更新システム、ソフトウェア更新方法、携帯電話端末及びプログラム
KR101113342B1 (ko) 이동통신 단말기의 부트로더 버전 관리 방법
KR20090120740A (ko) 차량 a/v 시스템의 업그레이드 장치 및 방법
CN116954674A (zh) eMMC固件升级方法、固件升级设备和存储装置
CN113986261A (zh) 一种数据刷写的方法、相关装置、设备以及可读存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11844713

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11844713

Country of ref document: EP

Kind code of ref document: A1