A UART-based logic online upgrade test method

Through the UART-based logic online upgrade test method, the online upgrade of board logic is achieved in equipment and instruments with complex chassis structures using UART communication and Zmodem protocol, which solves the problem of difficulty in online upgrade in the existing technology and improves the upgrade efficiency.

CN115509553BActive Publication Date: 2025-05-06LUOYANG INST OF ELECTRO OPTICAL EQUIP OF AVIC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211030188.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-26
Publication Date
2025-05-06
Estimated Expiration
2042-08-26

AI Technical Summary

Technical Problem

The prior art is difficult to achieve online upgrade of board logic in equipment and instruments with complex chassis structures, especially in situations where it cannot be disassembled or upgraded, which affects the efficiency of troubleshooting and function upgrades.

Method used

UART-based logic online upgrade testing method is adopted, and the program upgrade files are transferred to the test system to be upgraded through UART communication method and Zmodem file transfer protocol, and the MicroBlaze soft core and FIFO storage structure are used for cache and burning to realize the online upgrade function.

Benefits of technology

It realizes the online upgrade of board logic, reduces resource overhead and interface requirements, is suitable for equipment and instruments with complex chassis structures, and improves the efficiency of logic upgrades.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115509553B_ABST
    Figure CN115509553B_ABST
Patent Text Reader

Abstract

The present invention discloses a logic online upgrade test method based on UART, which adopts UART communication mode to transfer program upgrade files to a test system to be upgraded through Zmodem file transfer protocol. The test system adopts MicroBlaze soft core as a processor, adopts FIFO storage structure, receives upgrade files for cache, and burns cached file data to the configuration Flash of FPGA through Multiboot method at the same time, so as to realize the logic online upgrade function of the test system to be upgraded. The present invention has low resource overhead and simple interface requirements, realizes the online upgrade function of board logic, and is particularly suitable for application scenarios of logic upgrade of equipment and instruments with complex chassis structure.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of electronic product testing, and in particular relates to a UART-based logic online upgrade test method. Background Art

[0002] As the functions integrated in the testing equipment become more and more complex, especially for modules that are difficult to disassemble and install, such as non-standard chassis, adapters and test instruments, their disassembly and assembly are becoming more and more difficult. In addition, in some cases, function upgrade personnel cannot go to the site for upgrade. The above application scenarios cannot be updated through the traditional JTAG interface, which seriously affects the troubleshooting and function upgrade of the electronic module board in the testing and acceptance equipment.

[0003] Logic online upgrade technology can realize online upgrade of electronic module functions through file transfer technology and logic online burning technology, avoiding the disassembly and assembly of complex equipment and instruments. Summary of the invention

[0004] In order to overcome the deficiencies of the prior art, the present invention provides a UART-based logic online upgrade test method, which uses the UART communication mode to transfer the program upgrade file to the test system to be upgraded through the Zmodem file transfer protocol. The test system uses the MicroBlaze soft core as a processor, adopts a FIFO storage structure, receives the upgrade file for caching, and simultaneously burns the cached file data to the configuration Flash of the FPGA through the Multiboot method, so as to realize the logic online upgrade function of the test system to be upgraded. The present invention has low resource overhead and simple interface requirements, realizes the online upgrade function of the board logic, and is particularly suitable for application scenarios in which equipment and instruments with complex chassis structures are upgraded for logic.

[0005] The technical solution adopted by the present invention to solve the technical problem includes the following steps:

[0006] Step 1: Build a UART-based logic online upgrade test system;

[0007] The UART-based online logic upgrade test system is assembled on a board, including FPGA, Flash and RS485 interface chip; an embedded single-chip microcomputer system is built by instantiating MicroBlaze soft core, UART core and SPI controller core inside the FPGA;

[0008] Step 2: Set the file transfer method;

[0009] 1)UART communication method;

[0010] RS485 bus mode based on asynchronous serial communication protocol. The asynchronous serial communication protocol is implemented by the UART core inside the FPGA. The sending and receiving sides are different clock domain systems. The sending and receiving sides realize the communication handshake and data frame transmission through the start bit and stop bit.

[0011] 2) Zmodem file transfer protocol;

[0012] Zmodem is a file transfer protocol based on serial communication;

[0013] Step 3: Set the file cache method;

[0014] When the internal RAM resources of the module to be upgraded are insufficient, the BRAM resources inside the FPGA are used to cache files using the FIFO storage structure. The data cache of the FPGA's UART core receiving interrupt is written into the FIFO, and the Zmodem protocol driver bottom layer function reads the cached file data from the FIFO. When the zmodem protocol calls the file storage function File_SaveToMemory, the data passed by File_SaveToMemory is programmed and written into the continuous address of the flash instruction.

[0015] Step 4: Online burning technology;

