Online upgrading method and device based on ZYNQ

By storing the boot firmware, application firmware and backup program firmware in ZYNQ's ROM, and searching and verifying the firmware after ZYNQ powers on, the problem of partially overwriting of the firmware after the ZYNQ online upgrade failure in the prior art is solved, and the device can still work normally after the upgrade failure and improve the application loading speed.

CN119645472AInactive Publication Date: 2025-03-18HANGZHOU AIHUA INSTR

Patent Information

Application Number
CN202510169217.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-17
Publication Date
2025-03-18
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing ZYNQ online upgrade technology has the problem of single firmware loading combination, partially overwritten firmware after the online upgrade failed, resulting in the device not working properly, and unreasonable loading logic, resulting in the human-computer interaction software not being able to catch the window period.

Method used

Provides an online upgrade method based on ZYNQ. By storing boot firmware, application firmware and backup program firmware in the ROM, and searching and verification of firmware after ZYNQ is powered on. If the application firmware verification fails, jump to the backup program firmware to ensure that the device can still work normally after the upgrade failed.

Benefits of technology

It realizes that in ZYNQ online upgrade, it can jump to the correct firmware location for loading regardless of whether the application firmware is damaged, avoids the problem of the device not working properly due to the failure of the upgrade, and improves the speed of application loading, avoiding the problem that human-computer interaction software cannot catch the window period.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119645472A_ABST
    Figure CN119645472A_ABST
Patent Text Reader

Abstract

The invention discloses an online upgrading method and device based on ZYNQ, relates to the technical field of ZYNQ online upgrading, and solves the problems that in the prior art, after ZYNQ firmware upgrading fails, equipment crashes, and ZYNQ firmware loading logic is unreasonable. The method comprises the steps that ZYNQ firmware is designed into three parts, all the firmware achieve different functions, and all the firmware achieve different functions; the method comprises the following steps that: a ZYNQ firmware is divided into boot firmware, application program firmware and backup program firmware which are respectively stored in an ROM (Read Only Memory), after the ZYNQ is powered on, the firmware is searched and verified from an initial address of the ROM, the ZYNQ firmware is operated after the verification is passed, the normal operation of a program is realized by loading the backup program firmware after the application program firmware fails to be loaded, and when the firmware is upgraded, the application program firmware can be updated by loading the backup program firmware. According to the method, only the running program firmware is subjected to coverage upgrading so as to ensure that the other program firmware is not damaged, and by using a multiple loading method, it can be ensured that in online upgrading, no matter whether the upgraded application firmware is damaged or not, loading can be carried out by skipping to the position of the correct firmware.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of ZYNQ online upgrade, and in particular to an online upgrade method and device based on ZYNQ. Background Art

[0002] ZYNQ is a System on Chip (SoC) product launched by AMD Xilinx. It integrates traditional processors (ARM Cortex-A series processors) and programmable logic (FPGA, Field Programmable Gate Array) on the same chip, providing high performance, flexibility and scalability for embedded development. It is widely used in industrial control, communications, automotive electronics, consumer electronics and other fields.

[0003] Embedded devices using ZYNQ are often used in distributed deployment scenarios, such as the Internet of Things, industrial automation, and communication base stations. They need to be upgraded, optimized, or have vulnerabilities fixed, so the online upgrade function becomes very important. When implementing online upgrades of ZYNQ, reliability is the core requirement. Upgrade failures caused by harsh environments, power supply fluctuations, communication interruptions, and other issues may cause the device to fail to start or the function to be unavailable, especially in key application scenarios such as industry, communications, and autonomous driving. The impact is even more serious, so a reliable solution must be adopted to ensure the security and fault tolerance of the upgrade process.

[0004] In the prior art, a device using ZYNQ contains a set of firmware, which is divided into FSBL (boot loader) and application programs. FSBL is used for human-computer interaction software communication, application firmware reception and writing, and only contains basic peripheral drivers. It does not have application functions, and the application program is used when the device is operating normally. After the device is powered on, the FSBL program is first run, and then the application program is switched to load after a period of time. When the device is upgraded online, an error occurs in receiving and writing the application firmware, resulting in the inability to load normally. The device can be powered off and restarted, and the human-computer interaction software can be used to update the application firmware during the fixed waiting time of the FSBL program startup to avoid the device firmware error and inability to use it normally. The workflow is as follows: Figure 2 shown.

