Method for remotely updating SoC QSPI Flash based on TCP protocol
Through the remote update method based on TCP protocol, the problem of not being able to solidify the BOOT configuration file in the nonvolatile configuration memory on-site is solved, and QSPI Flash update without JTAG is realized, which simplifies the development process and is suitable for complex application scenarios.
Patent Information
- Application Number
- CN202411688359.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-04-18
AI Technical Summary
After the product is mass-produced and released, especially when the product is placed in a high-risk environment or when the product is integrated into a large machine, the BOOT configuration file in the nonvolatile configuration memory cannot be re-cured on-site through EDA software, resulting in the inability to modify or update.
Using the remote update method based on TCP protocol, the client uploads the BOOT.bin file data and sends update commands through the server, and the server writes the file data to QSPI Flash and performs verification to ensure the correctness of the update.
It can complete the update and upgrade of BOOT files in QSPI Flash without external JTAG, simplifying the development process, shortening the development cycle, and suitable for various complex practical application scenarios.
Smart Images

Figure CN119854278A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of FPGA and software technology, and in particular relates to a method for remotely updating SoC QSPIFlash based on TCP protocol. Background Art
[0002] During the startup and configuration process of ZYNQ SoC, both the configuration information of PS (Processing System) is required, the file type is elf file, and the configuration information of PL (Programmable Logic) is required, the file type is bit file. PS is the main device, and PL is regarded as a peripheral of PS, so PS is needed to configure PL. Usually, the configuration files of PS and PL are merged together using EDA tools to form a BOOT configuration file, which is stored in the non-volatile configuration memory (Quad SPI Flash, NAND Flash, NOR Flash or SD card) on the PS side.
[0003] Usually, if there is a development environment on site, the BOOT configuration file can be fixed to the non-volatile configuration memory through JTAG using EDA software. This method of fixing on site through EDA software is very common and re-fixing is also very convenient. However, in actual applications, it is not necessarily feasible to fix or re-fix the non-volatile configuration memory through EDA software. For example, after the mass production of the product, it enters the maintenance and upgrade stage. If the BOOT configuration file in the non-volatile configuration memory needs to be modified or updated, the product is placed in a high-risk environment or integrated into a large machine, or the JTAG port is not reserved during product production, but the program is fixed to the non-volatile configuration memory in advance, etc., it is not feasible to use EDA software to re-fix on site. At this time, the method of remotely updating the non-volatile configuration memory through the network will be extremely important and convenient. Summary of the invention
[0004] 1. Technical issues to be resolved
[0005] The technical problem to be solved by the present invention is how to provide a method for remotely updating SoC QSPI Flash based on TCP protocol to solve the problem of on-site re-solidification of EDA software.
[0006] (II) Technical solution
[0007] In order to solve the above technical problems, the present invention proposes a method for remotely updating SoC QSPI Flash based on TCP protocol, the method comprising:
[0008] S1, the ZYNQ SoC at the receiving end acts as the server, and the sending end acts as the client to upload the BOOT.bin file data to the server;
[0009] S2. When the client completes the file transfer, the client sends an update command to the server. After receiving the update command, the server starts the update and writes the file data into QSPI.
[0010] S3. The server reads out the data written into QSPI for verification. After the verification is successful, ZYNQ can be restarted in QSPI mode to complete the remote update.
[0011] (III) Beneficial effects
[0012] The present invention proposes a method for remotely updating SoC QSPI Flash based on TCP protocol. The present invention uses rawAPI user programming interface to realize related functions. The technology can achieve the effect of updating and upgrading the BOOT file in QSPI Flash without external JTAG. At the same time, the LWIP protocol stack provided by EDA software shortens the development cycle of related functions. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 is a system block diagram of the present invention;
[0014] Figure 2 This is the design flow chart of the present invention;. DETAILED DESCRIPTION
[0015] In order to make the purpose, content and advantages of the present invention more clear, the specific implementation methods of the present invention are further described in detail below in conjunction with the drawings and examples.
[0016] The present invention is a method for implementing remote upgrade and update of configuration files based on Xilinx ZYNQ SoC architecture devices through Ethernet, and belongs to the field of FPGA and software technology.
[0017] The technical problem to be solved by the present invention is to provide a method for remotely updating and upgrading the BOOT configuration file of a ZYNQ SoC device based on the TCP network protocol, thereby providing a solution for upgrading the configuration file of the SoC device.
[0018] In embedded devices such as ZYNQ SoC, due to limited hardware resources, LWIP as a lightweight implementation of TCP can just meet this demand.
[0019] LWIP is a small open source TCP / IP protocol stack, which is an implementation of TCP / IP. LWIP is a lightweight IP protocol that can run with or without an operating system. The focus of LWIP implementation is to reduce the RAM usage while maintaining the main functions of the TCP protocol. It only needs a dozen KB of RAM and about 40K of ROM to run, which makes the LWIP protocol stack suitable for use in low-end embedded systems.
[0020] The EDA software used to develop ZYNQ Soc uses Vivado 2019.1, which integrates an SDK library built on the open source LWIP library version 2.0.2, and provides two user programming interface methods: rawAPI and socketAPI. Among them, rawAPI is suitable for application scenarios where hardware resources are relatively tight and no operating system is required. SocketAPI needs to run under the operating system. Although it is not suitable for scenarios with tight hardware resources, it has better portability. The present invention will use the rawAPI user programming interface to implement related functions. This technology can achieve the effect of updating and upgrading the BOOT file in QSPI Flash without an external JTAG. At the same time, the LWIP template provided by the EDA software shortens the development cycle of related functions.
[0021] The present invention mainly uses Xilinx ZYNQ7020 FPGA as a hardware development platform with the core device.
[0022] To remotely update the BOOT file in the QSPI Flash, the BOOT.bin file is transmitted to the remote networked file receiving end, i.e., the ZYNQ SoC, through the network protocol (TCP protocol). The receiving end temporarily stores the file in the DDR3 of the ZYNQ PS end. When the file transfer is completed, the receiving end will call the relevant function to write the file data into the QSPI after receiving the update command. After the writing is completed, in order to prevent the writing error, the data written into the QSPI needs to be read out for verification. After the verification is successful, the ZYNQ can be restarted in the QSPI startup mode to complete the remote update.
[0023] The method for remotely updating SoC QSPI Flash based on TCP protocol of the present invention comprises:
[0024] S1. The ZYNQ SoC at the receiving end acts as the server, and the sending end acts as the client to upload the BOOT.bin file data to the server.
[0025] S2. When the client completes file transfer, the client sends an update command to the server. After receiving the update command, the server starts the update and writes the file data into QSPI.
[0026] S3. The server reads out the data written into QSPI for verification. After the verification is successful, ZYNQ can be restarted in QSPI mode to complete the remote update.
[0027] When an unexpected situation occurs such as an error in updating the BOOT file version or a data error occurs during file transfer, a clear interactive command is added to the server and client. The server invalidates the previously transmitted data and prompts the client whether to retransmit it.
[0028] Due to the stability and reliability of the TCP protocol, we choose the TCP protocol as the network transmission protocol. ZYNQ SoC uses the LWIP protocol stack to start the TCP service as the server, and the network debugging assistant on the PC starts the TCP client to transmit the BOOT.bin file. The GigE Gigabit Ethernet interface is set on the server to communicate with the PC and the ZYNQ Soc on the server. The network debugging assistant on the PC is the host computer, responsible for command interaction with the server and sending the BOOT file that needs to be updated to the ZYNQ Soc. The functional block diagram is as follows: Figure 1 shown.
[0029] Select rawAPI as the LWIP user programming interface mode. The interface functions used in TCP protocol implementation can be divided into the following categories according to the functions implemented:
[0030] (1) TCP connection establishment function:
[0031]
[0032] (2) Send TCP data:
[0033]
[0034] (3) TCP receives data:
[0035]
[0036] (4) Polling function
[0037]
[0038] (5) Close and terminate functions
[0039]
[0040] Implementing the remote update function of the BOOT file in the QSPI Flash in ZYNQ Soc requires two parts of work:
[0041] (1) QSPI driver function: mainly responsible for QSPI initialization and QSPI update functions;
[0042] (2) TCP function: Mainly responsible for implementing TCP server functions and receiving files sent by the client and responding to client commands. The specific implementation flow chart is as follows Figure 2 shown.
[0043] The example of the present invention only describes a method for implementing remote update of SoC functions based on TCP technology on Xilinx ZYNQ devices. There are many methods for implementing remote update of BOOT files on Xilinx ZYNQ devices, but the method and process of the present invention are applicable to most designs.
[0044] The present invention uses the rawAPI user programming interface to implement related functions. The technology can achieve the effect of updating and upgrading the BOOT file in the QSPI Flash without an external JTAG. At the same time, the LWIP protocol stack provided by the EDA software shortens the development cycle of related functions.
[0045] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for remotely updating SoC QSPIFlash based on TCP protocol, characterized in that: The method includes: S1, the ZYNQ SoC at the receiving end acts as the server, and the sending end acts as the client to upload the BOOT.bin file data to the server; S2. When the client completes the file transfer, the client sends an update command to the server. After receiving the update command, the server starts the update and writes the file data into QSPI. S3. The server reads out the data written into QSPI for verification. After the verification is successful, ZYNQ can be restarted in the QSPI startup mode to complete the remote update.
2. The method for remotely updating SoC QSPIFlash based on TCP protocol as claimed in claim 1, characterized in that: The ZYNQ is Xilinx ZYNQ7020 FPGA.
3. The method for remotely updating SoC QSPIFlash based on TCP protocol as claimed in claim 1, characterized in that: In S1, the receiving end temporarily stores the file in the DDR3 of the ZYNQ PS end. When the file transfer is completed, the receiving end receives the update command and calls the relevant function to write the file data into the QSPI.
4. The method for remotely updating SoC QSPIFlash based on TCP protocol as claimed in claim 1, characterized in that: In S3, when the version of the BOOT file is updated incorrectly or data errors occur during file transmission, a clear interactive command is added to the server and the client. The server invalidates the previously transmitted data and prompts the client whether to retransmit.
5. The method for remotely updating SoC QSPI Flash based on TCP protocol as described in any one of claims 1 to 4, characterized in that: In S1, ZYNQ SoC uses LWIP protocol stack to start TCP service as the server, and the network debugging assistant on the PC starts TCP client to transmit BOOT.bin file.
6. The method for remotely updating SoC QSPIFlash based on TCP protocol as claimed in claim 5, characterized in that: The LWIP protocol stack is an SDK library built on the open source LWIP library integrated into Vivado, the EDA software for developing ZYNQ Soc.
7. The method for remotely updating SoC QSPIFlash based on TCP protocol as claimed in claim 5, characterized in that: Set up a GigE Gigabit Ethernet interface on the server to communicate with the PC and the ZYNQ Soc on the server.
8. The method for remotely updating SoC QSPI Flash based on TCP protocol as claimed in claim 5, characterized in that: In S1, the LWIP user programming interface mode selects rawAPI, and the interface functions used for TCP protocol implementation include: TCP connection establishment function, TCP data sending function, TCP data receiving function, polling function, and closing and terminating function according to the functions implemented.
9. The method for remotely updating SoC QSPI Flash based on TCP protocol as claimed in claim 8, characterized in that: The TCP connection establishment functions include: tcp_new(), tcp_bind(), tcp_listen(), tcp_accept() and tcp_connect(); the TCP data sending functions include: tcp_write(), tcp_sent() and tcp_output(); the TCP data receiving functions include: tcp_recv(), tcp_recved(); the polling functions include: tcp_poll(); the closing and aborting functions include: tcp_close(), tcp_err() and tcp_abort().
10. The method for remotely updating SoC QSPI Flash based on TCP protocol as claimed in claim 8, characterized in that: To implement the remote update function of the BOOT file in the QSPI Flash in ZYNQ Soc, two parts of work need to be completed: (1) QSPI driver function: responsible for QSPI initialization and QSPI update functions; (2) TCP function: responsible for implementing the TCP server function and receiving files sent by the client and responding to the client's commands.
Citation Information
Patent Citations
Single-board or multi-board system based on ZYNQ and on-line updating method
CN105573800A
An embedded program remote updating system and method based on TCP / IP
CN109828769A
FPGA remote upgrading system based on TCP protocol
CN111198704A
FPGA remote update configuration method and system, electronic equipment and storage medium
CN113268262A
Remote upgrading method, device and system based on ZYNQ platform
CN113791810A