[0016] Step 4-1: The host computer transfers the .bin file to be upgraded to the FIFO buffer of the board through the RS485 bus and the Zmodem file transfer protocol, and then continuously writes the data in the FIFO to the flash with 0x00800000 as the starting address to avoid overflow of the FIFO buffer;

[0017] Step 4-2: Use Multiboot method to achieve online upgrade;

[0018] Step 4-2-1: Divide the flash into two areas to store two startup files, one area is goldenimage, and the other area is update image; the golden image is used to store the backup logic, and this flash area will not be operated during the remote update operation to prevent the system from failing to start after the remote update fails; the update image is started under normal circumstances, and when the update image image file is damaged or fails to update during the remote update process, the backup startup file golden image image file is started;

[0019] The backup file golden bitstream is stored at address 0x00000000, and the update file updatebitstream is stored at the address specified by the WBSTAR register;

[0020] Step 4-2-2: Perform online operations on the update image area in the Flash;

[0021] Step 4-2-2-1: Erase;

[0022] First, perform an overall erase operation on the second half of the flash starting from address 0x00800000. After the erase is completed, use the Zmodem protocol to perform file transfer and flash programming operations.

[0023] Step 4-2-2-2: Programming;

[0024] The file saving function provided by the Zmodem open source protocol is File_SaveToMemory(char*ptrdat,u16lenth). By calling this function, the transmission file data can be saved. While transmitting the cache, this function continuously writes the received file cache data from the FIFO to the memory area starting with the address 0x00800000 in the Flash, that is, the update image area.

[0025] Step 5: When the entire file is transferred and burned successfully, the board will exit the file transfer thread and feedback the burning success information to the host computer through the RS485 bus; when the board is powered off and on again, run the upgraded board program.

[0026] Preferably, the FPGA is a 7 series from Xilinx.

[0027] Preferably, the model of the Flash is MT25QL128.

[0028] The beneficial effects of the present invention are as follows:

[0029] The present invention provides a UART-based online logic upgrade test method. The upgrade test system realizes the online upgrade function of board logic with low resource overhead and simple interface requirements, and is particularly suitable for application scenarios in which equipment and instruments with complex chassis structures perform logic upgrades. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 The present invention is a block diagram of the logic online upgrade test system based on UART.

[0031] Figure 2 This is the data flow diagram of the online upgrade process of the present invention.

[0032] Figure 3 This is a flowchart of the online upgrade program of the test system logic of the present invention. DETAILED DESCRIPTION

[0033] The present invention is further described below in conjunction with the accompanying drawings and embodiments.

[0034] The test system of the present invention mainly solves the problem of complex and inefficient processes such as chassis disassembly and assembly, board disassembly, emulator / downloader connection, upgrade burning, and environmental recovery in the test board logic upgrade, and can greatly improve the efficiency of board logic upgrade. The characteristic of RS485 bus occupying less resources is used to solve the problem of difficult operation of board upgrade of complex structure equipment and insufficient board resources.

[0035] The invention adopts an asynchronous serial communication mode and a Zmodem file transfer protocol to transmit the upgrade file, and has the characteristic of a simple communication interface. The test system of the invention adopts a file cache method of a FIFO storage structure to realize the cache of program upgrade files, and performs logic burning while caching and transmitting, and has the characteristic of not requiring high cache content space, and is suitable for online upgrade of test boards with less RAM resources. The 7 series FPGA of Xilinx Company is adopted, and the file to be upgraded is written into the configuration Flash of the FPGA online by using the Multiboot mode.

[0036] A UART-based logic online upgrade test method comprises the following steps:

[0037] Step 1: Build a UART-based logic online upgrade test system;

[0038] The UART-based online logic upgrade test system is assembled on a board, including FPGA, Flash and RS485 interface chip; an embedded single-chip microcomputer system is built by instantiating MicroBlaze soft core, UART core and SPI controller core inside the FPGA;

[0039] Step 2: Set the file transfer method;

[0040] 1)UART communication method;

[0041] RS485 bus mode based on asynchronous serial communication protocol. The asynchronous serial communication protocol is implemented by the UART core inside the FPGA. The sending and receiving sides are different clock domain systems. The sending and receiving sides realize the communication handshake and data frame transmission through the start bit and stop bit.

[0042] 2) Zmodem file transfer protocol;

[0043] Zmodem is a file transfer protocol based on serial communication;

[0044] Step 3: Set the file cache method;

[0045] When the internal RAM resources of the module to be upgraded are insufficient, the BRAM resources inside the FPGA are used to cache files using the FIFO storage structure. The data cache of the FPGA's UART core receiving interrupt is written into the FIFO, and the Zmodem protocol driver bottom layer function reads the cached file data from the FIFO. When the zmodem protocol calls the file storage function File_SaveToMemory, the data passed by File_SaveToMemory is programmed and written into the continuous address of the flash instruction.