[0005] In the online upgrade process of ZYNQ in the prior art, it is easy to cause application firmware reception errors due to external abnormal reasons: device power failure, interface failure, data error, etc., and the device needs to be powered off and restarted before it can be upgraded online again. Secondly, when the online upgrade fails, the original application firmware in the device will be overwritten by the incompletely received firmware, resulting in the device having to be upgraded online again before it can be used normally. In addition, during the operation of the FSBL program, it is always necessary to wait for a period of time for the online upgrade of the human-computer interaction software, resulting in slow application loading time. Summary of the invention

[0006] The purpose of this application is to overcome the problems in the prior art that due to the single ZYNQ firmware loading combination, after the ZYNQ firmware online upgrade fails, the original program cannot work normally because the ZYNQ firmware is partially overwritten and not used as a backup, and the ZYNQ firmware loading logic is unreasonable. Setting the waiting time too short will cause the human-computer interaction software to fail to seize the window period, and setting the waiting time too long will further slow down the application loading. An online upgrade method and device based on ZYNQ are provided.

[0007] In a first aspect, an online upgrade method based on ZYNQ is provided, comprising:

[0008] Storing ZYNQ firmware in the ROM, wherein the ZYNQ firmware includes boot firmware, application firmware and backup program firmware, the boot firmware, application firmware and backup program firmware are sequentially stored in the ROM, and the application firmware and backup program firmware back up each other;

[0009] After ZYNQ is powered on, the ZYNQ firmware is searched and verified from the starting address of the ROM, and the ZYNQ firmware is run after the verification passes;

[0010] After the boot firmware runs, the boot program jumps to the storage location of the application firmware to search and verify the ZYNQ firmware;

[0011] If the application firmware passes the verification, the application firmware is loaded so that the device can run the application normally;

[0012] If the application firmware fails to be verified, the backup program firmware is indexed incrementally from the storage location of the application firmware and verified, and the backup program firmware is run after the verification passes, so that the device can run the backup program normally;

[0013] During the running of the application program or the standby program, if an upgrade instruction and the firmware to be upgraded are received, the firmware to be upgraded is written, and it is determined whether the firmware to be upgraded is written successfully;

[0014] If the writing is successful, jump to the writing address of the firmware to be upgraded to perform firmware verification and operation;

[0015] If the write fails, the original application continues to run.

[0016] In some possible implementations, the boot firmware, application firmware and backup program firmware all include, in sequence, a boot image header, an image header table, a partition header table, header authentication, a first-stage boot loader, a user bitstream file, a first MD5 checksum, an ELF file of the user application and a second MD5 checksum.

[0017] In some possible implementations, the boot firmware, application firmware, and backup program firmware are stored in sequence in the ROM, wherein the boot firmware is stored at a starting address of the ROM.

[0018] In some possible implementations, the boot firmware is used for program loading jump, and the application firmware and backup program firmware are used for the operation and online upgrade of ZYNQ.

[0019] In some possible implementations, the ZYNQ firmware search and verification method includes:

[0020] S201, searching for firmware header information starting from the firmware index address;

[0021] S202, after searching for valid firmware header information, verify the firmware header information;

[0022] S203, after the firmware header information is verified, the first stage boot loader, the user bit stream file, and the ELF file of the user application are verified and loaded in sequence;

[0023] S204. If no valid firmware header information is identified during the loading process or a verification error occurs, the firmware index address is incremented by 32KB each time, and the firmware header information is searched starting from the incremented firmware index address, and the process jumps to step S202.

[0024] In some possible implementations, indexing incrementally from the storage location of the application firmware to the backup program firmware includes:

[0025] S301, increasing the storage location of the application firmware by 32KB, and starting to search for firmware header information from the increased firmware index address;

[0026] S302, after searching for valid firmware header information, verify the firmware header information;

