CN114003249B - PSoC-based high-reliability mirror image loading method - Google Patents

PSoC-based high-reliability mirror image loading method Download PDF

Info

Publication number
CN114003249B
CN114003249B CN202111304625.3A CN202111304625A CN114003249B CN 114003249 B CN114003249 B CN 114003249B CN 202111304625 A CN202111304625 A CN 202111304625A CN 114003249 B CN114003249 B CN 114003249B
Authority
CN
China
Prior art keywords
image file
mark
verification
area
psoc
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.)
Active
Application number
CN202111304625.3A
Other languages
Chinese (zh)
Other versions
CN114003249A (en
Inventor
朱晓巍
于乐
周海兵
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Aeronautical Radio Electronics Research Institute
Original Assignee
China Aeronautical Radio Electronics Research Institute
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 China Aeronautical Radio Electronics Research Institute filed Critical China Aeronautical Radio Electronics Research Institute
Priority to CN202111304625.3A priority Critical patent/CN114003249B/en
Publication of CN114003249A publication Critical patent/CN114003249A/en
Application granted granted Critical
Publication of CN114003249B publication Critical patent/CN114003249B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/63Image based installation; Cloning; Build to order
    • 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/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a PSoC-based high-reliability mirror image loading mode, which comprises the following steps of when a first mirror image file is first burnt: writing a first mirror image file in an actual working area in a touch area of the external loading device, and writing a backup mirror image file in a touch forbidden area; after the first image file and the backup image file are successfully written, a mark in a verification area is set as correct data required for verification in a first-stage starter; PSoC start-up: and searching an external loading device, when the mark head of the first image file is found to be effective, starting to load the FSBL, when the mark head is loaded to the verification mark, verifying the verification mark in the FSBL and the mark in the verification area in the first image file, and if the verification passes the verification, stopping the loading, and continuing to search the effective mark head of the next image file until the backup image file is found. The invention greatly improves the safety and stability of online upgrade.

Description

PSoC-based high-reliability mirror image loading method
Technical Field
The invention relates to the technical field of task processing of avionics systems, in particular to a high-reliability mirror image loading method based on PSoC (programmable system on a chip).
Background
Along with the continuous development of avionics, the overall development trend of the aviation industry tends to be more intelligent, and the technology level is embodied in electronization and software so as to reduce space occupation and improve integration level, and the FPGA (programmable logic device) is widely applied to the field of avionics due to flexible configuration and high reliability. In the traditional architecture, we learn a conventional CPU chip and an FPGA chip to realize the required functions, but the PSoC platform concept appears, so that a new choice is provided for us: a PSoC system is formed by ARM+FPGA, and great convenience is brought to the reduction of power consumption and space occupation, namely, the high integration design.
PSoC is mature and perfect continuously, and provides a plurality of convenient design measures for us, wherein the design measures comprise an online upgrade function interface, namely an upgrade image is directly written into a memory (Flash) by using an operating system programming function, so that the method greatly reduces maintenance cost, is widely applied, but brings the problems of unstable firmware upgrade, easy failure return to factories and the like, and prevents the continuous advancing and developing speed of the firmware upgrade.
Disclosure of Invention
The invention aims to provide a PSoC-based high-reliability mirror image loading method, which provides technical support for upgrading core components of a central processing board in an airborne processing system, saves manpower and physics for maintenance of a chassis board card by technical maintenance personnel, and greatly improves the safety and stability of online upgrading.
The invention aims at realizing the following technical scheme:
when a first image file is first burnt, a PSoC-based high-reliability image loading mode is adopted:
1) Writing a first mirror image file in an actual working area in a touch area of the external loading device, and writing a backup mirror image file in a touch forbidden area; wherein: the first image file consists of a mark head, a first stage starter and a second stage starter which contain check marks, and the backup image file consists of a mark head, an FSBL and an SSBL which do not contain check marks; the touch area is the front half part of the external loading device and comprises an actual working area for updating and upgrading the image file and a verification area, and the touch inhibition area is the rear half part of the external loading device;
2) After the first image file and the backup image file are successfully written, a mark in a verification area is set as correct data required for verification in a first-stage starter;
PSoC start-up: and searching an external loading device, when the mark head of the first image file is found to be effective, starting to load the FSBL, when the mark head is loaded to the verification mark, verifying the verification mark in the FSBL and the mark in the verification area in the first image file, and if the verification passes the verification, stopping the loading, and continuing to search the effective mark head of the next image file until the backup image file is found.
Further, when the first image file is updated online: writing an incorrect check value into the check area before writing the first image file, and correcting the mark of the check area back to the correct check value after the first image file is completely written.
The invention has the beneficial effects that:
because of adopting the multi-mirror image loading mechanism, the design technology of the invention has higher upgrading convenience and safety compared with the traditional loading mode, and the risk that the system cannot be started due to the damage of the system firmware in the upgrading process does not exist;
because PSoC loading only identifies the characteristic of the marking head, in order to avoid interruption faults after marking head programming is finished, an updating marking verification technology is adopted to complete mirror image verification, loading is further completed only when verification passes, and the fault that inherent mirror images cannot be loaded due to system locking is prevented. Compared with the original loading mode, the scheme is safer and more reliable, and is more beneficial to long-term stable operation, updating and upgrading of the system.
Drawings
FIG. 1 is a schematic diagram of a Flash space distribution according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of an image file structure according to an embodiment of the present invention;
fig. 3 is a schematic diagram of the whole process according to an embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples.
The invention discloses a PSoC-based high-reliability mirror image loading mode, and the core innovation comprises a multi-mirror image reloading technology and an update mark verification technology.
A. Multi-mirror reloading technique: the PSoC supports loading of an external Flash device, a loaded mirror image is solidified in Flash, an external Flash storage component is automatically read by scanning in the power-on starting process of the PSoC, and when an effective mirror image marking head is searched in a component storage area, the system automatically carries out mirror image loading; if the system does not detect a valid image, the system automatically continues searching backwards until a valid image header is searched, and if the valid image is not found finally, the PSoC reports error information in the start-up status register.
B. Update tag verification technique: according to the multi-image reloading technical description in A, when PSoC searches for an effective image, only whether an effective marking head exists is inquired, when the marking head is effective but other area data in the image are damaged, for example, the image programming process is suddenly interrupted, so that the programming process is only half completed, a system start fault can occur, and the state is recovered until the system is powered on again. In order to solve the problem, a verification mark is added at a specific position in the PSoC, the FSBL (first stage loader) is used for carrying out mark verification in the PSoC starting process, a verification passing party can execute the verification, and otherwise, the verification passing party automatically jumps to a backup image for loading.
Taking a 32MB Flash external loading device as an example, the embodiment divides a Flash space into two parts: the system comprises a touchable area and a touchable area, wherein the touchable area is the first half part of the Flash external loading device, occupies 16MB and comprises an actual working area for updating and upgrading image files and a verification area, the touchable area is the rear 16MB space of the Flash external loading device and is a backup image loading area, and the phenomenon that the system cannot be started when the image loading fails is prevented, and the specific distribution is shown in figure 1. Referring to fig. 3, a PSoC-based high-reliability image loading method in this embodiment includes the following steps:
1) The first mirror image file primary burning process comprises the following steps: and burning the first image file in an actual working area in a collidable area of the Flash external loading device by using a PSoC-carried burner, and burning the backup image file in a forbidden area. Wherein: referring to fig. 2, the first image file is composed of a mark head, a first stage initiator (FSBL) containing a check mark, and a second stage initiator (SSBL); the backup image file consists of a tag header, an FSBL that does not contain a check tag, and an SSBL. After the first image file and the backup image file are successfully written, the mark in the Flash verification area is set as correct data required for verification in a first stage starter (FSBL), and the correct data is set as 0x5A5A5A5A.
2) And (3) performing primary programming normal start implementation: normal powering-on is carried out on the well-programmed equipment, an external Flash device is searched, and mirror image loading is carried out when the mark head of the effective first mirror image file is searched; and checking the check mark in the FSBL in the first image file and the mark in the check area, wherein the check passes the indication that the loading is normal. When the FSBL printing information is checked, the mark annotation message of the first mirror image printed by the FSBL can be seen, and the mark annotation message indicates that the system is started normally.
3) Online updating a first mirror file: when the on-line programming operation is carried out, the programming updating work of the first mirror image is required to be completed, an incorrect check value is required to be written into the check area before the first mirror image file is programmed, and after the first mirror image file is programmed, the mark of the check area is corrected back to the correct check value so as to indicate that the mirror image is successfully programmed and can be normally loaded.
4) And normally starting implementation after online updating: normally powering on the equipment which is upgraded on line, searching for an external Flash device, and carrying out mirror image loading when the mark head of the effective first mirror image file is searched; and checking the check mark in the FSBL in the first image file and the mark in the check area, wherein the check passes the indication that the loading is normal. When the FSBL printing information is checked, the mark annotation information of the first image printed by the FSBL can still be seen, and the mark annotation information indicates that the first image can still be started normally.
5) And (3) checking fault starting implementation: in order to test and check faults, the data of the Flash check area are tampered manually, 0x0 data are written into the check area, and then a starting test is carried out. After the system is powered on, the system firstly detects that the mark head of the first image file is effective, and then starts to load the FSBL, when the mark head is loaded to the verification mark, the system compares the mark of the Flash verification area, the comparison result finds that 0x0 is not equal to 0x5A, the FSBL code considers that the part of the starting image data is damaged, the loading is stopped, and the effective mark head of the next image file is continuously searched until the backup image file is searched. Through testing, the result shows that the sequence logic is met, and the backup image is successfully loaded and relevant remark information is printed.
6) No first mirror boot implementation: the test is carried out under the condition that the first mirror image and the backup mirror image are included, in order to test the starting condition of the system when the whole first mirror image is destroyed, the first mirror image area is erased, namely the first 16MB of Flash is erased, the system is electrified again, and the starting condition of the system is checked. Through testing, the system can still be started normally, and the backup image can be loaded successfully and relevant remark information can be printed.
It will be understood that equivalents and modifications will occur to those skilled in the art in light of the present invention and their spirit, and all such modifications and substitutions are intended to be included within the scope of the present invention as defined in the following claims.

