WO2017000567A1 - Bootrom upgrading method and device - Google Patents
Bootrom upgrading method and device Download PDFInfo
- Publication number
- WO2017000567A1 WO2017000567A1 PCT/CN2016/074456 CN2016074456W WO2017000567A1 WO 2017000567 A1 WO2017000567 A1 WO 2017000567A1 CN 2016074456 W CN2016074456 W CN 2016074456W WO 2017000567 A1 WO2017000567 A1 WO 2017000567A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- partition
- bootrom
- upgrade
- startup
- boot
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
Definitions
- This document refers to, but is not limited to, system application upgrade technology, especially a method and device for implementing boot bootloader (BOOTROM) upgrade.
- BOOTROM boot bootloader
- the system application of electronic communication needs to be upgraded continuously due to changes in application scenarios, expansion of functions, and correction of bugs.
- the system's BootROM is also upgraded.
- the reliability of the BOOTROM upgrade is critical to the system application. If the upgrade fails, the system may not be able to start directly.
- the BOOTROM is generally stored in the flash memory (FLASH) memory.
- FLASH flash memory
- the BOOTROM upgrade method and the existing defects are as follows: 1. Directly overwriting the old version of the BootROM in the FLASH. The problem with this method is that if the upgrade fails, it will directly lead to The system cannot be started. 2.
- the FLASH is divided into two partitions. One area retains the factory BOOTROM. Each upgrade only upgrades another partition. The problem with this method is that if the upgrade fails or the system is damaged, the user can only put the BootROM. If you return to the factory BOOTROM, you cannot roll back to the BOOTROM before the upgrade.
- the embodiment of the invention provides a method and a device for upgrading a BootROM.
- the BOOTROM can be upgraded under the premise of using the FLASH storage space. If the BOOTROM fails to be upgraded, the BOOTROM before the upgrade can be restarted.
- the embodiment of the invention provides a method for implementing BOOTROM upgrade, which includes:
- the terminal selects the second partition to perform the BootROM upgrade
- the terminal After the second partition completes the BootROM upgrade, the terminal will map the CPU boot address from the original one. Modifying to the first partition to map to the second partition, to start the upgraded BootROM in the second partition according to the mapping of the CPU boot address;
- the second partition is another partition except the first partition where the BootROM currently running is located.
- the method further includes:
- the terminal presets a corresponding startup identifier for the first partition and the second partition by using the complex programmable logic device CPLD and assigns a corresponding value; and maps the CPU startup address to the start of the running BOOTROM according to the value of the startup identifier.
- a partition is modified to be mapped to the second partition of the upgraded BootROM.
- the method further includes:
- the terminal When the second partition is selected for the BootROM upgrade, the terminal writes and protects the first partition where the BootROM that is currently running is located;
- the terminal releases the write protection for the first partition.
- the method further includes:
- the terminal When the booting of the upgraded BootROM fails, the terminal remaps the CPU boot address to the first partition to select to start the BootROM running the first partition.
- the first partition and the second partition are partitions of the same size in the FLASH memory.
- Embodiments of the present invention also provide a computer readable storage medium storing computer executable instructions for performing any of the methods described above.
- an embodiment of the present invention further provides an apparatus for implementing a BOOTROM upgrade, including: a selecting unit, a mapping processing unit, where
- the mapping processing unit is set to the second partition to complete the BootROM upgrade
- the CPU boot address is modified from the original mapping to the first partition to be mapped to the second partition, so as to start the upgraded BootROM in the second partition according to the mapping of the CPU boot address.
- the second partition is another partition except the first partition where the BootROM currently running is located.
- the device further includes a preset unit,
- the device further includes a write protection unit, configured to perform write protection on the first partition where the BootROM that is currently started to run is performed when the second partition is selected for BOOTROM upgrade;
- mapping processing unit is further configured to: when the BootROM startup of the upgrade is started, fail to map the CPU boot address to the first partition to select to start the BootROM running the first partition.
- the first partition and the second partition are partitions of the same size in the FLASH memory.
- the technical solution of the present application includes: when starting the running diskless boot ROM ROM in the first partition, selecting the second partition to perform the BootROM upgrade; after the second partition completes the BootROM upgrade, the CPU boot address is The original mapping to the first partition is modified to be mapped to the second partition, so that the second partition starts the upgraded BootROM according to the mapping of the CPU startup address; the second partition is the first partition except the BootROM that is currently started to run. Another partition.
- the method of the embodiment of the invention performs system upgrade through two partitions, thereby avoiding waste of the FLASH storage space;
- the BOOTROM when the BOOTROM is upgraded, the partition where the BOOTROM is started is write-protected. After the upgrade fails, the BOOTROM before the upgrade is not re-selected, which improves the reliability of the system.
- FIG. 1 is a flowchart of a method for implementing BOOTROM upgrade according to an embodiment of the present invention
- FIG. 2 is a structural diagram of an apparatus for implementing BOOTROM upgrade according to an embodiment of the present invention
- FIG 3 is a flow chart of a method in accordance with a first embodiment of the present invention.
- FIG. 1 is a flowchart of a method for implementing BOOTROM upgrade according to an embodiment of the present invention. As shown in FIG. 1 , the method includes:
- Step 100 When the bootless read-only memory (BOOTROM) is started in the first partition, the terminal selects the second partition to perform the BootROM upgrade; where the second partition is other than the first partition where the BootROM currently started to run is located. Another partition.
- BOOTROM bootless read-only memory
- the method further includes:
- the terminal pre-sets a corresponding startup identifier for the first partition and the second partition by using a Complex Programmable Logic Device (CPLD) and assigns a corresponding value; the CPU (CPU) according to the value of the startup identifier , Central Processing Unit)
- CPLD Complex Programmable Logic Device
- the boot address is mapped to the first partition that starts the running BootROM or modified to the second partition mapped to the upgraded BootROM.
- the first partition and the second partition are partitions of the same size in the FLASH memory.
- Step 101 After the second partition completes the BootROM upgrade, the terminal modifies the CPU boot address from the original mapping to the first partition to be mapped to the second partition, so as to start the upgraded BootROM in the second partition according to the mapping of the CPU boot address.
- the terminal When the second partition is selected for the BootROM upgrade, the terminal writes and protects the first partition where the BootROM currently running is written;
- the terminal releases the write protection for the first partition.
- the method of the embodiment of the present invention further includes: when the booting of the upgraded BootROM fails, The terminal remaps the CPU boot address to the first partition to select to start the BootROM running the first partition.
- the partition that is started to be run is replaced by the partition that the BootROM upgrades successfully. That is, after the BOOTROM is upgraded and the boot succeeds, the partition will become the first partition, and the partition that originally started the BootROM becomes used for The second partition of the BOOTROM upgrade.
- the method of the invention performs system upgrade through two partitions, thereby avoiding waste of FLASH storage space;
- the BOOTROM when the BOOTROM is upgraded, the partition where the BOOTROM is started is write-protected. After the upgrade fails, the BOOTROM before the upgrade is not re-selected, which improves the reliability of the system.
- Embodiments of the present invention also provide a computer readable storage medium storing computer executable instructions for performing any of the methods described above.
- FIG. 2 is a structural diagram of an apparatus for implementing BOOTROM upgrade according to an embodiment of the present invention. As shown in FIG. 2, the method includes: a selecting unit, a mapping processing unit, where
- the mapping processing unit is set to the second partition to complete the BootROM upgrade
- the CPU boot address is modified from the original mapping to the first partition to be mapped to the second partition, so as to start the upgraded BootROM in the second partition according to the mapping of the CPU boot address.
- the second partition is another partition other than the first partition in which the BootROM currently running is located.
- the device of the embodiment of the invention further includes a preset unit,
- It is configured to preset a corresponding startup identifier for the first partition and the second partition by using the complex programmable logic device CPLD and assign a corresponding value; to map the CPU startup address to the first booting BOOTROM according to the value of the startup identifier. Partition or modify to the second partition mapped to the upgraded BootROM.
- the device of the embodiment of the invention further includes a write protection unit configured to select the second partition When the BOOTROM is upgraded, the first partition where the BootROM currently running is write-protected;
- the mapping processing unit is further configured to: when the booting of the BootROM to start the upgrade fails, re-map the CPU boot address to the first partition to select to start the BootROM running the first partition.
- the first partition and the second partition are partitions of the same size in the FLASH memory.
- FIG. 3 is a flowchart of a method according to a first embodiment of the present invention. As shown in FIG. 3, the method includes:
- Step 300 The terminal divides the FLASH memory into two partitions of the same size; one partition is used as the partition for starting the BootROM, and the other partition is used as the partition for upgrading the BootROM; in general, the BOOTROM partition that is started to run is the original BOOTROM before the upgrade. The partition where the BootROM is located. When the second upgrade is performed, the BOOTROM partition that is started is the partition where the BootROM is located after the last upgrade.
- Step 301 The terminal pre-sets a corresponding startup identifier for the two partitions by using the CPLD, and assigns a corresponding value, and maps the CPU startup address to the partition where the BootROM is started according to the value of the startup identifier;
- the terminal maps the CPU startup address to the first partition that starts the BootROM.
- the terminal modifies the CPU startup address to the partition mapped to the upgraded BootROM.
- the value of the startup identifier can be represented by a bit (BIT) bit.
- a general 1 represents the BootROM that starts the partition, and 0 represents the partition used for the upgrade of the BootROM.
- the terminal performs the CPU startup address modification according to the value of the startup identifier, that is, when the startup identifier is modified, the CPU startup address mapping is modified.
- Step 302 When the booting BootROM is in the first partition, the terminal selects the second partition to perform the BootROM upgrade; where the first partition is the current running BootROM. Area. During the upgrade, the first partition is write-protected, that is, the data write address of the first partition prohibits data writing. After the BootROM upgrade is completed, the first partition write protection is released.
- Step 303 After the second partition completes the BootROM upgrade, the terminal modifies the CPU boot address from the original mapping to the first partition to be mapped to the second partition, so as to start the upgraded BootROM in the second partition according to the mapping of the CPU boot address.
- step 304 If the upgraded BootROM is successfully started, go to step 304. If it fails, go to step 305.
- Step 304 After the upgraded BootROM is successfully started, the terminal keeps mapping the CPU startup address to the partition where the upgraded BootROM is located before the next upgrade succeeds; here, after the upgrade is completed and the startup is successful, the partition is used as the first partition by default. use.
- Step 305 When the upgraded BootROM fails to be started, the terminal remaps the CPU startup address to the partition that previously started the BootROM to select to start the BootROM running the partition; that is, the value of the startup identifier fails to be upgraded after the upgrade is completed, and is re-modified. Until the original value, the first partition will not be changed.
- the FLASH memory is divided into two partitions, and the complex programmable logic device automatically updates the read and write values of the boot identifier, so that the BOOTROM upgrade is performed in two partitions, and the currently running partition is performed.
- Write protection saves FLASH space cost and improves the reliability of BOOTROM upgrade.
- each module/unit in the foregoing embodiment may be implemented in the form of hardware, for example, by implementing an integrated circuit to implement its corresponding function, or may be implemented in the form of a software function module, for example, executing a program in a storage and a memory by a processor. / instruction to achieve its corresponding function.
- the invention is not limited to any specific form of combination of hardware and software.
- the BOOTROM before the upgrade is not re-selected can be re-selected, which improves the reliability of the system.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Techniques For Improving Reliability Of Storages (AREA)
- Stored Programmes (AREA)
Abstract
Description
本文涉及但不限于系统应用升级技术,尤指一种实现启动引导程序(BOOTROM)升级的方法及装置。This document refers to, but is not limited to, system application upgrade technology, especially a method and device for implementing boot bootloader (BOOTROM) upgrade.
电子通信的系统应用由于应用场景的改变、功能的扩展完善和漏洞(BUG)的修正等原因,需要不断的进行升级;在系统应用升级时,也会对系统的BOOTROM进行升级。BOOTROM升级的可靠与否对系统应用来说十分关键,若升级失败,可能会直接导致系统无法启动。The system application of electronic communication needs to be upgraded continuously due to changes in application scenarios, expansion of functions, and correction of bugs. When the system is upgraded, the system's BootROM is also upgraded. The reliability of the BOOTROM upgrade is critical to the system application. If the upgrade fails, the system may not be able to start directly.
BOOTROM一般都存储在闪存(FLASH)存储器中,相关技术中,BOOTROM的升级方法及存在的缺陷分别有:1、直接覆盖FLASH中旧版本的BOOTROM,该方法存在的问题是若升级失败会直接导致系统无法启动;2、将FLASH分成两个分区,一个区保留出厂时的BOOTROM,每次升级只升级另一个分区,该方法存在的问题是若升级失败或系统遭到破坏,用户只能把BOOTROM回退到出厂时的BOOTROM,即无法回退到升级前的BOOTROM。The BOOTROM is generally stored in the flash memory (FLASH) memory. In the related art, the BOOTROM upgrade method and the existing defects are as follows: 1. Directly overwriting the old version of the BootROM in the FLASH. The problem with this method is that if the upgrade fails, it will directly lead to The system cannot be started. 2. The FLASH is divided into two partitions. One area retains the factory BOOTROM. Each upgrade only upgrades another partition. The problem with this method is that if the upgrade fails or the system is damaged, the user can only put the BootROM. If you return to the factory BOOTROM, you cannot roll back to the BOOTROM before the upgrade.
发明内容Summary of the invention
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。The following is an overview of the topics detailed in this document. This Summary is not intended to limit the scope of the claims.
本发明实施例提供一种实现BOOTROM升级的方法及装置,能够在合理利用FLASH存储空间前提下进行BOOTROM升级,BOOTROM升级失败时,可以重新启动升级前的BOOTROM。The embodiment of the invention provides a method and a device for upgrading a BootROM. The BOOTROM can be upgraded under the premise of using the FLASH storage space. If the BOOTROM fails to be upgraded, the BOOTROM before the upgrade can be restarted.
本发明实施例提供了一种实现BOOTROM升级的方法,包括:The embodiment of the invention provides a method for implementing BOOTROM upgrade, which includes:
当启动运行的无盘启动只读存储器BOOTROM在第一分区时,终端选择第二分区进行BOOTROM升级;When the diskless boot ROM ROM of the booting is started in the first partition, the terminal selects the second partition to perform the BootROM upgrade;
第二分区完成BOOTROM升级后,终端将CPU启动地址由原先的映射 至第一分区修改为映射至第二分区,以根据CPU启动地址的映射启动第二分区中升级完成的BOOTROM;After the second partition completes the BootROM upgrade, the terminal will map the CPU boot address from the original one. Modifying to the first partition to map to the second partition, to start the upgraded BootROM in the second partition according to the mapping of the CPU boot address;
所述第二分区为除当前启动运行的BOOTROM所在的第一分区以外的另一分区。The second partition is another partition except the first partition where the BootROM currently running is located.
可选地,该方法之前还包括:Optionally, the method further includes:
终端通过复杂可编程逻辑器件CPLD为第一分区和第二分区预先设定相应的启动标识并赋值相应的取值;以根据启动标识的取值将CPU启动地址映射到启动运行BOOTROM的所述第一分区或修改为映射至升级完成的BOOTROM的所述第二分区。The terminal presets a corresponding startup identifier for the first partition and the second partition by using the complex programmable logic device CPLD and assigns a corresponding value; and maps the CPU startup address to the start of the running BOOTROM according to the value of the startup identifier. A partition is modified to be mapped to the second partition of the upgraded BootROM.
可选地,该方法还包括:Optionally, the method further includes:
在选择所述第二分区进行BOOTROM升级时,终端对当前启动运行的BOOTROM所在的所述第一分区进行写保护;When the second partition is selected for the BootROM upgrade, the terminal writes and protects the first partition where the BootROM that is currently running is located;
BOOTROM升级完成后,终端对第一分区解除写保护。After the BOOTROM upgrade is completed, the terminal releases the write protection for the first partition.
可选地,该方法还包括:Optionally, the method further includes:
启动所述升级完成的BOOTROM启动失败时,终端重新将所述CPU启动地址映射至所述第一分区,以选择启动运行所述第一分区的BOOTROM。When the booting of the upgraded BootROM fails, the terminal remaps the CPU boot address to the first partition to select to start the BootROM running the first partition.
可选地,第一分区和第二分区为FLASH存储器中存储空间大小相同的分区。Optionally, the first partition and the second partition are partitions of the same size in the FLASH memory.
本发明实施例还提出了一种计算机可读存储介质,存储有计算机可执行指令,计算机可执行指令用于执行上述描述的任意一个方法。Embodiments of the present invention also provide a computer readable storage medium storing computer executable instructions for performing any of the methods described above.
另一方面,本发明实施例还提供一种实现BOOTROM升级的装置,包括:选择单元,映射处理单元;其中,On the other hand, an embodiment of the present invention further provides an apparatus for implementing a BOOTROM upgrade, including: a selecting unit, a mapping processing unit, where
选择单元,设置为当启动运行的BOOTROM在第一分区时,选择第二分区进行BOOTROM升级;Selecting a unit, setting to select the second partition for BOOTROM upgrade when the booting BootROM is in the first partition;
映射处理单元,设置为第二分区完成BOOTROM升级后,将CPU启动地址由原先的映射至第一分区修改为映射至第二分区,以根据CPU启动地址的映射启动第二分区中升级完成的BOOTROM; After the mapping processing unit is set to the second partition to complete the BootROM upgrade, the CPU boot address is modified from the original mapping to the first partition to be mapped to the second partition, so as to start the upgraded BootROM in the second partition according to the mapping of the CPU boot address. ;
所述第二分区为除当前启动运行的BOOTROM所在的第一分区以外的另一分区。The second partition is another partition except the first partition where the BootROM currently running is located.
可选地,该装置还包括预设单元,Optionally, the device further includes a preset unit,
设置为通过复杂可编程逻辑器件CPLD为第一分区和第二分区预先设定相应的启动标识并赋值相应的取值;以根据启动标识的取值将CPU启动地址映射到启动运行BOOTROM的所述第一分区或修改为映射至升级完成的BOOTROM的所述第二分区。Set to preset a corresponding startup identifier for the first partition and the second partition by using the complex programmable logic device CPLD and assign a corresponding value; to map the CPU boot address to the booting operation BOOTROM according to the value of the boot identifier The first partition is modified to be mapped to the second partition of the upgraded BootROM.
可选地,该装置还包括写保护单元,设置为在选择所述第二分区进行BOOTROM升级时,对当前启动运行的BOOTROM所在的所述第一分区进行写保护;Optionally, the device further includes a write protection unit, configured to perform write protection on the first partition where the BootROM that is currently started to run is performed when the second partition is selected for BOOTROM upgrade;
BOOTROM升级完成后,对第一分区解除写保护。After the BOOTROM upgrade is completed, write protection is disabled for the first partition.
可选地,映射处理单元还设置为,启动所述升级完成的BOOTROM启动失败时,重新将所述CPU启动地址映射至所述第一分区,以选择启动运行所述第一分区的BOOTROM。Optionally, the mapping processing unit is further configured to: when the BootROM startup of the upgrade is started, fail to map the CPU boot address to the first partition to select to start the BootROM running the first partition.
可选地,第一分区和第二分区为FLASH存储器中存储空间大小相同的分区。Optionally, the first partition and the second partition are partitions of the same size in the FLASH memory.
与相关技术相比,本申请技术方案包括:当启动运行的无盘启动只读存储器BOOTROM在第一分区时,选择第二分区进行BOOTROM升级;第二分区完成BOOTROM升级后,将CPU启动地址由原先的映射至第一分区修改为映射至第二分区,以使所述第二分区根据CPU启动地址的映射启动升级完成的BOOTROM;第二分区为除当前启动运行的BOOTROM所在的第一分区以外的另一分区。本发明实施例方法通过两个分区进行系统升级,避免了FLASH存储空间的浪费;Compared with the related art, the technical solution of the present application includes: when starting the running diskless boot ROM ROM in the first partition, selecting the second partition to perform the BootROM upgrade; after the second partition completes the BootROM upgrade, the CPU boot address is The original mapping to the first partition is modified to be mapped to the second partition, so that the second partition starts the upgraded BootROM according to the mapping of the CPU startup address; the second partition is the first partition except the BootROM that is currently started to run. Another partition. The method of the embodiment of the invention performs system upgrade through two partitions, thereby avoiding waste of the FLASH storage space;
另一方面,在进行BOOTROM升级时,对启动运行的BOOTROM所在分区进行写保护,避免了升级失败后,无法重新选择启动运行升级前的BOOTROM,提高了系统的可靠性。On the other hand, when the BOOTROM is upgraded, the partition where the BOOTROM is started is write-protected. After the upgrade fails, the BOOTROM before the upgrade is not re-selected, which improves the reliability of the system.
在阅读并理解了附图和详细描述后,可以明白其他方面。Other aspects will be apparent upon reading and understanding the drawings and detailed description.
附图概述 BRIEF abstract
图1为本发明实施例实现BOOTROM升级的方法的流程图;FIG. 1 is a flowchart of a method for implementing BOOTROM upgrade according to an embodiment of the present invention;
图2为本发明实施例实现BOOTROM升级的装置的结构程图;2 is a structural diagram of an apparatus for implementing BOOTROM upgrade according to an embodiment of the present invention;
图3为本发明第一实施例的方法流程图。3 is a flow chart of a method in accordance with a first embodiment of the present invention.
下文中将结合附图对本发明的实施例进行详细说明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互任意组合。Embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that, in the case of no conflict, the features in the embodiments and the embodiments in the present application may be arbitrarily combined with each other.
图1为本发明实施例实现BOOTROM升级的方法的流程图,如图1所示,包括:FIG. 1 is a flowchart of a method for implementing BOOTROM upgrade according to an embodiment of the present invention. As shown in FIG. 1 , the method includes:
步骤100、当启动运行的无盘启动只读存储器(BOOTROM)在第一分区时,终端选择第二分区进行BOOTROM升级;这里,第二分区为除当前启动运行的BOOTROM所在的第一分区以外的另一分区。Step 100: When the bootless read-only memory (BOOTROM) is started in the first partition, the terminal selects the second partition to perform the BootROM upgrade; where the second partition is other than the first partition where the BootROM currently started to run is located. Another partition.
本发明实施例方法之前还包括:Before the method of the embodiment of the present invention, the method further includes:
终端通过复杂可编程逻辑器件(CPLD,Complex Programmable Logic Device)为第一分区和第二分区预先设定相应的启动标识并赋值相应的取值;以根据启动标识的取值将中央处理器(CPU,Central Processing Unit)启动地址映射到启动运行BOOTROM的第一分区或修改为映射至升级完成的BOOTROM的第二分区。The terminal pre-sets a corresponding startup identifier for the first partition and the second partition by using a Complex Programmable Logic Device (CPLD) and assigns a corresponding value; the CPU (CPU) according to the value of the startup identifier , Central Processing Unit) The boot address is mapped to the first partition that starts the running BootROM or modified to the second partition mapped to the upgraded BootROM.
本发明实施例方法中,第一分区和第二分区为FLASH存储器中存储空间大小相同的分区。In the method of the embodiment of the present invention, the first partition and the second partition are partitions of the same size in the FLASH memory.
步骤101、第二分区完成BOOTROM升级后,终端将CPU启动地址由原先的映射至第一分区修改为映射至第二分区,以根据CPU启动地址的映射启动第二分区中升级完成的BOOTROM。Step 101: After the second partition completes the BootROM upgrade, the terminal modifies the CPU boot address from the original mapping to the first partition to be mapped to the second partition, so as to start the upgraded BootROM in the second partition according to the mapping of the CPU boot address.
本发明实施例方法还包括:The method of the embodiment of the invention further includes:
在选择第二分区进行BOOTROM升级时,终端对当前启动运行的BOOTROM所在的第一分区进行写保护;When the second partition is selected for the BootROM upgrade, the terminal writes and protects the first partition where the BootROM currently running is written;
BOOTROM升级完成后,终端对第一分区解除写保护。After the BOOTROM upgrade is completed, the terminal releases the write protection for the first partition.
本发明实施例方法还包括:启动升级完成的BOOTROM启动失败时, 终端重新将CPU启动地址映射至第一分区,以选择启动运行第一分区的BOOTROM。The method of the embodiment of the present invention further includes: when the booting of the upgraded BootROM fails, The terminal remaps the CPU boot address to the first partition to select to start the BootROM running the first partition.
需要说明的是,如果第二分区启动成功,则启动运行的分区由BOOTROM升级成功的分区替换,即完成BOOTROM升级且启动成功后的分区将变为第一分区,原先启动BOOTROM的分区成为用于BOOTROM升级的第二分区。It should be noted that if the second partition is successfully started, the partition that is started to be run is replaced by the partition that the BootROM upgrades successfully. That is, after the BOOTROM is upgraded and the boot succeeds, the partition will become the first partition, and the partition that originally started the BootROM becomes used for The second partition of the BOOTROM upgrade.
本发明方法通过两个分区进行系统升级,避免了FLASH存储空间的浪费;The method of the invention performs system upgrade through two partitions, thereby avoiding waste of FLASH storage space;
另一方面,在进行BOOTROM升级时,对启动运行的BOOTROM所在分区进行写保护,避免了升级失败后,无法重新选择启动运行升级前的BOOTROM,提高了系统的可靠性。On the other hand, when the BOOTROM is upgraded, the partition where the BOOTROM is started is write-protected. After the upgrade fails, the BOOTROM before the upgrade is not re-selected, which improves the reliability of the system.
本发明实施例还提出了一种计算机可读存储介质,存储有计算机可执行指令,计算机可执行指令用于执行上述描述的任意一个方法。Embodiments of the present invention also provide a computer readable storage medium storing computer executable instructions for performing any of the methods described above.
图2为本发明实施例实现BOOTROM升级的装置的结构程图,如图2所示,包括:选择单元,映射处理单元;其中,2 is a structural diagram of an apparatus for implementing BOOTROM upgrade according to an embodiment of the present invention. As shown in FIG. 2, the method includes: a selecting unit, a mapping processing unit, where
选择单元,设置为当启动运行的BOOTROM在第一分区时,选择第二分区进行BOOTROM升级;Selecting a unit, setting to select the second partition for BOOTROM upgrade when the booting BootROM is in the first partition;
映射处理单元,设置为第二分区完成BOOTROM升级后,将CPU启动地址由原先的映射至第一分区修改为映射至第二分区,以根据CPU启动地址的映射启动第二分区中升级完成的BOOTROM;After the mapping processing unit is set to the second partition to complete the BootROM upgrade, the CPU boot address is modified from the original mapping to the first partition to be mapped to the second partition, so as to start the upgraded BootROM in the second partition according to the mapping of the CPU boot address. ;
第二分区为除当前启动运行的BOOTROM所在的第一分区以外的另一分区。The second partition is another partition other than the first partition in which the BootROM currently running is located.
本发明实施例装置还包括预设单元,The device of the embodiment of the invention further includes a preset unit,
设置为通过复杂可编程逻辑器件CPLD为第一分区和第二分区预先设定相应的启动标识并赋值相应的取值;以根据启动标识的取值将CPU启动地址映射到启动运行BOOTROM的第一分区或修改为映射至升级完成的BOOTROM的第二分区。It is configured to preset a corresponding startup identifier for the first partition and the second partition by using the complex programmable logic device CPLD and assign a corresponding value; to map the CPU startup address to the first booting BOOTROM according to the value of the startup identifier. Partition or modify to the second partition mapped to the upgraded BootROM.
本发明实施例装置还包括写保护单元,设置为在选择第二分区进行 BOOTROM升级时,对当前启动运行的BOOTROM所在的第一分区进行写保护;The device of the embodiment of the invention further includes a write protection unit configured to select the second partition When the BOOTROM is upgraded, the first partition where the BootROM currently running is write-protected;
BOOTROM升级完成后,对第一分区解除写保护。After the BOOTROM upgrade is completed, write protection is disabled for the first partition.
映射处理单元还设置为,启动升级完成的BOOTROM启动失败时,重新将CPU启动地址映射至第一分区,以选择启动运行第一分区的BOOTROM。The mapping processing unit is further configured to: when the booting of the BootROM to start the upgrade fails, re-map the CPU boot address to the first partition to select to start the BootROM running the first partition.
第一分区和第二分区为FLASH存储器中存储空间大小相同的分区。The first partition and the second partition are partitions of the same size in the FLASH memory.
以下通过具体实施例对本发明方法进行清楚详细的说明,实施例仅用于陈述本发明,并不用于限制本发明方法的保护范围。The method of the present invention is described in detail below by way of specific examples, which are merely used to illustrate the invention and are not intended to limit the scope of the method of the invention.
实施例1Example 1
图3为本发明第一实施例的方法流程图,如图3所示,包括:FIG. 3 is a flowchart of a method according to a first embodiment of the present invention. As shown in FIG. 3, the method includes:
步骤300、终端将FLASH存储器分成大小相同的两个分区;其中,一个分区作为启动运行BOOTROM的分区,另一分区作为升级BOOTROM的分区;一般的,启动运行的BOOTROM分区在升级之前BOOTROM为原厂的BOOTROM所在的分区,当进行第二次升级时,启动运行的BOOTROM分区为上一次升级后BOOTROM所在的分区。Step 300: The terminal divides the FLASH memory into two partitions of the same size; one partition is used as the partition for starting the BootROM, and the other partition is used as the partition for upgrading the BootROM; in general, the BOOTROM partition that is started to run is the original BOOTROM before the upgrade. The partition where the BootROM is located. When the second upgrade is performed, the BOOTROM partition that is started is the partition where the BootROM is located after the last upgrade.
步骤301、终端通过CPLD为两个分区预先设定相应的启动标识并赋值相应的取值,根据启动标识的取值将CPU启动地址映射到启动运行的BOOTROM所在的分区;Step 301: The terminal pre-sets a corresponding startup identifier for the two partitions by using the CPLD, and assigns a corresponding value, and maps the CPU startup address to the partition where the BootROM is started according to the value of the startup identifier;
这里,升级前,终端将CPU启动地址映射到启动运行BOOTROM的第一分区,升级后,终端将CPU启动地址修改为映射至升级完成的BOOTROM的分区。启动标识的取值可以通过一个比特(BIT)位表示,一般的1代表启动运行该分区的BOOTROM,0代表该分区用于BOOTROM的升级。Here, before the upgrade, the terminal maps the CPU startup address to the first partition that starts the BootROM. After the upgrade, the terminal modifies the CPU startup address to the partition mapped to the upgraded BootROM. The value of the startup identifier can be represented by a bit (BIT) bit. A general 1 represents the BootROM that starts the partition, and 0 represents the partition used for the upgrade of the BootROM.
需要说明的是,这里,终端进行CPU启动地址修改是根据启动标识的取值进行,即启动标识取值修改时,进行CPU启动地址映射的修改。It should be noted that, here, the terminal performs the CPU startup address modification according to the value of the startup identifier, that is, when the startup identifier is modified, the CPU startup address mapping is modified.
步骤302、当启动运行的BOOTROM在第一分区时,终端选择第二分区进行BOOTROM升级;这里,第一分区为当前运行的BOOTROM所在的分 区。在升级时,本实施例对第一分区进行写保护,即第一分区的数据写入地址禁止数据写入,完成BOOTROM升级后,对第一分区写保护解除。Step 302: When the booting BootROM is in the first partition, the terminal selects the second partition to perform the BootROM upgrade; where the first partition is the current running BootROM. Area. During the upgrade, the first partition is write-protected, that is, the data write address of the first partition prohibits data writing. After the BootROM upgrade is completed, the first partition write protection is released.
步骤303、第二分区完成BOOTROM升级后,终端将CPU启动地址由原先的映射至第一分区修改为映射至第二分区,以根据CPU启动地址的映射启动第二分区中升级完成的BOOTROM。Step 303: After the second partition completes the BootROM upgrade, the terminal modifies the CPU boot address from the original mapping to the first partition to be mapped to the second partition, so as to start the upgraded BootROM in the second partition according to the mapping of the CPU boot address.
若升级完成的BOOTROM启动成功,执行步骤304,;若失败,执行步骤305。If the upgraded BootROM is successfully started, go to step 304. If it fails, go to step 305.
步骤304、升级完成的BOOTROM启动成功后,终端将CPU启动地址在下一次升级成功之前保持映射至升级完成的BOOTROM所在的分区;这里,相当于升级完成并启动成功后,该分区默认作为第一分区使用。Step 304: After the upgraded BootROM is successfully started, the terminal keeps mapping the CPU startup address to the partition where the upgraded BootROM is located before the next upgrade succeeds; here, after the upgrade is completed and the startup is successful, the partition is used as the first partition by default. use.
步骤305、升级完成的BOOTROM启动失败时,终端重新将CPU启动地址映射至先前启动BOOTROM的分区,以选择启动运行该分区的BOOTROM;即启动标识的取值在升级完成的BOOTROM启动失败,重新修改至原先的取值,第一分区不做更改。Step 305: When the upgraded BootROM fails to be started, the terminal remaps the CPU startup address to the partition that previously started the BootROM to select to start the BootROM running the partition; that is, the value of the startup identifier fails to be upgraded after the upgrade is completed, and is re-modified. Until the original value, the first partition will not be changed.
综上,本实施例通过将FLASH存储器划分为两个分区,且复杂可编程逻辑器件通过自动读、写启动标识的取值,使得BOOTROM升级在两个分区进行轮换进行,并将当前运行的分区进行写保护,节约FLASH空间成本,提高了BOOTROM升级的可靠性。In summary, in this embodiment, the FLASH memory is divided into two partitions, and the complex programmable logic device automatically updates the read and write values of the boot identifier, so that the BOOTROM upgrade is performed in two partitions, and the currently running partition is performed. Write protection saves FLASH space cost and improves the reliability of BOOTROM upgrade.
本领域普通技术人员可以理解上述方法中的全部或部分步骤可通过程序来指令相关硬件(例如处理器)完成,所述程序可以存储于计算机可读存储介质中,如只读存储器、磁盘或光盘等。可选地,上述实施例的全部或部分步骤也可以使用一个或多个集成电路来实现。相应地,上述实施例中的各模块/单元可以采用硬件的形式实现,例如通过集成电路来实现其相应功能,也可以采用软件功能模块的形式实现,例如通过处理器执行存储与存储器中的程序/指令来实现其相应功能。本发明不限于任何特定形式的硬件和软件的结合。 One of ordinary skill in the art will appreciate that all or a portion of the above steps may be performed by a program to instruct related hardware, such as a processor, which may be stored in a computer readable storage medium, such as a read only memory, disk or optical disk. Wait. Alternatively, all or part of the steps of the above embodiments may also be implemented using one or more integrated circuits. Correspondingly, each module/unit in the foregoing embodiment may be implemented in the form of hardware, for example, by implementing an integrated circuit to implement its corresponding function, or may be implemented in the form of a software function module, for example, executing a program in a storage and a memory by a processor. / instruction to achieve its corresponding function. The invention is not limited to any specific form of combination of hardware and software.
虽然本发明所揭露的实施方式如上,但所述的内容仅为便于理解本发明而采用的实施方式,并非用以限定本发明。任何本发明所属领域内的技术人员,在不脱离本发明所揭露的精神和范围的前提下,可以在实施的形式及细节上进行任何的修改与变化,但本发明的专利保护范围,仍须以所附的权利要求书所界定的范围为准。While the embodiments of the present invention have been described above, the described embodiments are merely for the purpose of understanding the invention and are not intended to limit the invention. Any modification and variation in the form and details of the embodiments may be made by those skilled in the art without departing from the spirit and scope of the invention. The scope defined by the appended claims shall prevail.
上述技术方案避免了FLASH存储空间的浪费;The above technical solution avoids waste of FLASH storage space;
另一方面,避免了升级失败后,无法重新选择启动运行升级前的BOOTROM,提高了系统的可靠性。 On the other hand, after the upgrade fails, the BOOTROM before the upgrade is not re-selected can be re-selected, which improves the reliability of the system.
Claims (11)
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510383157.1A CN106325911A (en) | 2015-07-02 | 2015-07-02 | Method and device for implementing BOOTROM upgrade |
| CN201510383157.1 | 2015-07-02 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2017000567A1 true WO2017000567A1 (en) | 2017-01-05 |
Family
ID=57607667
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2016/074456 Ceased WO2017000567A1 (en) | 2015-07-02 | 2016-02-24 | Bootrom upgrading method and device |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN106325911A (en) |
| WO (1) | WO2017000567A1 (en) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111324488A (en) * | 2020-02-12 | 2020-06-23 | 浙江大华技术股份有限公司 | Program backup processing method and device |
| CN113377565A (en) * | 2021-06-10 | 2021-09-10 | 博流智能科技(南京)有限公司 | BOOTROM correction system and method and chip |
| CN115934138A (en) * | 2023-01-09 | 2023-04-07 | 四川长虹空调有限公司 | A kind of air conditioner firmware OTA upgrade method |
Families Citing this family (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111158712A (en) * | 2018-11-07 | 2020-05-15 | 中兴通讯股份有限公司 | Vehicle-mounted Tbox upgrading method, device, equipment and storage medium |
| CN110031054A (en) * | 2019-03-27 | 2019-07-19 | 上海飞奥燃气设备有限公司 | Gas meter, flow meter intelligent controller and its firmware upgrade start method |
| CN112118280A (en) * | 2020-06-19 | 2020-12-22 | 上海汉枫电子科技有限公司 | Recovery method after OTA upgrade failure of WI-FI equipment |
| CN112241340A (en) * | 2020-11-05 | 2021-01-19 | 中国航空工业集团公司西安航空计算技术研究所 | Startup and loading regional data backup method for online upgrade |
| CN115794180A (en) * | 2022-12-13 | 2023-03-14 | 苏州挚途科技有限公司 | A bootloader upgrade method and system |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1501621A (en) * | 2002-11-18 | 2004-06-02 | 华为技术有限公司 | A method for securely starting a system |
| CN102033790A (en) * | 2010-12-15 | 2011-04-27 | 中兴通讯股份有限公司 | Method and device for upgrading embedded-type system BOOTROM |
| CN102486733A (en) * | 2010-12-03 | 2012-06-06 | 中兴通讯股份有限公司 | Method and device for upgrading boot program |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR20030031734A (en) * | 2001-10-16 | 2003-04-23 | 삼성전자주식회사 | Method for upgrading cable modem software and bootrom of a cable modem |
| CN101782859A (en) * | 2010-03-18 | 2010-07-21 | 上海乐毅信息科技有限公司 | Upgrading method of embedded system in application |
| CN102981872A (en) * | 2012-11-09 | 2013-03-20 | 青岛海信移动通信技术股份有限公司 | Start-up and upgrade method of terminal equipment and terminal equipment |
| CN102945176B (en) * | 2012-11-09 | 2016-09-28 | 青岛海信移动通信技术股份有限公司 | Method and device for starting and upgrading terminal equipment |
-
2015
- 2015-07-02 CN CN201510383157.1A patent/CN106325911A/en active Pending
-
2016
- 2016-02-24 WO PCT/CN2016/074456 patent/WO2017000567A1/en not_active Ceased
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1501621A (en) * | 2002-11-18 | 2004-06-02 | 华为技术有限公司 | A method for securely starting a system |
| CN102486733A (en) * | 2010-12-03 | 2012-06-06 | 中兴通讯股份有限公司 | Method and device for upgrading boot program |
| CN102033790A (en) * | 2010-12-15 | 2011-04-27 | 中兴通讯股份有限公司 | Method and device for upgrading embedded-type system BOOTROM |
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111324488A (en) * | 2020-02-12 | 2020-06-23 | 浙江大华技术股份有限公司 | Program backup processing method and device |
| CN111324488B (en) * | 2020-02-12 | 2023-12-08 | 浙江大华技术股份有限公司 | Program backup processing method and device |
| CN113377565A (en) * | 2021-06-10 | 2021-09-10 | 博流智能科技(南京)有限公司 | BOOTROM correction system and method and chip |
| CN113377565B (en) * | 2021-06-10 | 2024-05-28 | 博流智能科技(南京)有限公司 | BOOTROM correction system and method and chip |
| CN115934138A (en) * | 2023-01-09 | 2023-04-07 | 四川长虹空调有限公司 | A kind of air conditioner firmware OTA upgrade method |
Also Published As
| Publication number | Publication date |
|---|---|
| CN106325911A (en) | 2017-01-11 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2017000567A1 (en) | Bootrom upgrading method and device | |
| CN102033790B (en) | Method and device for upgrading embedded-type system BOOTROM | |
| US9507604B2 (en) | Boot method and boot system | |
| CN103365696B (en) | BIOS image file acquisition methods and device | |
| WO2022007656A1 (en) | Bootloader software updating method and apparatus, embedded controller, and storage medium | |
| CN105739961B (en) | Starting method and device of embedded system | |
| CN103577201B (en) | The update method and system of Embedded Double system | |
| US10642623B1 (en) | Preserving firmware settings during firmware updates | |
| WO2013103023A1 (en) | Information processing device, information processing method, and computer program | |
| CN109753299A (en) | A system upgrade method, device and computer storage medium | |
| JP2011095952A (en) | Method for updating firmware and electronic equipment | |
| US8788800B2 (en) | OS processing method, system and non-transitory computer readable storage medium thereof | |
| CN112433767A (en) | BIOS configuration item setting method, system, equipment and medium | |
| US9411605B2 (en) | Device-less and system agnostic unified extensible firmware interface (UEFI) driver | |
| CN110874237A (en) | Software upgrading method, device, terminal and readable storage medium | |
| CN104536841B (en) | A kind of android system Data subregions self-repair method and system | |
| WO2015154538A1 (en) | Memory booting method and device | |
| CN111026417A (en) | Embedded equipment upgrading method and embedded equipment | |
| CN106598576A (en) | Equipment parameter updating method and device based on squashfs read-only file | |
| CN106951257A (en) | A kind of implementation method for starting WinCE with Uboot_CDROM | |
| US20140258699A1 (en) | Boot fault tolerant device and method thereof | |
| WO2018014687A1 (en) | Parameter passing method and apparatus, and computer storage medium | |
| WO2017173924A1 (en) | Method and device for switching between file systems | |
| CN116339792A (en) | Firmware replacement method, computer system, medium and product | |
| CN118796288A (en) | Method, device, computer equipment and storage medium for performing hardware initialization operation |
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: 16816932 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: 16816932 Country of ref document: EP Kind code of ref document: A1 |