[0027] S303, after the firmware header information is verified, the first stage boot loader, the user bit stream file, and the ELF file of the user application are verified and loaded in sequence;

[0028] S304: If no valid firmware header information is identified during the loading process or a verification error occurs, the firmware index address is incremented by 32KB each time, and the firmware header information is searched starting from the incremented firmware index address, and the process jumps to step S302.

[0029] In some possible implementations, when the application is running, the firmware to be upgraded is written, and the firmware to be upgraded only covers the application firmware. When the standby program is running, the firmware to be upgraded is written, and the firmware to be upgraded only covers the standby program firmware.

[0030] In a second aspect, an online upgrade device based on ZYNQ is provided, comprising:

[0031] An initial write module, used for storing ZYNQ firmware in ROM, wherein the ZYNQ firmware includes boot firmware, application firmware and backup program firmware, the boot firmware, application firmware and backup program firmware are sequentially stored in ROM, and the application firmware and backup program firmware back up each other;

[0032] The bootloader startup module is used to search and verify the ZYNQ firmware from the starting address of the ROM after the ZYNQ is powered on, and run the ZYNQ firmware after the verification passes;

[0033] The application startup module is used to jump the boot program to the storage location of the application firmware to search and verify the ZYNQ firmware after the boot firmware is running;

[0034] If the application firmware passes the verification, the application firmware is loaded so that the device can run the application normally;

[0035] If the application firmware fails to be verified, the backup program firmware is indexed incrementally from the storage location of the application firmware and verified, and the backup program firmware is run after the verification passes, so that the device can run the backup program normally;

[0036] The upgrade module is used to write the firmware to be upgraded if an upgrade instruction and the firmware to be upgraded are received during the operation of the application program or the standby program, and determine whether the firmware to be upgraded is successfully written;

[0037] If the writing is successful, jump to the writing address of the firmware to be upgraded to perform firmware verification and operation;

[0038] If the write fails, the original application continues to run.

[0039] In a third aspect, a computer-readable storage medium is provided, wherein the computer-readable medium stores a program code for execution by a device, wherein the program code includes steps for executing the method in any one of the implementations of the first aspect described above.

[0040] In a fourth aspect, an electronic device is provided, comprising a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements a method as in any one of the implementations in the first aspect above.

[0041] The present application has the following beneficial effects: the online upgrade method of the present application uses a multiple loading method, which can ensure that during the online upgrade, regardless of whether the upgraded application firmware is damaged, it can jump to the correct firmware position for loading. That is, since only the application is fixedly overwritten during the online upgrade process, and the backup program firmware will not be damaged due to upgrade failure, after the application firmware is damaged, it can be loaded by incrementally indexing to the location of the backup program firmware, thereby ensuring that the device can work normally; at the same time, there is no interactive logic that requires delay during the program jump process. Compared with the existing solution, it not only greatly improves the speed of application loading, but also avoids the problem that setting the waiting time too short will cause the human-computer interaction software to fail to seize the window period. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application.

[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0044] Figure 1 is a flow chart of an online upgrade method based on ZYNQ in Example 1 of the present application;

[0045] Figure 2 It is a flow chart of the ZYNQ online upgrade method in the prior art;

[0046] Figure 3 It is a structural diagram of the ZYNQ firmware in the ZYNQ-based online upgrade method of Example 1 of the present application;

[0047] Figure 4This is a workflow diagram of the ZYNQ loader in the ZYNQ-based online upgrade method of Example 1 of the present application;

[0048] Figure 5 It is a schematic diagram of the incremental index in the online upgrade method based on ZYNQ in Example 1 of the present application;

[0049] Figure 6 It is a schematic diagram of the storage order of the boot firmware, the application firmware and the backup program firmware in the online upgrade method based on ZYNQ in Example 1 of the present application;

[0050] Figure 7 It is a flowchart of loading application firmware or backup program firmware in the online upgrade method based on ZYNQ in Example 1 of the present application;

[0051] Figure 8 It is a flowchart of online firmware upgrade in the online upgrade method based on ZYNQ in Example 1 of the present application;