Claims (2)

1. A PSoC-based high-reliability mirror image loading mode is characterized in that:
when the first mirror image file is first burnt:
1) Writing a first mirror image file in an actual working area in a touch area of the external loading device, and writing a backup mirror image file in a touch forbidden area; wherein: the first image file consists of a mark head, a first stage starter and a second stage starter which contain check marks, and the backup image file consists of a mark head, an FSBL and an SSBL which do not contain check marks; the touch area is the front half part of the external loading device and comprises an actual working area for updating and upgrading the image file and a verification area, and the touch inhibition area is the rear half part of the external loading device;
2) After the first image file and the backup image file are successfully written, a mark in a verification area is set as correct data required for verification in a first-stage starter;
PSoC start-up: and searching an external loading device, when the mark head of the first image file is found to be effective, starting to load the FSBL, when the mark head is loaded to the verification mark, verifying the verification mark in the FSBL and the mark in the verification area in the first image file, and if the verification passes the verification, stopping the loading, and continuing to search the effective mark head of the next image file until the backup image file is found.
2. The PSoC-based high reliability image loading method of claim 1, wherein:
when the first image file is updated online: writing an incorrect check value into the check area before writing the first image file, and correcting the mark of the check area back to the correct check value after the first image file is completely written.
CN202111304625.3A 2021-11-05 2021-11-05 PSoC-based high-reliability mirror image loading method Active CN114003249B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111304625.3A CN114003249B (en) 2021-11-05 2021-11-05 PSoC-based high-reliability mirror image loading method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111304625.3A CN114003249B (en) 2021-11-05 2021-11-05 PSoC-based high-reliability mirror image loading method

