A method for online upgrading of FPGA configuration item files

Through the USB to serial port connector and multi-loading solution, combined with BPI and SPI interfaces, the online upgrade and backup function of FPGA configuration item files is realized, which solves the limitations of using dedicated downloaders and JTAG interfaces in the existing technology, reduces costs and Improved the reliability and risk resistance of online upgrades.

CN118394394BActive Publication Date: 2024-09-20CHENGDU CAIC ELECTRONICS CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202410851494.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2024-09-20
Estimated Expiration
2044-06-28

AI Technical Summary

Technical Problem

Existing FPGA configuration item file online upgrade technology has limitations in the use of dedicated downloaders and professional software, and the JTAG interface is designed inside the product, which increases the risk of disassembly and maintenance and maintenance costs. The lack of application of the BPI parallel interface mode results in limited applicable scenarios. , and the backup code cannot be loaded online when the upgrade fails.

Method used

Establish a data transmission channel through a USB-to-serial connector, send the update file in the host computer to the FPGA, perform serial-to-parallel conversion, set up a backup area and jump execution code area in the FLASH storage, and use a multiple loading scheme to achieve online updates and Backup function, supports BPI and SPI interface configuration mode, and sets the timer area to trigger the bounce function to ensure the stability and risk resistance of online upgrades.

Benefits of technology

It realizes online upgrade of FPGA configuration file without special downloader and professional software, expands the applicable scenarios, reduces R&D and maintenance costs, ensures the reliability and risk resistance of online upgrade, and avoids product opening and code runaway. situation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118394394B
    Figure CN118394394B
Patent Text Reader

Abstract

The present invention discloses a method for online upgrading of FPGA configuration item files, and relates to the field of online upgrading of FPGA configuration item files. The method comprises the following steps: establishing a data transmission channel through a USB to serial port connector to send the update file data in the host computer to the FPGA; performing serial-to-parallel conversion on the update file data to obtain write data; selecting an interface configuration mode to write the write data to a backup area and a jump execution code area, and reading back the jump execution code area to obtain read data; using the read data to verify the write data; if the verification passes, the FPGA is powered on for initialization configuration and the update file data is loaded, and if the verification fails, the backup data is loaded back to the backup area to re-upgrade the file online. The present invention only occupies part of the logic resources of the FPGA, and realizes the operation of the configuration FLASH chips of different types of interfaces and the multi-region online update loading of FPGA configuration items.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of online upgrading of FPGA configuration item files, and in particular to a method for online upgrading of FPGA configuration item files. Background Art

[0002] As avionics products become more and more complex and require higher and higher data processing, FPGA (Field-Programmable Gate Array) has been widely used in the field of avionics, and there are often scenarios where product logic codes need to be upgraded in the field. Traditionally, to upgrade the FPGA program, a downloader needs to be connected to the FPGA through the JTAG interface. This has the following main disadvantages: First, a dedicated downloader and professional software are required to be upgraded by professionals, which has harsh usage conditions, increased R&D costs and maintenance work, and is not conducive to promotion and use; second, the JTAG interface is often designed inside the product, and the product needs to be opened for processing. In this way, the reliability of the product cannot be guaranteed when it is disassembled and assembled, and the risk of test failure is increased. Therefore, online upgrade technology urgently needs to be popularized.

[0003] FPGA has the characteristics of multiple configurations. When updating remotely, dual images are required to protect the stability of the design. When updating the design, only the first image area is updated, and the second image area is used as a safety backup and is no longer updated. When an error occurs during the online update of the first image area, the loading code can jump to the second image area, load the backup code, and re-update the first image area online to ensure remote code recovery.

[0004] This type of dual or multiple mirroring solution is called multi-loading. Multi-loading allows users to select a load from multiple bit streams stored in Flash according to the needs at different times without powering off and restarting, so as to achieve the transformation of FPGA system functions. Furthermore, multi-loading can be used to implement the function of online update loading logic code. In the multi-loading configuration update, the following errors will trigger the bounce function: IDCODE error, CRC check error, watchdog timeout error.