[0052] Fig. 9 It is a structural block diagram of an online upgrade device based on ZYNQ in Example 2 of the present application;

[0053] Fig.10 It is a schematic diagram of the internal structure of the electronic device of Example 4 of the present application.

[0054] Reference numerals: 100, initial writing module; 200, boot program startup module; 300, application startup module; 400, upgrade module. DETAILED DESCRIPTION

[0055] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0056] Example 1

[0057] like Figure 1 As shown, an online upgrade method based on ZYNQ involved in Embodiment 1 of the present application includes:

[0058] S100, storing ZYNQ firmware in ROM, wherein the ZYNQ firmware includes boot firmware, application firmware and backup program firmware, the boot firmware, application firmware and backup program firmware are sequentially stored in ROM, and the application firmware and backup program firmware back up each other;

[0059] like Figure 6 As shown in FIG. 1 , ZYNQ firmware includes boot firmware, application firmware, and backup program firmware. Figure 3 As shown, the components of the boot firmware, application firmware and backup program firmware include: a boot image header (i.e., Boot ImageHeader), an image header table (i.e., Image Header Table), a partition header table (i.e., Partition Header Table, wherein the Image Header Table and the Partition Header Table are used to describe information such as file size, loading location and running location), a header authentication (i.e., Header Authentication, which is header verification information), a first-stage boot loader (i.e., fsbl.elf, which is a boot program), a user bit stream file (i.e., user.bit, which is a user-running program), a first MD5 checksum (i.e., MD5 Checksum, which is used to perform file correctness verification), an ELF file of the user application (i.e., user.elf is a user-running program) and a second MD5 checksum (i.e., MD5 Checksum, which is used to perform file correctness verification).

[0060] In order to make the boot firmware be searched before the application firmware and the backup program firmware, the boot firmware, the application firmware and the backup program firmware are stored in the ROM in a fixed order, wherein the boot firmware is stored at the starting address of the ROM, such as Figure 6 As shown, the application firmware is stored behind the boot firmware, the backup program firmware is stored behind the application firmware, and the boot firmware is stored at the starting address of the ROM, so that the boot firmware can be searched for the first time, thereby shortening the time required to load the boot firmware. The boot firmware only has a program loading jump function; the application firmware and the backup program firmware back up each other, both of which can enable the device to run normally and have an online upgrade function.

[0061] S200, after ZYNQ is powered on, search and verify the ZYNQ firmware from the starting address of ROM, and run the ZYNQ firmware after the verification passes;

[0062] Specifically, the ZYNQ loader works as follows: Figure 4As shown in the figure, after ZYNQ is powered on, the default firmware index address in the ROM is 0, that is, the ROM starting address. ZYNQ starts to search for firmware header information from there. After obtaining a valid firmware header and the header verification information is correct, fsbl.elf, user.bit, and user.elf are verified and loaded in turn. If no valid header information is recognized during the loading process or a verification error occurs, the firmware index address will be incremented automatically, and the increment amount is fixed to 32kB each time, and valid header information will continue to be obtained from the new index address, such as Figure 5 As shown, until the complete ZYNQ firmware is stored at the index address of the ROM (it should be noted that since the boot firmware is stored before the application firmware and the backup firmware, the first ZYNQ firmware searched will be the boot firmware), the program can be loaded correctly. This loading method can be controlled by instructions, and the firmware index address can also be arbitrarily modified in a 32kB aligned manner. On the basis of the controllable loading method, the firmware with different functions is stored in a specific order. In this embodiment, the boot firmware, application firmware and backup firmware are stored in the ROM in a fixed order and switched during operation to achieve multiple program loading, so that the system has the functions of online upgrade and backup switching when the upgrade fails, so as to achieve the purpose of reliable online upgrade.

[0063] S300, after the boot firmware runs, the boot program jumps to the storage location of the application firmware to search and verify the ZYNQ firmware;

[0064] If the application firmware passes the verification, the application firmware is loaded so that the device can run the application normally;

[0065] If the application firmware fails to be verified, the backup program firmware is indexed incrementally from the storage location of the application firmware and verified, and the backup program firmware is run after the verification passes, so that the device can run the backup program normally;

