ZYNQ platform-based remote upgrading method, device and system

文档序号:1963499 发布日期:2021-12-14 浏览:21次 中文

阅读说明:本技术 基于zynq平台的远程升级方法、装置及系统 (ZYNQ platform-based remote upgrading method, device and system ) 是由 郑文浩 唐利君 刘新龙 钱林林 潘颖颖 吴勇刚 朱向伟 崔长桥 于 2021-11-15 设计创作,主要内容包括:本发明提供一种基于ZYNQ平台的远程升级方法、装置及系统,方法包括:将引导程序加载器FSBL加载至片上存储器OCM,并基于FSBL完成硬件初始化;确定收到升级指令,基于引导程序加载器FSBL加载空中下载单元OTA,得到远程升级数据;将远程升级数据写入闪存FLASH,以远程升级系统程序或应用程序;确定远程升级数据写入成功,加载远程升级后的系统程序或应用程序,并移交控制权至远程升级后的系统程序或应用程序。本发明通过引导程序加载器FSBL,针对系统程序或应用程序的二次加载引导过程,从而解决了多系统切换场景下,远程升级可靠性不足的问题,实现了扩展性强,可靠性高,通用性好,易移植的远程升级。(The invention provides a ZYNQ platform-based remote upgrading method, device and system, wherein the method comprises the following steps: loading the boot program loader FSBL to the on-chip memory OCM, and finishing hardware initialization based on the FSBL; determining that an upgrading instruction is received, and loading an over-the-air downloading unit OTA based on a boot loader FSBL to obtain remote upgrading data; writing the remote upgrading data into a FLASH memory FLASH to remotely upgrade a system program or an application program; and determining that the remote upgrade data is successfully written, loading the system program or the application program after the remote upgrade, and handing over the control right to the system program or the application program after the remote upgrade. The invention aims at the secondary loading guide process of the system program or the application program through the guide program loader FSBL, thereby solving the problem of insufficient reliability of remote upgrade in a multi-system switching scene, and realizing the remote upgrade with strong expansibility, high reliability, good universality and easy transplantation.)

1. A ZYNQ platform-based remote upgrading method is applied to a remote upgrading system and comprises the following steps:

loading a boot program loader FSBL to an on-chip memory OCM, and completing hardware initialization based on the boot program loader FSBL;

determining that an upgrading instruction is received, and loading an over-the-air downloading unit OTA based on a boot loader FSBL to obtain remote upgrading data;

writing the remote upgrading data into a FLASH memory FLASH to remotely upgrade a system program or an application program;

and determining that the remote upgrading data is successfully written, loading the system program or the application program after remote upgrading, and handing over the control right to the system program or the application program after remote upgrading.

2. The ZYNQ platform-based remote upgrade method according to claim 1, wherein after the steps of loading the boot loader FSBL to the on-chip memory OCM and completing hardware initialization based on the boot loader FSBL, further comprising:

determining that an upgrade instruction has not been received, loading a system program or an application program and handing over control to the system program or the application program.

3. The ZYNQ platform-based remote upgrade method according to claim 1, wherein after said step of writing said remote upgrade data into FLASH memory FLASH to remotely upgrade system programs or application programs, further comprising:

and determining that the remote upgrade data is failed to be written, loading a backup system program or application program, and handing over control to the backup system program or application program.

4. The ZYNQ platform-based remote upgrade method according to claim 1, wherein the system program comprises a VxWorks system.

5. The ZYNQ platform-based remote upgrade method according to claim 4, wherein the step of loading a remote upgraded system program or application program and handing over control to the remote upgraded system program or application program comprises:

and loading the VxWorks system after remote upgrading, and handing over the control right to the VxWorks system after remote upgrading, so that a starting interface BOOTROM of the VxWorks system after remote upgrading loads a system mirror image and a user application program.

6. A ZYNQ platform-based remote upgrading device is characterized in that the ZYNQ platform-based remote upgrading method of any one of claims 1 to 5 can be applied, and comprises a ZYNQ PS part;

the ZYNQ PS part comprises a gigabit network, a double-rate synchronous dynamic random access memory DDR, a FLASH memory FLASH and a universal asynchronous receiver transmitter interface UART;

the FLASH memory FLASH comprises:

the first storage unit is used for storing the FSBL program of the ZYNQ chip;

the second storage unit is used for storing a minimum function FPGA program supporting OTA functions so as to support remote upgrading in the starting process;

the third storage unit is used for storing the remote upgrading program;

the fourth storage unit is used for storing the system program or the application program which is updated to the latest version after being upgraded;

a fifth storage unit for sharing and storing a plurality of operating systems or user applications;