[0005] At present, there are two types of online upgrades of FPGA configuration item files. The first type is to use the control unit, and the host computer sends the files to be updated to the control unit, and the control unit completes the reading and writing of the configuration item storage chip. The second type is that the host computer sends the files to be updated to the FPGA through a specific interface, and the FPGA completes the control and writing of the storage chip. The second method does not require the use of a control unit, and has lower design difficulty and hardware requirements. However, most of them are currently based on the SPI serial port mode and lack the use of the BPI parallel interface mode, which limits the applicable scenarios of the second method; at the same time, when the online upgrade fails, the backup code of the FPGA configuration item file has no online loading function, and the online upgrade operation cannot be re-performed in the backup area. Summary of the invention

[0006] In view of the above-mentioned deficiencies in the prior art, the present invention provides a method for online upgrading of FPGA configuration item files, which only occupies part of the FPGA logic resources, realizes the operation of configuration FLASH chips of different types of interfaces and multi-area online update loading of FPGA configuration items.

[0007] In order to achieve the above-mentioned object of the invention, the technical solution adopted by the present invention is:

[0008] A method for online upgrading of FPGA configuration item files, comprising the following steps:

[0009] S1. Set a USB to serial port connector to connect the host computer and FPGA, establish a data transmission channel through the USB to serial port connector, and use the data transmission channel to send the update file data in the host computer to the FPGA;

[0010] S2, performing serial-to-parallel conversion on the update file data received by the FPGA to obtain write data;

[0011] S3, setting a backup area and a jump execution code area for the FLASH storage, determining the interface type of the FLASH storage, and selecting an interface configuration mode according to the interface type of the FLASH storage to write the write data to the backup area and the jump execution code area, and reading back the jump execution code area to obtain the read data;

[0012] S4. Use the read data to verify the written data to determine whether the verification is successful; if so, power on the FPGA to initialize the configuration and load the update file data to complete the online upgrade of the FPGA configuration item file, otherwise return to the backup area to load the backup data to re-upgrade the file online.

[0013] Further, in step S1, a data transmission channel is established through the USB to serial port connector. The specific process is: interactive transmission of online upgrade request signals and response signals between the host computer and the FPGA is performed through the USB to serial port connector to establish the data transmission channel.

[0014] Further, in step S1, the updated file data in the host computer is sent to the FPGA via the data transmission channel. The specific process is as follows: after receiving the response signal, the host computer sends an erase instruction to the FPGA via the data transmission channel to erase the original data in the jump execution code area stored in the FLASH, and retain the original data in the backup area stored in the FLASH; after the erasure is completed, the FPGA sends an erase completion signal to the host computer; the host computer receives the erase completion signal, and then sends the updated file data to the FPGA via the data transmission channel.

[0015] Furthermore, in step S2, the update file data received by the FPGA is serial-to-parallel converted to obtain write data. The specific process is: a data cache module and a serial-to-parallel conversion module are set for the FPGA, the data cache module is used to cache the update file data received by the FPGA, and then the serial-to-parallel conversion module is used to perform serial-to-parallel conversion on the update file data in the data cache module to obtain write data.

[0016] Furthermore, in step S3, a first timer area and a second timer area are also set for the FLASH storage; the first timer area is set between the backup area and the jump execution code area, and the first timer area is used to record the time when the write data is written to the jump execution code area to control the triggering of the jump back function; the second timer area is set after the jump execution code area, and the second timer area is used to directly trigger the jump back function.

[0017] Further, in step S3, the interface configuration mode includes a BPI interface configuration mode and a SPI interface configuration mode.

[0018] Furthermore, in step S4, the FPGA is powered on and initialized and configured, and the update file data is loaded to complete the online upgrade of the FPGA configuration item file. The specific process is: ICAPE generates an IPROG configuration command, initializes the configuration register of the FPGA, and loads the update file data of the jump execution code area to complete the online upgrade of the FPGA configuration item file.

[0019] The present invention has the following beneficial effects:

[0020] (1) The present invention connects the host computer to the product interface through a USB to serial port connector, thereby realizing serial port communication from the host computer to the FPGA. It is not necessary for the host computer to be equipped with a Vivado-type EDA integrated environment, and it is not necessary to connect a specific JTAG emulator to the JTAG port on the product board to realize the burning of the FLASH of the FPGA configuration storage code, which facilitates the subsequent update of the code and avoids the product cover being opened and the circuit board being exposed. In addition, in this process, only part of the FPGA logic resources are occupied for configuring serial port communication and FLASH driver code.

[0021] (2) The present invention increases the use of setting the BPI parallel interface mode by setting the BPI or SPI communication from FPGA to Flash storage, thus expanding the limited application scenarios;