[0066] Specifically, since the boot firmware has a program loading jump function, after the boot firmware is loaded and run, it jumps to the application firmware storage location through a multiple loading method to load the application firmware. After the application is loaded, the device runs the application normally. If there is an error or missing in the application firmware during the loading process, the multiple loading method will continue to index valid header data from the ROM storage space after the application firmware. Since in this embodiment, the backup program firmware is also stored in the ROM storage space after the application firmware, and the backup program firmware has not been upgraded, the integrity of the backup program firmware can be guaranteed. After searching for the backup program firmware storage location, the backup program is loaded, thereby ensuring the normal operation of the device. The application running process is as follows: Figure 7 shown.

[0067] Specifically, if there is an error or missing in the application firmware during the loading process, the storage location of the application firmware is incrementally indexed to the backup program firmware, including the following steps:

[0068] S301, increasing the storage location of the application firmware by 32KB, and starting to search for firmware header information from the increased firmware index address;

[0069] S302, after searching for valid firmware header information, verify the firmware header information;

[0070] S303, after the firmware header information is verified, the first stage boot loader, the user bit stream file, and the ELF file of the user application are verified and loaded in sequence;

[0071] S304: If no valid firmware header information is identified during the loading process or a verification error occurs, the firmware index address is incremented by 32KB each time, and the firmware header information is searched starting from the incremented firmware index address, and the process jumps to step S302.

[0072] S400, during the running of the application program or the standby program, if an upgrade instruction and firmware to be upgraded are received, a write operation of the firmware to be upgraded is performed, and it is determined whether the firmware to be upgraded is written successfully;

[0073] If the writing is successful, jump to the writing address of the firmware to be upgraded to perform firmware verification and operation;

[0074] If the write fails, the original application continues to run.

[0075] Specifically, when the device needs to be upgraded online, the human-computer interaction software is used to send the ZYNQ firmware to ZYNQ. The application or backup program currently running on the device writes the firmware to be upgraded to the storage location of the application firmware. After the writing is completed, it also jumps to the new application firmware storage location through the multiple loading method and directly starts running the updated application. In the application running process, the firmware to be upgraded is written, and the firmware to be upgraded only overwrites the application firmware. In the backup program running process, the firmware to be upgraded is written, and the firmware to be upgraded only overwrites the backup program firmware, thereby ensuring that after the upgrade fails, at least one of the application firmware and the backup program firmware will not be damaged due to the upgrade failure, thereby ensuring that the normal operation of the application in the device can be achieved through another complete firmware after the upgrade fails. When the upgrade process fails due to data transmission interruption, the device can work normally because the current program running state is not damaged; when the firmware is written incorrectly due to data errors, the boot program firmware and the backup program firmware storage area are not overwritten and damaged, and the program can jump to the backup application normally according to the multiple loading method, and the device can still work normally, thereby achieving high-reliability online upgrades. The online upgrade process is as follows: Figure 8 shown.

[0076] In this embodiment, a multiple loading method is used to ensure that during online upgrades, no matter whether the upgraded application firmware is damaged or not, it can jump to the complete firmware location for loading, thereby ensuring that the device can work normally; at the same time, there is no interactive logic that requires delay during the program jump process, so the loading efficiency has a great advantage over the existing ZYNQ online upgrade solution. That is, since there is no interactive logic that requires delay during the program jump process, not only the waiting time from the boot firmware to the application firmware is eliminated, the speed of application loading is greatly improved, but also the problem of setting the waiting time too short will cause the human-computer interaction software to fail to seize the window period is avoided.

[0077] Example 2

[0078] like Fig. 9 As shown, an online upgrade device based on ZYNQ involved in Embodiment 2 of the present application includes:

[0079] The initial writing module 100 is used to store the ZYNQ firmware in the ROM, wherein the ZYNQ firmware includes a boot firmware, an application firmware and a backup program firmware, the boot firmware, the application firmware and the backup program firmware are sequentially stored in the ROM, and the application firmware and the backup program firmware back up each other;