and the sixth storage unit is used for storing the original system program or the application program for version rollback.

7. A remote upgrading system based on a ZYNQ platform is characterized by comprising:

the initialization module is used for loading the boot loader FSBL to the on-chip memory OCM and finishing hardware initialization based on the boot loader FSBL;

the data acquisition module is used for determining that an upgrading instruction is received and loading the OTA based on the FSBL of the bootstrap loader to obtain remote upgrading data;

the upgrading module is used for writing the remote upgrading data into a FLASH memory FLASH so as to remotely upgrade a system program or an application program;

and the system switching module is used for determining that the remote upgrading data is successfully written, loading the system program or the application program after remote upgrading, and handing over the control right to the system program or the application program after remote upgrading.

8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the program to implement the steps of the ZYNQ platform-based remote upgrade method according to any one of claims 1 to 5.

9. A non-transitory computer readable storage medium, having a computer program stored thereon, wherein the computer program, when being executed by a processor, implements the steps of the ZYNQ platform-based remote upgrade method according to any one of claims 1 to 5.

10. A computer program product comprising a computer program, wherein the computer program when executed by a processor implements the steps of the ZYNQ platform based remote upgrade method according to any one of claims 1 to 5.

Technical Field

The invention relates to the technical field of communication, in particular to a ZYNQ platform-based remote upgrading method, device and system.

Background

The remote upgrading function of the ZYNQ platform is usually realized based on a remote upgrading system. The remote upgrading system is an operating system specially manufactured for remote upgrading functions.

The remote upgrading system has the advantages of simple structure, convenience in expansion, high reliability and suitability for various complex scenes, but has poor scene adaptability for multi-system switching.

Specifically, the conventional method in the prior art is to integrate the remote upgrade function into a set of operating system, which is likely to cause system crash if the upgrade fails, and other functions may not be used normally, so that various uncontrollable risks exist.

Therefore, how to design a safe and reliable remote upgrading method, device and system supporting multi-system switching becomes a problem to be solved urgently in the industry.

Disclosure of Invention

Aiming at the problems in the prior art, the invention provides a ZYNQ platform-based remote upgrading method, device and system.

The invention provides a ZYNQ platform-based remote upgrading method, which is applied to a remote upgrading system and comprises the following steps:

loading a boot program loader FSBL to an on-chip memory OCM, and completing hardware initialization based on the boot program loader FSBL;

determining that an upgrading instruction is received, and loading an over-the-air downloading unit OTA based on a boot loader FSBL to obtain remote upgrading data;

writing the remote upgrading data into a FLASH memory FLASH to remotely upgrade a system program or an application program;

and determining that the remote upgrading data is successfully written, loading the system program or the application program after remote upgrading, and handing over the control right to the system program or the application program after remote upgrading.

According to the remote upgrading method based on the ZYNQ platform, after the steps of loading the boot loader FSBL to the on-chip memory OCM and completing hardware initialization based on the boot loader FSBL, the method further comprises the following steps:

determining that an upgrade instruction has not been received, loading a system program or an application program and handing over control to the system program or the application program.

According to the remote upgrading method based on the ZYNQ platform provided by the invention, after the step of writing the remote upgrading data into a FLASH memory FLASH to remotely upgrade a system program or an application program, the method further comprises the following steps:

and determining that the remote upgrade data is failed to be written, loading a backup system program or application program, and handing over control to the backup system program or application program.

According to the ZYNQ platform-based remote upgrading method provided by the invention, the system program comprises a VxWorks system.

According to the remote upgrading method based on the ZYNQ platform, the steps of loading the system program or the application program after remote upgrading and transferring the control right to the system program or the application program after remote upgrading comprise:

and loading the VxWorks system after remote upgrading, and handing over the control right to the VxWorks system after remote upgrading, so that a starting interface BOOTROM of the VxWorks system after remote upgrading loads a system mirror image and a user application program.

The invention also provides a remote upgrading device based on the ZYNQ platform, which can be applied to the remote upgrading method based on the ZYNQ platform and comprises a ZYNQ PS part;

the ZYNQ PS part comprises a gigabit network, a double-rate synchronous dynamic random access memory DDR, a FLASH memory FLASH and a universal asynchronous receiver transmitter interface UART;

the FLASH memory FLASH comprises:

the first storage unit is used for storing the FSBL program of the ZYNQ chip;

the second storage unit is used for storing a minimum function FPGA program supporting OTA functions so as to support remote upgrading in the starting process;

the third storage unit is used for storing the remote upgrading program;

the fourth storage unit is used for storing the system program or the application program which is updated to the latest version after being upgraded;

