CN106776122A - A kind of method of main-apparatus protection in start-up course based on Flash - Google Patents

A kind of method of main-apparatus protection in start-up course based on Flash Download PDF

Info

Publication number
CN106776122A
CN106776122A CN201611048195.2A CN201611048195A CN106776122A CN 106776122 A CN106776122 A CN 106776122A CN 201611048195 A CN201611048195 A CN 201611048195A CN 106776122 A CN106776122 A CN 106776122A
Authority
CN
China
Prior art keywords
flash
main
bootloader
value
firmware
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201611048195.2A
Other languages
Chinese (zh)
Inventor
夏渊
陈志�
张蔚青
余春平
卜勤练
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Accelink Technologies Co Ltd
Original Assignee
Accelink Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Accelink Technologies Co Ltd filed Critical Accelink Technologies Co Ltd
Priority to CN201611048195.2A priority Critical patent/CN106776122A/en
Publication of CN106776122A publication Critical patent/CN106776122A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1417Boot up procedures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1433Saving, restoring, recovering or retrying at system level during software upgrading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

Performed the present invention relates to a kind of method of main-apparatus protection in start-up course based on Flash, in the loading procedure Bootloader of the embedded system based in Flash start-up courses the step of main-apparatus protection, including:System main partition, the back-up area of storage firmware program and/or data, and the original checksums value for setting the system firmware corresponding with the check value of firmware program and/or data are set in Flash chip;Bootloader reads the data in main partition, and the check value of the firmware program and/or data stored in system main partition is calculated by verification value-based algorithm;Bootloader compares the original checksums value of the system firmware read from Flash chip and the check value of the firmware program and/or data stored in system main partition is calculated by verification value-based algorithm, when both check values are consistent, the firmware program and/or data stored in Bootloader selection loading systems main partition, start from system main partition;When both check values are inconsistent, start from system back-up area;The present invention makes system avoid firmware from damaging and hang dead phenomenon.

Description