[0080] The boot program startup module 200 is used to search and verify the ZYNQ firmware from the starting address of the ROM after the ZYNQ is powered on, and run the ZYNQ firmware after the verification passes;

[0081] The application startup module 300 is used to, after the boot firmware is running, cause the boot program to jump to the storage location of the application firmware to search and verify the ZYNQ firmware;

[0082] If the application firmware passes the verification, the application firmware is loaded so that the device can run the application normally;

[0083] If the application firmware fails to be verified, the backup program firmware is indexed incrementally from the storage location of the application firmware and verified, and the backup program firmware is run after the verification passes, so that the device can run the backup program normally;

[0084] The upgrade module 400 is used to write the firmware to be upgraded if an upgrade instruction and the firmware to be upgraded are received during the operation of the application program or the standby program, and determine whether the firmware to be upgraded is successfully written;

[0085] If the writing is successful, jump to the writing address of the firmware to be upgraded to perform firmware verification and operation;

[0086] If the write fails, the original application continues to run.

[0087] It should be noted that, for other specific implementations of the online upgrade device based on ZYNQ in this embodiment, reference can be made to the specific implementations of the online upgrade method based on ZYNQ mentioned above, which will not be described again here to avoid redundancy.

[0088] Example 3

[0089] A computer-readable storage medium involved in Embodiment 3 of the present application, the computer-readable storage medium stores a program code for execution by a device, the program code including steps for executing a method in any one of the implementations in Embodiment 1 of the present application;

[0090] Among them, the computer-readable storage medium can be a read-only memory (ROM), a static storage device, a dynamic storage device or a random access memory (RAM); the computer-readable storage medium can store program code, and when the program stored in the computer-readable storage medium is executed by the processor, the processor is used to execute the steps of the method in any one of the implementation methods in Example 1 of the present application.

[0091] Example 4

[0092] like Fig.10As shown, an electronic device involved in Embodiment 4 of the present application includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, and when the program or instruction is executed by the processor, a method in any one of the implementations in Embodiment 1 of the present application is implemented;

[0093] Among them, the processor can adopt a general-purpose central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), a graphics processing unit (GPU) or one or more integrated circuits to execute relevant programs to implement the method in any one of the implementation methods in Example 1 of the present application.

[0094] The processor may also be an integrated circuit electronic device with signal processing capability. In the implementation process, each step of the method in any implementation of Embodiment 1 of the present application may be completed by an integrated logic circuit of hardware in the processor or by instructions in software form.

[0095] The above-mentioned processor may also be a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed by a hardware decoding processor, or may be executed by a combination of hardware and software modules in a decoding processor. The software module may be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor reads the information in the memory, and completes the functions required to be performed by the unit included in the data processing device of the embodiment of the present application in combination with its hardware, or executes the method in any one of the implementation modes in the embodiment 1 of the present application.

[0096] The above are only preferred specific implementations of the present application; however, the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical solution and its improved ideas of the present application within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.

Claims

1. An online upgrade method based on ZYNQ, characterized in that: include: Storing ZYNQ firmware in the ROM, wherein the ZYNQ firmware includes boot firmware, application firmware and backup program firmware, the boot firmware, application firmware and backup program firmware are sequentially stored in the ROM, and the application firmware and backup program firmware back up each other; After ZYNQ is powered on, the ZYNQ firmware is searched and verified from the starting address of the ROM, and the ZYNQ firmware is run after the verification passes; After the boot firmware runs, the boot program jumps to the storage location of the application firmware to search and verify the ZYNQ firmware; If the application firmware passes the verification, the application firmware is loaded so that the device can run the application normally; If the application firmware fails to be verified, the backup program firmware is indexed incrementally from the storage location of the application firmware and verified, and the backup program firmware is run after the verification passes, so that the device can run the backup program normally; During the running of the application program or the standby program, if an upgrade instruction and the firmware to be upgraded are received, the firmware to be upgraded is written, and it is determined whether the firmware to be upgraded is written successfully; If the writing is successful, jump to the writing address of the firmware to be upgraded to perform firmware verification and operation; If the write fails, the original application continues to run.