a fifth storage unit for sharing and storing a plurality of operating systems or user applications;

and the sixth storage unit is used for storing the original system program or the application program for version rollback.

The invention also provides a remote upgrading system based on the ZYNQ platform, which comprises the following steps:

the initialization module is used for loading the boot loader FSBL to the on-chip memory OCM and finishing hardware initialization based on the boot loader FSBL;

the data acquisition module is used for determining that an upgrading instruction is received and loading the OTA based on the FSBL of the bootstrap loader to obtain remote upgrading data;

the upgrading module is used for writing the remote upgrading data into a FLASH memory FLASH so as to remotely upgrade a system program or an application program;

and the system switching module is used for determining that the remote upgrading data is successfully written, loading the system program or the application program after remote upgrading, and handing over the control right to the system program or the application program after remote upgrading.

The invention also provides an electronic device, which comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein when the processor executes the program, the steps of any one of the ZYNQ platform-based remote upgrading methods are realized.

The present invention also provides a non-transitory computer readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps of any of the above-mentioned methods for remote upgrade based on a ZYNQ platform.

The invention also provides a computer program product, which comprises a computer program, wherein the computer program realizes the steps of any one of the ZYNQ platform-based remote upgrading methods when being executed by a processor.

According to the ZYNQ platform-based remote upgrading method, device and system, the secondary loading guide process of the system program or the application program is aimed at through the guide program loader FSBL, so that the problem of insufficient reliability of remote upgrading under the multi-system switching scene is solved, and remote upgrading with strong expansibility, high reliability, good universality and easiness in transplantation is realized.

Drawings

In order to more clearly illustrate the technical solutions of the present invention or the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.

FIG. 1 is a schematic flow chart of a ZYNQ platform-based remote upgrading method provided by the invention;

FIG. 2 is a schematic operation flow diagram of a ZYNQ platform-based remote upgrading device provided by the invention;

fig. 3 is a schematic structural diagram of an electronic device provided in the present invention.

Detailed Description

In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

The remote upgrade method based on the ZYNQ platform of the present invention is described below with reference to FIG. 1.

As shown in fig. 1, the remote upgrade method based on the ZYNQ platform provided by the present invention includes:

step 101, loading a boot program loader FSBL to an on-chip memory OCM, and completing hardware initialization based on the boot program loader FSBL;

103, determining that an upgrading instruction is received, and loading the OTA based on the FSBL of the bootstrap loader to obtain remote upgrading data;

step 105, writing the remote upgrading data into a FLASH memory FLASH to remotely upgrade a system program or an application program;

and 107, determining that the remote upgrade data is successfully written, loading the system program or the application program after remote upgrade, and handing over the control right to the system program or the application program after remote upgrade.

The following will further describe the steps of this embodiment by taking a scenario of switching between two modes of the VxWorks operating system and the no-operating system as an example.

1) The system starts to load FSBL to OCM at first, FSBL finishes the initialization operation environment of hardware such as CPU, FSBL loads OTA.BIT, then loads APP _ OTA program and hands over control right.

2) The APP _ OTA program executes a remote upgrading process, and after timeout or upgrading is completed, BOOTROM (VX system) or USR _ APP _ NEW (without system) is loaded and control right is handed over. Since the BOOTROM and the USR _ APP _ NEW share the same partition, the APP _ OTA loading process can be immediately realized without judging whether to directly load the executable program;

3) starting the USR _ APP _ NEW without the operating system mode, and ending the starting process;

4) and for the BOOTROM with the operating system, the system image and the user APP can be continuously loaded, the part of operation does not involve remote upgrading modification, and the existing processing flow is kept.

The starting process needs a secondary loading and booting process for the program, which is also a difficult point and a key point for implementing the embodiment.

The abbreviations and program functions involved in the above-described steps will be briefly described below.

ZYNQ: an extensible processing platform;

FSBL: a first stage boot loader, a first stage loading program;

the program functions are as follows: providing an initialization function comprising: initializing an MIO register, a PLL (phase locked loop), a clock, a DDR (double data rate), confirming a ZYNQ loading mode and initializing a corresponding communication interface;

OCM: on chip memory, on-chip memory;

bit: OTA bit file, OTA refers to over the air technology (over-the-air technology), which in the present invention can be understood as: remote upgrade data acquisition techniques;

the bit file functions are: completing hardware Ethernet port and serial port initialization;

APP _ OTA: remotely upgrading the service program;