[0022] (3) The present invention uses Flash storage dual mirrors to solve the problem that after an upgrade fails, the program data of the configuration chip is destroyed, the FPGA cannot run normally, and online loading cannot be performed. Specifically, the configuration Flash storage is divided into blocks, and the Flash storage is divided into 4 areas, starting from address 0, which are a backup area, a first timer area, a jump execution code area, and a second timer area. The backup area and the jump execution code area both contain online upgrade function codes. When the online upgrade using the jump execution code area fails, the code jumps back to the backup area to cooperate with the host computer to re-complete the online upgrade function, thereby increasing the risk resistance of the online upgrade; and by setting corresponding timer areas after the backup area and the jump execution code area, the situation where the code runs away and the FPGA cannot jump back to the backup area is avoided. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 A flowchart of a method for online upgrading of FPGA configuration item files;

[0024] Figure 2 A system block diagram for online upgrading of FPGA configuration item files of the present invention;

[0025] Figure 3 The present invention is configured with a chip FLASH storage block diagram. DETAILED DESCRIPTION

[0026] The specific implementation modes of the present invention are described below so that those skilled in the art can understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific implementation modes. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations utilizing the concept of the present invention are protected.

[0027] like Figure 1As shown, a method for online upgrading of FPGA configuration item files includes steps S1-S4, which are specifically as follows:

[0028] S1. Set a USB to serial port connector to connect the host computer and FPGA, establish a data transmission channel through the USB to serial port connector, and use the data transmission channel to send the update file data in the host computer to the FPGA.

[0029] In an optional embodiment of the present invention, the present invention establishes a data transmission channel through a USB to serial port connector. The specific process is: interactive transmission of online upgrade request signals and response signals between the host computer and the FPGA is performed through the USB to serial port connector to establish a data transmission channel.

[0030] like Figure 2 As shown in FIG. 1 , the system for online upgrading of FPGA configuration item files includes a host computer, a USB-to-serial port connector, and a product terminal. The host computer includes a serial port assistant module with a USB interface. The USB interface of the host computer and the serial port module of the product terminal are connected through the USB-to-serial port connector. The serial port assistant module sends an online upgrade request signal through the USB interface, and the online upgrade request signal is transmitted to the FPGA after passing through the USB-to-serial port connector and the serial port module. After receiving the online upgrade request signal, the FPGA sends a response signal to confirm the establishment of a data transmission channel with the host computer.

[0031] The host computer uses the data transmission channel to send updated file data to the FPGA. The specific process is: after receiving the response signal, the host computer sends an erase instruction to the FPGA through the data transmission channel to erase the original data in the jump execution code area stored in the FLASH, and retain the original data in the backup area stored in the FLASH; after the erasure is completed, the FPGA sends an erase completion signal to the host computer; the host computer receives the erase completion signal, and then sends the updated file data to the FPGA through the data transmission channel.

[0032] S2. Perform serial-to-parallel conversion on the update file data received by the FPGA to obtain write data.

[0033] In an optional embodiment of the present invention, the present invention performs serial-to-parallel conversion on the update file data received by the FPGA to obtain write data. The specific process is: setting a data cache module and a serial-to-parallel conversion module for the FPGA, using the data cache module to cache the update file data received by the FPGA, and then using the serial-to-parallel conversion module to perform serial-to-parallel conversion on the update file data in the data cache module to obtain write data.

[0034] S3. Set a backup area and a jump execution code area for the FLASH storage, determine the interface type of the FLASH storage, and select an interface configuration mode according to the interface type of the FLASH storage to write the write data to the backup area and the jump execution code area, and read back the jump execution code area to obtain the read data.

[0035] In an optional embodiment of the present invention, the present invention further sets a first timer area and a second timer area for FLASH storage; the first timer area is set between the backup area and the jump execution code area, and the first timer area is used to record the time when the write data is written to the jump execution code area to control the triggering of the jump back function; the second timer area is set after the jump execution code area, and the second timer area is used to directly trigger the jump back function.

[0036] like Figure 3 As shown, the present invention sets a backup area, a first timer area, a jump execution code area and a second timer area for FLASH storage.