A kind of method of main-apparatus protection in start-up course based on Flash
Technical field
The present invention relates to a kind of startup method of embedded system, and in particular to one kind is based on main in Flash start-up courses The method of standby protection, can automatically switch to preparation area and start, it is ensured that the stability of system in the case where Flash primary areas are damaged, The present invention is applied to communication and computer realm.
Background technology
In embedded development, the firmware program of system is typically to be stored on nonvolatile storage, common memory Have a NAND Flash, the basic characteristics of Nor Flash and QSPI Flash, Flash be exactly as block storage device, can be quick The a bulk of data of read-write, this feature makes it suitable as the firmware storage equipment of system.It can accomplish quickly renewal System (writes firmware to Flash), reduces the online upgrading time of system;Can accomplish that fast powering-up starts simultaneously and (read Flash Middle firmware content), electrifying startup speed is improved, reduce system cold start-up or reset startup time, so as to reduce system industry It is engaged in the time interrupted.NAND, Nor and QSPI Flash, their technique, amount of capacity respectively have feature, can apply different Occasion, wherein QSPI Flash access speeds are fast, and Nor Flash reliabilities are high, but capacity is small, high cost, NAND Flash Then capacity is big, moderate cost.
It is exactly the high reliability of system but either which kind of Flash, all suffers from same problem.Carried out in system , it is necessary to first wipe the data deposited in Flash when firmware updating, then write firmware content to be upgraded.In this process In, if power down or writing Flash and have failed, system can due in Flash firmware content damage, and can not normally start, The business (such as photocontrol or any function control) of all operations is interrupted, the reliability of system has been had a strong impact on.
Said process, although power down or write Flash failure phenomenons probability it is not high, but once occur, then system is just It is not normally functioning, this is fatal error for communication system.
It is badly in need of a kind of method that main-apparatus protection can be provided in Flash start-up courses in the prior art to improve system Reliability, reduction system cause because of Flash data mistake system start failure phenomenon, improve the stability of system And reliability.
The content of the invention
The present invention overcomes the defect that prior art is present, it is proposed that a kind of method of main-apparatus protection in Flash start-up courses, For solving the insecure problem of system in the prior art, the stability of a system is improve.
The technical scheme is that:
The method of main-apparatus protection, the loading procedure of the embedded system in a kind of start-up course based on Flash Performed in Bootloader based on the step of main-apparatus protection, the step includes in Flash start-up courses:In Flash chip System main partition, the back-up area of storage firmware program and/or data are set, and are set and the firmware program and/or data The corresponding system firmware of check value original checksums value;
The data in Bootloader read-out systems main partition, consolidating of storing in system main partition is calculated by verification value-based algorithm The check value of part program and/or data;
Bootloader compares the original checksums value of the system firmware read from Flash chip and by verification value-based algorithm meter The firmware program and/or the check value of data stored in calculation system main partition, when both check values are consistent, The firmware program and/or data stored in Bootloader selection loading systems main partition, start from system main partition;When both Check value it is inconsistent, Bootloader selection from system back-up area start.
The Flash chip is provided with four subregions, the storage Bootloader executable files of subregion 1, and subregion 2 is as being Unite main partition storage system firmware program, subregion 3 as system back-up area storage system firmware program, subregion 4 storage institute State the original checksums value of the firmware program of system.
The original checksums value is, in the firmware program of the system of generation, to obtain and preserve by verifying value-based algorithm calculating.
The Bootloader carrys out start-up operation from selected system main partition or system back-up area loading firmware program System, completion system starts.
The operating system is linux system.
Check value is CRC32 check values.
The advantage that the present invention possesses is:
The inventive method is used, if the Flash of system writes Flash failures because of escalation process power down, or upgrading, or Person's other externalist methodologies such as emulator erases the reasons such as Flash primary areas content, result in Flash primary areas corrupted data, is System can be verified by CRC32, and the data for automatically detecting Flash primary areas are changed or imperfect, so as to select from standby Part area starts, and is not in that system hangs dead phenomenon because firmware is damaged.Judge Flash primary areas process provides automatic detection Whether data are damaged, and automatically switch to back-up area Booting sequence, improve the reliability of communication system.
Brief description of the drawings
Fig. 1 is NAND Flash partition schematic diagrames;
Fig. 2 is that system starts general introduction flow chart;
Fig. 3 is that system starts detail flowchart;
Specific embodiment
Understand for the ease of those of ordinary skill in the art and implement the present invention, below in conjunction with the accompanying drawings and specific embodiment The present invention is described in further detail.
The method that the present invention proposes offer main-apparatus protection in a kind of Flash start-up courses, mainly in start Increase following function in Bootloader programs:To the data integrity CRC32 verifications of Flash main partitions, verified according to CRC32 Result selects to start from primary area or preparation area.
Step 1.1:Use to NAND Flash carries out program and district, refers to Fig. 1, by NAND Flash according to function 4 regions are divided into, wherein, the storage Bootloader executable files of subregion 1, size is 1MB, correspond to Flash first address 0x0 addresses;The firmware program of the storage system of subregion 2, as the first-selected subregion (main partition) that system starts;The storage system of subregion 3 Backup firmware program (backup firmware program herein is consistent with the firmware program in main partition);As the standby of system startup Select subregion (back-up area);Subregion 4 deposits the original CRC32 values of firmware.Aforementioned four subregion must be deposited in except subregion 1 Beyond Flash first address, other subregions can be arranged arbitrarily as needed, preferably according to subregion 1, subregion 2, subregion 4, subregion 3 Order be sequentially arranged.
Step 1.1.1:Calculate the CRC32 of firmware program initial data.In order to ensure the correct of data, would have to use The means of error detection.In many error detection means, CRC is foremost one kind, and the full name of CRC is CRC.CRC32 refers to Be the value that CRC is represented with 32 data.The generator polynomial of the CRC algorithm of standard:
By CRC32 formula, using original firmware program as input, to firmware program, each byte content is calculated, most A unsigned integer value of 32bit is drawn eventually, and it is used as judging the standard whether content of firmware is changed.During startup Wait, whether need to only compare CRC32 that Flash main partitions calculate consistent with the original CRC32 values deposited in subregion 4 Complete to judge.
Step 1.2:Upper electricity resets, and system starts from subregion 1, and Bootloader starts to perform, and Bootloader is first Choosing judges whether Flash main partitions (subregion 2) data are complete, if main partition data check passes through, consolidating in loading main partition Part program is performed to internal memory;If main partition data check fails, judge whether back-up area (subregion 3) data are complete, if Back-up area data check passes through, selection from back-up area loading firmware program, as shown in Figure 2.
Step 1.2.1:Bootloader reads the data of Flash main partition A (subregion 2), and according to the public affairs of CRC32 computings Formula, calculates CRC32 values, as shown in Fig. 3 steps 101.
Step 1.2.2:Bootloader reads the original CRC32 values of firmware in firmware CRC subregions (subregion 4), this value It is when firmware program is generated, to be calculated by CRC32 algorithms, and preserves, is written into together with firmware program To in Flash, as shown in Fig. 3 steps 102.
Step 1.2.3:Bootloader compares the original CRC32 values of firmware and is read according to Flash main partitions (subregion 2) The CRC32 values that calculate of data, as shown in Fig. 3 steps 103.
Step 1.2.4:If both CRC32 values are consistent, illustrate that main partition data are normal, Bootloader selections add The firmware program in main partition is carried, is started from main partition, as shown in Fig. 3 steps 104.
Step 1.2.5:If both CRC32 values are inconsistent, illustrate that main partition data are incomplete, Bootloader choosings Select and skip main partition content, start from back-up area, as shown in figure step 105.Note, due to backup area, software will not change or Person upgrades, so the situation that backup area is not in content to be changed, it is only used as system emergency backup and starts, so as to ensure that Stability.
Step 1.3:Bootloader starts from the subregion start-up operation system (such as Linux) for selecting, completion system.
Although the present invention has been illustrated in detail in and has described the specific embodiment reference of correlation, the technology of this area Personnel in without departing substantially from the spirit and scope of the present invention it should be appreciated that can in the form and details make various changing Become.These changes fall within the protection domain required by claim of the invention.