[0046] Step 4: Online burning technology;

[0047] Step 4-1: The host computer transfers the .bin file to be upgraded to the FIFO buffer of the board through the RS485 bus and the Zmodem file transfer protocol, and then continuously writes the data in the FIFO to the flash with 0x00800000 as the starting address to avoid overflow of the FIFO buffer;

[0048] Step 4-2: Use Multiboot method to achieve online upgrade;

[0049] Step 4-2-1: Divide the flash into two areas to store two startup files, one area is goldenimage, and the other area is update image; the golden image is used to store the backup logic, and this flash area will not be operated during the remote update operation to prevent the system from failing to start after the remote update fails; the update image is started under normal circumstances, and when the update image image file is damaged or fails to update during the remote update process, the backup startup file golden image image file is started;

[0050] The backup file golden bitstream is stored at address 0x00000000, and the update file updatebitstream is stored at the address specified by the WBSTAR register;

[0051] Step 4-2-2: Perform online operations on the update image area in the Flash;

[0052] Step 4-2-2-1: Erase;

[0053] First, perform an overall erase operation on the second half of the flash starting from address 0x00800000. After the erase is completed, use the Zmodem protocol to perform file transfer and flash programming operations.

[0054] Step 4-2-2-2: Programming;

[0055] The file saving function provided by the Zmodem open source protocol is File_SaveToMemory(char*ptrdat,u16lenth). By calling this function, the transmission file data can be saved. While transmitting the cache, this function continuously writes the received file cache data from the FIFO to the memory area starting with the address 0x00800000 in the Flash, that is, the update image area.

[0056] Step 5: When the entire file is transferred and burned successfully, the board will exit the file transfer thread and feedback the burning success information to the host computer through the RS485 bus; when the board is powered off and on again, run the upgraded board program. Specific embodiment:

[0058] 1) System hardware design

[0059] like Figure 1 As shown, the components and cross-linking relationships of the present invention are described; a UART-based logic online upgrade test system is mainly composed of Xilinx's 7 series FPGA, MT25QL128 Flash and RS485 interface chip, and an embedded single-chip computer system is built by instantiating MicroBlaze soft core, UART core and SPI controller core inside the FPGA.

[0060] 2) File transfer method

[0061] a)UART communication method

[0062] The present invention is based on the RS485 bus mode of asynchronous serial communication protocol. The asynchronous serial communication protocol is implemented by the UART core inside the FPGA, and its characteristics are that the sending and receiving sides are different clock domain systems, and the two sides realize the communication handshake and data frame transmission through the start bit and the stop bit. The electrical interface of RS485 is realized by the interface chip.

[0063] b) Zmodem File Transfer Protocol

[0064] The UART protocol only specifies the link layer of communication transmission, but does not specify the application layer protocol. When using the UART protocol for file transfer, it is necessary to build an application layer file transfer protocol to ensure the reliability and correctness of file transmission.

[0065] Zmodem is a file transfer protocol based on serial communication. It was developed by Chuck Forsberg of Omen Technology in 1986 for network provider Telenet.

[0066] 3) File caching method

[0067] When the internal RAM resources of the module to be upgraded are insufficient, the limited BRAM resources inside the FPGA can be used to cache files using the FIFO storage structure. The board uses the FPGA's MicroBlaze soft core to achieve file transmission. Therefore, the method of burning while transmitting is adopted to improve the efficiency of the file transfer and programming process and realize online upgrade.

[0068] Using the FIFO cache data structure, the data cache of the UART core receiving interrupt is written into the FIFO, and the Zmodem protocol driver bottom layer function reads the cached file data from the FIFO. When the Zmodem protocol calls the file storage function File_SaveToMemory, the data passed by File_SaveToMemory is programmed and written into the continuous address of the flash instruction. The data flow is as follows: Figure 2 As shown, the data flow of the online upgrade process of the upgrade program file data is described.

[0069] 4) Online burning technology

[0070] After the host computer transfers the .bin file to be upgraded to the FIFO cache of the board through the RS485 bus and the Zmodem file transfer protocol, it is necessary to write the data in the FIFO continuously to the flash with 0x00800000 as the starting address in time to avoid overflow of the FIFO cache.

[0071] The present invention adopts Xilinx's 7 series FPGA chip and uses the Multiboot method to implement online upgrade technology, which is as follows:

[0072] The flash is divided into two areas to store two startup files, one area is the golden image, and the other area is the update image. The golden image is used to save the backup logic. During the remote update operation, this flash area will not be operated to prevent the system from failing to start after the remote update fails. Under normal circumstances, the update image is started. When the update image file is damaged or fails to update during the remote update process, the backup startup file golden image file is started.