the functions are as follows: the method comprises the steps of finishing initialization work of an Ethernet protocol stack, starting and executing a remote upgrading process, acquiring upgrading data of remote equipment through Ethernet, carrying out MD5 verification on the data, updating the data into FLASH, monitoring a local remote upgrading process, and reporting error information to the remote equipment through the Ethernet when an error occurs;

BOOTROM and USR _ APP _ NEW are software programs to be upgraded;

BOOTROM refers to software program containing Vxworks operating system mirror image;

USR _ APP _ NEW refers to bare machine software program;

APP: application, application program.

The beneficial effect of this embodiment lies in:

by the aid of the boot program loader FSBL, the problem that remote upgrading is poor in reliability under a multi-system switching scene is solved by aiming at a secondary loading boot process of a system program or an application program, and remote upgrading which is high in expansibility, reliability and universality and easy to transplant is achieved.

According to the above embodiment, in the present embodiment:

after the step of loading the boot loader FSBL to the on-chip memory OCM and completing hardware initialization based on the boot loader FSBL, the method further includes:

determining that an upgrade instruction has not been received, loading a system program or an application program and handing over control to the system program or the application program.

After the step of writing the remote upgrade data into the FLASH memory FLASH to remotely upgrade the system program or the application program, the method further comprises the following steps:

and determining that the remote upgrade data is failed to be written, loading a backup system program or application program, and handing over control to the backup system program or application program.

The system program comprises a VxWorks system.

The step of loading the remotely upgraded system program or application program and handing over the control right to the remotely upgraded system program or application program comprises:

and loading the VxWorks system after remote upgrading, and handing over the control right to the VxWorks system after remote upgrading, so that a starting interface BOOTROM of the VxWorks system after remote upgrading loads a system mirror image and a user application program.

In the embodiment, after the equipment terminal is powered on, a minimum remote upgrading system based on a ZYNQ platform is firstly operated, if system upgrading is carried out, an upgrading program is operated, upgrading data received from a client side is written into a flash register, a ZYNQ multi register switching system and the like, and a VXWorks/no-operation system is started;

if the system is not upgraded, the upgrading program stops running, registers such as ZYNQ MULTIBOOT and the like directly switch the system to start the VXWorks/no-operating system.

The beneficial effect of this embodiment lies in:

on the basis of the above embodiment, the present embodiment further provides a system start-up procedure when the upgrade instruction is not received and after the upgrade is completed, and based on the scheme provided by the present embodiment, multiple remote upgrades can be supported until the upgrade is successful, and when the upgrade fails, other functions of the operating system are not affected.

The remote upgrade device based on the ZYNQ platform provided by the present invention is described below, and the remote upgrade device based on the ZYNQ platform described below and the remote upgrade method based on the ZYNQ platform described above may be referred to correspondingly.

The embodiment of the invention provides a ZYNQ platform-based remote upgrading device, which can be applied to the ZYNQ platform-based remote upgrading method and comprises a ZYNQ PS part;

the ZYNQ PS part comprises a gigabit network, a double-rate synchronous dynamic random access memory DDR, a FLASH memory FLASH and a universal asynchronous receiver transmitter interface UART;

the FLASH memory FLASH comprises:

the first storage unit is used for storing the FSBL program of the ZYNQ chip;

the second storage unit is used for storing a minimum function FPGA program supporting OTA functions so as to support remote upgrading in the starting process;

the third storage unit is used for storing the remote upgrading program;

the fourth storage unit is used for storing the system program or the application program which is updated to the latest version after being upgraded;

a fifth storage unit for sharing and storing a plurality of operating systems or user applications;

and the sixth storage unit is used for storing the original system program or the application program for version rollback.

Specifically, in this embodiment, the details of the six storage units of the FLASH memory FLASH are as follows.

1. An FSBL (first stage boot loader) area for storing an FSBL program of the ZYNQ chip, realizing chip initialization, loading OTA.bit and guiding APP _ OTA.elf;

2. the bit area stores an FPGA program supporting the minimum function of the OTA function so as to support remote upgrading in the starting process;

3. an APP _ OTA.elf area stores a remote upgrading software program, realizes a remote upgrading function, loads a full-function FPGA.BIT, and guides a USER _ APP _ NEW program (without an operating system) or a BOOT _ ROM (VX system);

4. BIT, used for storing the system program or application program, will be upgraded and upgraded into the latest version;

the partition is a shared partition of the USR _ APP _ NEW (without an operating system) and the BOOT _ ROW (VX system), the partition stores the latest user program under the condition of no operating system, the partition is refreshed by version upgrading, and default loading of the partition program is started;

and the USR _ APP _ OLD partition is used for storing the original version user program, does not support upgrading, cannot be covered and is only used for version rollback.