Claims (6)

1. in a kind of start-up course based on Flash main-apparatus protection method, it is characterised in that:The loading journey of the embedded system Performed in sequence Bootloader based on the step of main-apparatus protection, the step includes in Flash start-up courses:In Flash chip In set storage firmware program and/or data system main partition, back-up area, and set and the firmware program and/or number According to the corresponding system firmware of check value original checksums value;
The data in Bootloader read-out systems main partition, the firmware journey stored in system main partition is calculated by verification value-based algorithm The check value of sequence and/or data;
Bootloader compares the original checksums value of the system firmware read from Flash chip and is calculated by verification value-based algorithm The firmware program and/or the check value of data stored in system main partition, when both check values are consistent, Bootloader choosings The firmware program and/or data stored in loading system main partition are selected, is started from system main partition;When both check values differ Cause, Bootloader selections start from system back-up area.
2. in a kind of start-up course based on Flash according to claim 1 main-apparatus protection method, it is characterised in that:Institute State Flash chip and be provided with four subregions, the storage Bootloader executable files of subregion 1, subregion 2 is deposited as system main partition The firmware program of place system, as the firmware program of system back-up area storage system, subregion 4 deposits consolidating for the system to subregion 3 The original checksums value of part program.
3. in a kind of start-up course based on Flash according to claim 2 main-apparatus protection method, it is characterised in that:Institute It is, in the firmware program of the system of generation, to obtain and preserve by verifying value-based algorithm calculating to state original checksums value.
4. in a kind of start-up course based on Flash according to claim 1 main-apparatus protection method, it is characterised in that:Institute State Bootloader and carry out start-up operation system from selected system main partition or system back-up area loading firmware program, complete system System starts.
5. in a kind of start-up course based on Flash according to claim 4 main-apparatus protection method, it is characterised in that:Institute Operating system is stated for linux system.
6. in a kind of start-up course based on Flash according to claim 1-5 main-apparatus protection method, it is characterised in that: The check value is CRC32 check values.
CN201611048195.2A 2016-11-23 2016-11-23 A kind of method of main-apparatus protection in start-up course based on Flash Pending CN106776122A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611048195.2A CN106776122A (en) 2016-11-23 2016-11-23 A kind of method of main-apparatus protection in start-up course based on Flash

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611048195.2A CN106776122A (en) 2016-11-23 2016-11-23 A kind of method of main-apparatus protection in start-up course based on Flash