[0073] The backup file golden bitstream is stored at address 0x00000000, and the update file updatebitstream is stored at the address specified by the WBSTAR register. The Mulitiboot method involves online operations on the updataimage area in Flash, and the steps are as follows:

[0074] a) Erase

[0075] In order to improve the efficiency of file transmission and programming process, the present invention first performs an overall erasing operation on the second half of the flash starting from the address 0x00800000. After the erasing is completed, the Zmodem protocol is used to perform file transmission and flash programming operations.

[0076] b) Programming

[0077] The file saving function provided by the Zmodem open source protocol is File_SaveToMemory(char*ptrdat,u16lenth). By calling this function, the transmitted file data can be saved. While transmitting the cache, this function continuously writes the received file cache data from the FIFO to the memory area (update image area) starting with the address 0x00800000 in the Flash.

[0078] like Figure 3 The figure shows the flowchart of the test system logic online upgrade process, which describes the process of the test system logic online upgrade. The test system first configures the RS485 chip, uart core, SPI controller, etc., and initializes the FIFO. When the test system receives the online upgrade command sent by the host computer, it enters the online upgrade mode. After the FLASH erase operation, while the UART interrupt program receives the upgrade file sent by the host computer and writes it into the FIFO, the main program reads the upgrade file data in the FIFO and writes it into the corresponding address area of ​​FIash.

[0079] When the entire file is transferred and burned successfully, the upgraded board jumps out of the file transfer thread and feeds back the successful burning information to the host computer through the RS485 bus. When the board is powered off and then powered on again, the upgraded board program can be run.

Claims

1. A UART-based logic online upgrade test method, characterized in that: The steps include: Step 1: Build a UART-based logic online upgrade test system; The UART-based online logic upgrade test system is assembled on a board, including FPGA, Flash and RS485 interface chip; an embedded single-chip microcomputer system is built by instantiating MicroBlaze soft core, UART core and SPI controller core inside the FPGA; Step 2: Set the file transfer method; 1)UART communication method; RS485 bus mode based on asynchronous serial communication protocol. The asynchronous serial communication protocol is implemented by the UART core inside the FPGA. The sending and receiving sides are different clock domain systems. The sending and receiving sides realize the communication handshake and data frame transmission through the start bit and stop bit. 2) Zmodem file transfer protocol; Zmodem is a file transfer protocol based on serial communication; Step 3: Set the file cache method; When the internal RAM resources of the module to be upgraded are insufficient, the BRAM resources inside the FPGA are used to cache files using the FIFO storage structure. The data cache of the FPGA's UART core receiving interrupt is written into the FIFO, and the Zmodem protocol driver bottom layer function reads the cached file data from the FIFO. When the Zmodem protocol calls the file storage function File_SaveToMemory, the data passed by File_SaveToMemory is programmed and written into the continuous address of the flash instruction. Step 4: Online burning technology; Step 4-1: The host computer transfers the .bin file to be upgraded to the FIFO buffer of the board through the RS485 bus and the Zmodem file transfer protocol, and then continuously writes the data in the FIFO to the flash with 0x00800000 as the starting address to avoid overflow of the FIFO buffer; Step 4-2: Use Multiboot method to achieve online upgrade; Step 4-2-1: Divide the flash into two areas to store two startup files, one area is the golden image, and the other area is the update image; the golden image is used to store the backup logic, and this flash area will not be operated during the remote update operation to prevent the system from failing to start after the remote update fails; In normal circumstances, the updateimage is started. When the updateimage image file is damaged or fails during the remote update process, the backup startup file golden image image file is started; The backup file golden bitstream is stored at address 0x00000000, and the update file update bitstream is stored at the address specified by the WBSTAR register; Step 4-2-2: Perform online operations on the update image area in the Flash; Step 4-2-2-1: Erase; First, perform an overall erase operation on the second half of the flash starting from address 0x00800000. After the erase is completed, use the Zmodem protocol to perform file transfer and flash programming operations. Step 4-2-2-2: Programming; The file saving function provided by the Zmodem open source protocol is File_SaveToMemory(char*ptrdat,u16lenth). By calling this function, the transmission file data can be saved. While transmitting the cache, this function continuously writes the received file cache data from the FIFO to the memory area starting with the address 0x00800000 in the Flash, that is, the update image area. Step 5: When the entire file is transferred and burned successfully, the board will exit the file transfer thread and feedback the burning success information to the host computer through the RS485 bus; After the board is powered off and on again, run the upgraded board program.

2. A UART-based logic online upgrade test method according to claim 1, characterized in that, The FPGA is the 7 series from Xilinx.

3. A UART-based logic online upgrade test method according to claim 1, characterized in that, The model of the Flash is MT25QL128.

Citation Information

Patent Citations

  • FPGA configuration system and configuration method based on network

    CN101783812A

  • Online FPGA software upgrading method based on MicroBlaze soft core

    CN105320531A