2. The ZYNQ-based online upgrade method according to claim 1, characterized in that: The boot firmware, application firmware and backup program firmware all include a boot image header, an image header table, a partition header table, a header authentication, a first-stage boot loader, a user bitstream file, a first MD5 checksum, an ELF file of the user application and a second MD5 checksum in sequence.

3. The ZYNQ-based online upgrade method according to claim 1 or 2, characterized in that: The boot firmware, application firmware and backup program firmware are stored in the ROM in sequence, wherein the boot firmware is stored at the starting address of the ROM.

4. The ZYNQ-based online upgrade method according to claim 3, characterized in that: The boot firmware is used for program loading jump, and the application firmware and backup program firmware are used for the operation and online upgrade of ZYNQ.

5. The ZYNQ-based online upgrade method according to claim 2, characterized in that: The search and verification methods for ZYNQ firmware include: S201, searching for firmware header information starting from the firmware index address; S202, after searching for valid firmware header information, verify the firmware header information; S203, after the firmware header information is verified, the first stage boot loader, the user bit stream file, and the ELF file of the user application are verified and loaded in sequence; S204. If no valid firmware header information is identified during the loading process or a verification error occurs, the firmware index address is incremented by 32KB each time, and the firmware header information is searched starting from the incremented firmware index address, and the process jumps to step S202.

6. The online upgrade method based on ZYNQ according to claim 2, characterized in that: Incrementally index from the storage location of the application firmware to the backup program firmware, including: S301, increasing the storage location of the application firmware by 32KB, and starting to search for firmware header information from the increased firmware index address; S302, after searching for valid firmware header information, verify the firmware header information; S303, after the firmware header information is verified, the first stage boot loader, the user bit stream file, and the ELF file of the user application are verified and loaded in sequence; S304: If no valid firmware header information is identified during the loading process or a verification error occurs, the firmware index address is incremented by 32KB each time, and the firmware header information is searched starting from the incremented firmware index address, and the process jumps to step S302.

7. The ZYNQ-based online upgrade method according to any one of claims 1, 2, 4, 5 and 6, characterized in that: During the running of the application, the firmware to be upgraded is written, and the firmware to be upgraded only covers the application firmware. During the running of the standby program, the firmware to be upgraded is written, and the firmware to be upgraded only covers the standby program firmware.

8. An online upgrade device based on ZYNQ, characterized in that: include: An initial write module, used for storing ZYNQ firmware in ROM, wherein the ZYNQ firmware includes boot firmware, application firmware and backup program firmware, the boot firmware, application firmware and backup program firmware are sequentially stored in ROM, and the application firmware and backup program firmware back up each other; The bootloader startup module is used to search and verify the ZYNQ firmware from the starting address of the ROM after the ZYNQ is powered on, and run the ZYNQ firmware after the verification passes; The application startup module is used to jump the boot program to the storage location of the application firmware to search and verify the ZYNQ firmware after the boot firmware is running; If the application firmware passes the verification, the application firmware is loaded to enable the device to run the application normally; If the application firmware fails to be verified, the backup program firmware is indexed incrementally from the storage location of the application firmware and verified, and the backup program firmware is run after the verification passes, so that the device can run the backup program normally; The upgrade module is used to write the firmware to be upgraded if an upgrade instruction and the firmware to be upgraded are received during the operation of the application program or the standby program, and determine whether the firmware to be upgraded is successfully written; If the writing is successful, jump to the writing address of the firmware to be upgraded to perform firmware verification and operation; If the write fails, the original application continues to run.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program code for execution by a device, wherein the program code includes steps for executing the method according to any one of claims 1 to 7.

10. An electronic device, characterized in that: The electronic device comprises a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction implements the method as claimed in any one of claims 1 to 7 when executed by the processor.

Citation Information

Patent Citations

  • ZYNQ serial port remote updating method

    CN117369851A

  • Firmware online upgrading method and system

    CN119226039A

Cited By

  • Cascade single-chip microcomputer upgrading method and system based on custom packaging

    CN120371363A

  • Control method of consumable chip, consumable chip and imaging device

    CN120881205A