Publications (1)

Publication Number Publication Date
CN106776122A true CN106776122A (en) 2017-05-31

Family

ID=58975541

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611048195.2A Pending CN106776122A (en) 2016-11-23 2016-11-23 A kind of method of main-apparatus protection in start-up course based on Flash

Country Status (1)

Country Link
CN (1) CN106776122A (en)

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107315616A (en) * 2017-06-30 2017-11-03 郑州云海信息技术有限公司 A kind of loading method of firmware, device and electronic equipment
CN108491289A (en) * 2018-03-22 2018-09-04 北京顶象技术有限公司 Firmware guard method and device
CN108958982A (en) * 2018-07-26 2018-12-07 深圳控道智能科技有限公司 A kind of BIOS reinforcement means and system
CN109189405A (en) * 2018-07-19 2019-01-11 山东省科学院自动化研究所 A kind of method and system of proving program Flash data consistency
CN110442482A (en) * 2019-07-31 2019-11-12 苏州中科全象智能科技有限公司 A kind of the mistake proofing framework and its control method of high-speed industrial camera firmware
CN111061514A (en) * 2019-10-30 2020-04-24 翱捷智能科技(上海)有限公司 Flash device, integrated circuit and Flash device starting method
CN111316235A (en) * 2019-03-29 2020-06-19 深圳市大疆创新科技有限公司 Method for starting system, electronic device and machine-readable storage medium
CN111324488A (en) * 2020-02-12 2020-06-23 浙江大华技术股份有限公司 Program backup processing method and device
CN111580844A (en) * 2020-05-09 2020-08-25 上海航天电子通讯设备研究所 Software and hardware cooperative application program maintenance method supporting on-orbit dynamic update
CN112698985A (en) * 2020-12-21 2021-04-23 厦门锐骐物联技术股份有限公司 System starting method and system based on multi-partition technology firmware protection
CN113805967A (en) * 2021-09-17 2021-12-17 远峰科技股份有限公司 MPU (micro processing Unit) safe starting method and MPU safe starting system
CN113883691A (en) * 2021-10-26 2022-01-04 Tcl空调器(中山)有限公司 Air conditioner parameter reading method and device, air conditioner and storage medium
CN115113904A (en) * 2022-08-29 2022-09-27 成都星联芯通科技有限公司 Firmware upgrading processing method and device, electronic equipment and storage medium
CN116700061A (en) * 2023-04-12 2023-09-05 广东为辰信息科技有限公司 Quick starting method based on safe starting technology

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101650662A (en) * 2009-08-26 2010-02-17 中兴通讯股份有限公司 Memory device of embedded system and staring method and upgrading of firmware
CN103678030A (en) * 2012-09-04 2014-03-26 杭州海康威视数字技术股份有限公司 Multi-system equipment start system and method thereof
CN104750574A (en) * 2015-03-03 2015-07-01 普联技术有限公司 Firmware recovery method and device of network equipment
CN105589765A (en) * 2015-12-17 2016-05-18 迈普通信技术股份有限公司 Method for realizing program backup

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101650662A (en) * 2009-08-26 2010-02-17 中兴通讯股份有限公司 Memory device of embedded system and staring method and upgrading of firmware
CN103678030A (en) * 2012-09-04 2014-03-26 杭州海康威视数字技术股份有限公司 Multi-system equipment start system and method thereof
CN104750574A (en) * 2015-03-03 2015-07-01 普联技术有限公司 Firmware recovery method and device of network equipment
CN105589765A (en) * 2015-12-17 2016-05-18 迈普通信技术股份有限公司 Method for realizing program backup

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107315616A (en) * 2017-06-30 2017-11-03 郑州云海信息技术有限公司 A kind of loading method of firmware, device and electronic equipment
CN107315616B (en) * 2017-06-30 2020-08-21 苏州浪潮智能科技有限公司 Firmware loading method and device and electronic equipment
CN108491289A (en) * 2018-03-22 2018-09-04 北京顶象技术有限公司 Firmware guard method and device
CN109189405A (en) * 2018-07-19 2019-01-11 山东省科学院自动化研究所 A kind of method and system of proving program Flash data consistency
CN108958982A (en) * 2018-07-26 2018-12-07 深圳控道智能科技有限公司 A kind of BIOS reinforcement means and system
CN111316235A (en) * 2019-03-29 2020-06-19 深圳市大疆创新科技有限公司 Method for starting system, electronic device and machine-readable storage medium
CN110442482A (en) * 2019-07-31 2019-11-12 苏州中科全象智能科技有限公司 A kind of the mistake proofing framework and its control method of high-speed industrial camera firmware
CN111061514A (en) * 2019-10-30 2020-04-24 翱捷智能科技(上海)有限公司 Flash device, integrated circuit and Flash device starting method
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
CN111580844A (en) * 2020-05-09 2020-08-25 上海航天电子通讯设备研究所 Software and hardware cooperative application program maintenance method supporting on-orbit dynamic update
CN111580844B (en) * 2020-05-09 2024-02-02 上海航天电子通讯设备研究所 Software and hardware collaborative application program maintenance method supporting on-orbit dynamic update
CN112698985A (en) * 2020-12-21 2021-04-23 厦门锐骐物联技术股份有限公司 System starting method and system based on multi-partition technology firmware protection
CN113805967A (en) * 2021-09-17 2021-12-17 远峰科技股份有限公司 MPU (micro processing Unit) safe starting method and MPU safe starting system
CN113883691A (en) * 2021-10-26 2022-01-04 Tcl空调器(中山)有限公司 Air conditioner parameter reading method and device, air conditioner and storage medium
CN113883691B (en) * 2021-10-26 2023-02-17 Tcl空调器(中山)有限公司 Air conditioner parameter reading method and device, air conditioner and storage medium
CN115113904A (en) * 2022-08-29 2022-09-27 成都星联芯通科技有限公司 Firmware upgrading processing method and device, electronic equipment and storage medium
CN116700061A (en) * 2023-04-12 2023-09-05 广东为辰信息科技有限公司 Quick starting method based on safe starting technology
CN116700061B (en) * 2023-04-12 2024-05-03 广东为辰信息科技有限公司 Quick starting method based on safe starting technology