The beneficial effect of this embodiment lies in:

by the aid of the boot program loader FSBL, the problem that remote upgrading is poor in reliability under a multi-system switching scene is solved by aiming at a secondary loading boot process of a system program or an application program, and remote upgrading which is high in expansibility, reliability and universality and easy to transplant is achieved.

The embodiment of the invention also provides a remote upgrading system based on the ZYNQ platform, which comprises the following steps:

the initialization module is used for loading the boot loader FSBL to the on-chip memory OCM and finishing hardware initialization based on the boot loader FSBL;

the data acquisition module is used for determining that an upgrading instruction is received and loading the OTA based on the FSBL of the bootstrap loader to obtain remote upgrading data;

the upgrading module is used for writing the remote upgrading data into a FLASH memory FLASH so as to remotely upgrade a system program or an application program;

and the system switching module is used for determining that the remote upgrading data is successfully written, loading the system program or the application program after remote upgrading, and handing over the control right to the system program or the application program after remote upgrading.

Further, the remote upgrade system provided in this embodiment further includes:

and the non-upgrade loading module is used for determining that the upgrade instruction is not received, loading the system program or the application program and handing over the control right to the system program or the application program.

And the write failure module is used for determining the write failure of the remote upgrade data, loading the backup system program or application program and handing over the control right to the backup system program or application program.

In a preferred embodiment of this embodiment, the system program includes a VxWorks system. Based on this preferred scheme, the system switching module includes:

and the VxWorks submodule is used for loading the VxWorks system after remote upgrading and handing over the control right to the VxWorks system after remote upgrading so that a boot interface BOOTROM of the VxWorks system after remote upgrading loads a system mirror image and a user application program.

The beneficial effect of this embodiment lies in:

by the aid of the boot program loader FSBL, the problem that remote upgrading is poor in reliability under a multi-system switching scene is solved by aiming at a secondary loading boot process of a system program or an application program, and remote upgrading which is high in expansibility, reliability and universality and easy to transplant is achieved.

Fig. 3 illustrates a physical structure diagram of an electronic device, which may include, as shown in fig. 3: a processor (processor)310, a communication Interface (communication Interface)320, a memory (memory)330 and a communication bus 340, wherein the processor 310, the communication Interface 320 and the memory 330 communicate with each other via the communication bus 340. The processor 310 may call logic instructions in the memory 330 to perform a ZYNQ platform-based remote upgrade method, which includes: loading a boot program loader FSBL to an on-chip memory OCM, and completing hardware initialization based on the boot program loader FSBL; determining that an upgrading instruction is received, and loading an over-the-air downloading unit OTA based on a boot loader FSBL to obtain remote upgrading data; writing the remote upgrading data into a FLASH memory FLASH to remotely upgrade a system program or an application program; and determining that the remote upgrading data is successfully written, loading the system program or the application program after remote upgrading, and handing over the control right to the system program or the application program after remote upgrading.

In addition, the logic instructions in the memory 330 may be implemented in the form of software functional units and stored in a computer readable storage medium when the software functional units are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.

In another aspect, the present invention further provides a computer program product, where the computer program product includes a computer program, the computer program can be stored on a non-transitory computer readable storage medium, and when the computer program is executed by a processor, a computer can execute the method for remote upgrade based on a ZYNQ platform provided by the above methods, where the method includes: loading a boot program loader FSBL to an on-chip memory OCM, and completing hardware initialization based on the boot program loader FSBL; determining that an upgrading instruction is received, and loading an over-the-air downloading unit OTA based on a boot loader FSBL to obtain remote upgrading data; writing the remote upgrading data into a FLASH memory FLASH to remotely upgrade a system program or an application program; and determining that the remote upgrading data is successfully written, loading the system program or the application program after remote upgrading, and handing over the control right to the system program or the application program after remote upgrading.

In still another aspect, the present invention further provides a non-transitory computer readable storage medium, on which a computer program is stored, the computer program being implemented by a processor to perform the method for remote upgrade based on a ZYNQ platform provided by the above methods, the method including: loading a boot program loader FSBL to an on-chip memory OCM, and completing hardware initialization based on the boot program loader FSBL; determining that an upgrading instruction is received, and loading an over-the-air downloading unit OTA based on a boot loader FSBL to obtain remote upgrading data; writing the remote upgrading data into a FLASH memory FLASH to remotely upgrade a system program or an application program; and determining that the remote upgrading data is successfully written, loading the system program or the application program after remote upgrading, and handing over the control right to the system program or the application program after remote upgrading.

The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.

Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.

Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

13页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:固件升级方法和存储设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!