[0037] The present invention further sets a flash memory control module for the FPGA, and uses the flash memory control module to control the driver for FLASH storage writing to write the written data to the backup area from the base address as backup data, and then write it to the jump execution code area. In the process of data writing, the writing starts from address 0. When the WBSTAR (warmbootstartaddress, hot start start address) jump register configuration command is written in the backup area, it will jump to the jump execution code area for data writing. After the writing is completed, the written data of the jump execution code area is successfully loaded and run; if the operation fails, the written data of the backup area is reloaded. After the power-on is completed, in the active mode, the FPGA automatically completes the loading of the code data in the FLASH. In order to operate the FLASH storage partitions in sequence, the present invention configures the loaded jump address register WBSTA in advance. There are two methods for FPGA to implement the loading command. One method is timing constraint, that is, embedding the relevant instructions into the bit file, and the specific process is the first timer area and the second timer area set in the present invention; the other method is to instantiate the ICAPE (InternalConfigurationAccessPort, internal configuration access port) primitive configuration in the logic code. The present invention uses two methods simultaneously to improve the stability of the jump.

[0038] The present invention sets a backup area and a jump execution code area for FLASH storage, so that when the online loading faces the update bit stream ID and CRC check failure, the jump back function can be used to make the loading process fall back to the backup area. However, when the power is suddenly cut off halfway through the update data transmission, the jump back function does not work at this time, and the loading cannot continue. The simple jump back function cannot cope with this abnormality. If the configuration file is suddenly interrupted halfway through writing, the instruction sequence embedded in the configuration data stream will also be gone, and it is possible to be interrupted at any position, which can easily cause the loading of the FPGA to lose control. Therefore, the present invention sets a first timer area and a second timer area for FLASH storage, specifically setting the first timer area between the backup area and the jump execution code area, and setting the second timer area after the jump execution code area. The present invention assigns values ​​to the first timer area and the second timer area according to actual needs, so that when the jump execution code area is updated, the synchronization word is lost or the power is cut off halfway, ensuring that the jump back function can be triggered.

[0039] Specifically, the present invention splices four bit streams (backup area bit stream, first timer area bit stream, jump execution code area bit stream and second timer area bit stream) into an MCS file according to a certain address, burns them into the FLASH storage, loads them when powered on, and first loads the backup area. The backup area bit stream contains the configuration of the WRSTR register, and the set address is the starting address of the first timer area. The bit stream is loaded and jumps to the first timer area to turn on the timer, and is sequentially loaded into the jump execution code area. When the jump execution code area fails to load, the first timer area times out, and the first timer area takes effect, triggering the back-jump function, jumping back to the backup area and reloading. At this time, due to the back-jump function, reloading will shield the WRSTR register configuration, so the backup area is directly loaded in address order. When the online upgrade of the FPGA configuration item file is completed, the task completion signal is pulled high, and both the first timer area and the second timer area will become invalid. If some header data is found in the jump execution code area, but the code logic of the jump execution code area is not established, it will continue to be loaded into the second timer area. When the second timer area times out, since the setting time of the second timer area is very short, the timer will take effect immediately, triggering the jump back function, and loading the bit stream back to the backup area for reloading.

[0040] The interface configuration mode includes a BPI interface configuration mode and an SPI interface configuration mode. The present invention sets a backup area and a jump execution code area for FLASH storage, determines whether the interface type of the FLASH storage is a BPI interface type or an SPI interface type, and selects an interface configuration mode according to the interface type of the FLASH storage, that is, the BPI interface configuration mode is selected for the BPI interface type, and the SPI interface configuration mode is selected for the SPI interface type, so as to write the write data into the jump execution code area, and then uses the flash memory control module to control the driver program of the FLASH storage readback, and reads back the jump execution code area to obtain the read data.

[0041] S4. Use the read data to verify the written data to determine whether the verification is successful; if so, power on the FPGA to initialize the configuration and load the update file data to complete the online upgrade of the FPGA configuration item file, otherwise return to the backup area to load the backup data to re-upgrade the file online.

[0042] In an optional embodiment of the present invention, the present invention performs power-on initialization configuration on the FPGA and loads update file data to complete the online upgrade of the FPGA configuration item file. The specific process is: generate an IPROG configuration command through ICAPE, initialize the configuration register of the FPGA, load the update file data of the jump execution code area, and complete the online upgrade of the FPGA configuration item file.