Publications (2)

Publication Number Publication Date
CN114003249A CN114003249A (en) 2022-02-01
CN114003249B true CN114003249B (en) 2024-03-15

Family

ID=79927785

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111304625.3A Active CN114003249B (en) 2021-11-05 2021-11-05 PSoC-based high-reliability mirror image loading method

Country Status (1)

Country Link
CN (1) CN114003249B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103677902A (en) * 2013-11-25 2014-03-26 上海斐讯数据通信技术有限公司 Method for ensuring safety and success of updating of line-card software in distributed OLT system
US10521618B1 (en) * 2015-10-20 2019-12-31 Marvell International Ltd. Methods and apparatus for secure root key provisioning

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103677902A (en) * 2013-11-25 2014-03-26 上海斐讯数据通信技术有限公司 Method for ensuring safety and success of updating of line-card software in distributed OLT system
US10521618B1 (en) * 2015-10-20 2019-12-31 Marvell International Ltd. Methods and apparatus for secure root key provisioning

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于FPGA控制的ARM动态启动加载技术;阎哲;张力;张翔南;高淑敏;;计算机工程与设计;20180416(04);全文 *

Also Published As

Publication number Publication date
CN114003249A (en) 2022-02-01

Similar Documents

Publication Publication Date Title
US9207933B2 (en) Identifying authors of changes between multiple versions of a file
WO2021169260A1 (en) System board card power supply test method, apparatus and device, and storage medium
CN108646982B (en) Automatic data restoration method and device based on UBIFS
EP1591893A1 (en) Method and system for fail-safe updating of boot code
US20080072030A1 (en) Computer System and Method for Updating Program Code
CN108874582A (en) A kind of system recovery method, device and terminal
CN112015447B (en) System updating method and device of electronic equipment, electronic equipment and storage medium
CN114003249B (en) PSoC-based high-reliability mirror image loading method
CN114895845A (en) EMmC data storage control method and embedded mainboard
CN115242753B (en) Network card MAC address burning method, system, electronic equipment and storage medium
CN114741339B (en) PCIE bandwidth retraining method, device, equipment and storage medium
CN111783162B (en) Data protection implementation method and device and computer equipment
CN106293531B (en) A method of prevent flash in SD use process from surprisingly being distorted based on flash write-protect
CN115437818A (en) Automatic restoration method, system, storage medium and equipment for VxWorks system start failure
CN101661399B (en) Method for modular software removal
CN114741091A (en) Firmware loading method and device, electronic equipment and computer readable storage medium
CN107168824A (en) A kind of power-off protection method and device
CN109683980B (en) Method for realizing reliable loading of U disk configuration file of trackside safety platform
CN100458719C (en) Method and system obtaining and compliling basic input and output system information
CN114218018B (en) System data protection method and device, readable storage medium and electronic equipment
CN110825387B (en) Method for quickly positioning over programming of storage device of terminal equipment
CN107391216A (en) A kind of method for upgrading software and device
WO2021227926A1 (en) Method for restarting system, terminal and storage medium
CN117170728A (en) Branch processing method, electronic device and computer readable storage medium
US10942810B2 (en) Start-up processing for information processing apparatus and method, and storage medium

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
GR01 Patent grant
GR01 Patent grant