Similar Documents

Publication Publication Date Title
CN106776122A (en) A kind of method of main-apparatus protection in start-up course based on Flash
JP5607863B2 (en) Secure recovery apparatus and method
US8694766B2 (en) Device bootup from a NAND-type non-volatile memory
US7313682B2 (en) Method and system for updating boot memory that stores a fail-safe reset code and is configured to store boot code and boot updater code
CN104216800A (en) Automatic system fault recovering method and device based on data redundancy
CN102298545B (en) System startup boot processing method and device
CN103678030A (en) Multi-system equipment start system and method thereof
US8826080B2 (en) Methods and systems for preboot data verification
US11099949B2 (en) Method apparatus for resuming and recovery checking from interrupted programming of one-time programmable memory device
CN106021014A (en) Memory management method and device
CN105786545B (en) Breakpoint recovery method and system based on heterogeneous hybrid memory
US8788800B2 (en) OS processing method, system and non-transitory computer readable storage medium thereof
CN114895845A (en) EMmC data storage control method and embedded mainboard
WO2015184732A1 (en) Bootstrap storage method, bootstrap fault recovery method and device, and computer storage medium
CN109933374B (en) Computer starting method
CN108255644B (en) File system recovery method and device
US6539338B1 (en) Self-diagnostic testing of a network interface adapter
CN108647119A (en) The startup method, apparatus and equipment of linux system
CN106445737A (en) Multi-backup starting method
CN103220569B (en) The automatic recovery method of a kind of Set Top Box and equipment
CN109683980B (en) Method for realizing reliable loading of U disk configuration file of trackside safety platform
CN114741091A (en) Firmware loading method and device, electronic equipment and computer readable storage medium
CN109117190A (en) System start method and device
CN106250193A (en) A kind of system start method based on nand memory and system
CN106844088B (en) Data sending method and device of RAID storage system

Legal Events

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

Application publication date: 20170531

RJ01 Rejection of invention patent application after publication