[0043] Specifically, the present invention determines whether the verification is successful; if so, the IPROG (Internal program) command is executed through the ICAPE primitive in the underlying logic function unit, and the FPGA is powered on and initialized by pulling down the FPGA's pins Init_b and Program_b. The FPGA loads the update file data of the jump execution code area for reconfiguration. After the configuration is completed, the FPGA's task completion signal is pulled high, and the online upgrade of the FPGA configuration item file is completed.

[0044] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0045] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0046] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0047] The present invention uses specific embodiments to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

[0048] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the principles of the present invention, and should be understood that the protection scope of the present invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific variations and combinations that do not deviate from the essence of the present invention based on the technical revelations disclosed by the present invention, and these variations and combinations are still within the protection scope of the present invention.

Claims

1. A method for online upgrading of FPGA configuration item files, characterized in that: The following steps are involved: S1. Set a USB to serial port connector to connect the host computer and FPGA, establish a data transmission channel through the USB to serial port connector, and use the data transmission channel to send the update file data in the host computer to the FPGA; S2, performing serial-to-parallel conversion on the update file data received by the FPGA to obtain write data; S3, setting a backup area and a jump execution code area for the FLASH storage, determining the interface type of the FLASH storage, and selecting an interface configuration mode according to the interface type of the FLASH storage to write the write data to the backup area and the jump execution code area, and reading back the jump execution code area to obtain the read data; A first timer area and a second timer area are also set for the FLASH storage; the first timer area is set between the backup area and the jump execution code area, and the first timer area is used to record the time when the written data is written to the jump execution code area to control the triggering of the jump back function, and jump back to the backup area for reloading; the second timer area is set after the jump execution code area, and the second timer area is used to directly trigger the jump back function, specifically: if part of the header data is searched in the jump execution code area, but the code logic of the jump execution code area is not established, it will continue to be loaded into the second timer area, and the second timer area will time out. Since the setting time of the second timer area is very short, the timer will take effect immediately, triggering the jump back function, and the loaded bit stream will return to the backup area for reloading; S4. Verify the written data with the read data to determine whether the verification is successful; if so, power on the FPGA for initialization configuration and load the update file data to complete the online upgrade of the FPGA configuration item file; otherwise, return to the backup area to load the backup data to re-upgrade the file online; The FPGA is powered on to initialize the configuration and load the update file data to complete the online upgrade of the FPGA configuration item file. The specific process is: generate the IPROG configuration command through ICAPE, initialize the FPGA configuration register, load the update file data in the jump execution code area, and complete the online upgrade of the FPGA configuration item file.

2. The method for online upgrading of FPGA configuration item files according to claim 1, characterized in that: In step S1, a data transmission channel is established through the USB to serial port connector. The specific process is: interactive transmission of online upgrade request signals and response signals between the host computer and the FPGA is performed through the USB to serial port connector to establish the data transmission channel.

3. The method for online upgrading of FPGA configuration item files according to claim 1, characterized in that: In step S1, the updated file data in the host computer is sent to the FPGA via the data transmission channel. The specific process is as follows: after receiving the response signal, the host computer sends an erase instruction to the FPGA via the data transmission channel to erase the original data in the jump execution code area stored in the FLASH, and retain the original data in the backup area stored in the FLASH; after the erasure is completed, the FPGA sends an erase completion signal to the host computer; the host computer receives the erase completion signal, and then sends the updated file data to the FPGA via the data transmission channel.

4. The method for online upgrading of FPGA configuration item files according to claim 1, characterized in that: In step S2, the update file data received by the FPGA is serial-to-parallel converted to obtain write data. The specific process is: a data cache module and a serial-to-parallel conversion module are set for the FPGA, the data cache module is used to cache the update file data received by the FPGA, and then the serial-to-parallel conversion module is used to perform serial-to-parallel conversion on the update file data in the data cache module to obtain write data.

5. The method for online upgrading of FPGA configuration item files according to claim 1, characterized in that: In step S3, the interface configuration mode includes a BPI interface configuration mode and a SPI interface configuration mode.

Citation Information

Patent Citations

  • Improved method and system for updating routing information of main engine on exchanging chip

    CN102801612A

  • Embedded remote on-line upgrading function method based on RTOS

    CN107783775A

  • Online upgrading device of laser radar system and laser radar system

    CN112148317A

  • Upgrading processing method and device based on embedded system and electronic equipment

    CN113138791A

  • High-reliability SRAM type FPGA online upgrading method and system

    CN113377408A