Improved serial programming flash method for fsbl boot program
By improving the FSBL bootloader and adding serial port parsing and programming functions, the application programming problem of Xilinx fully programmable processing platform under extreme conditions has been solved, achieving high reliability and a simplified programming process, which is suitable for Xilinx fully programmable processing platform.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HUNAN HUANAN OPTOELECTRONIC GRP CO LTD
- Filing Date
- 2022-07-07
- Publication Date
- 2026-04-28
AI Technical Summary
On the Xilinx fully programmable processing platform, the existing FSBL bootloader cannot reliably burn applications under extreme conditions such as unexpected power outages or communication interruptions, and the burning process is cumbersome, making it difficult to achieve efficient and reliable application burning.
The FSBL bootloader has been improved, adding serial port data parsing and programming functions. It is implemented in C language, making it concise and highly portable. The FLASH partition is divided, supporting data frame parsing and programming commands, and working with the host computer to complete the high-reliability programming of the application program.
It enables reliable application programming under extreme conditions, simplifies the programming process, reduces resource consumption, avoids programming failures caused by unexpected power outages or communication interruptions, and eliminates the need to disassemble the product.
Smart Images

Figure CN115113906B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of embedded application programming, specifically involving an improved serial port programming method for FLASH using the FSBL (First Stage Boot Load, FSBL) bootloader. It is a method to achieve high-reliability programming of applications by improving the first-stage bootloader's C language program. This method not only simplifies the system's external communication interface by reusing the serial port interface, but also ensures reliable programming even when the application fails to start normally due to extreme situations such as unexpected power outages or communication interruptions. Furthermore, C language offers advantages over assembly language, including simplicity, convenience, and strong portability. This invention is applicable to the Xilinx fully programmable processing platform. Background Technology
[0002] Achieving correct, efficient, and reliable application programming is a prerequisite for ensuring correct application execution. Currently, some platforms suffer from problems such as cumbersome file format conversion, numerous programming steps, and assembly-based bootloaders that hinder debugging. However, the Xilinx Fully Programmable Processing Platform eliminates the need for complex format conversions when programming images; it can directly package and generate an application programming image (Bin file). Given the characteristics of the Xilinx Fully Programmable Processing Platform's boot process, the official FSBL bootloader lacks serial port data parsing and application programming capabilities. Therefore, it is essential to improve the FSBL program based on the official FSBL to enable serial port data parsing and application programming, while also researching how to ensure correct, convenient, and reliable application programming even in extreme situations such as unexpected power outages or communication interruptions during the programming process. Summary of the Invention
[0003] To address the issue of ensuring correct, convenient, and reliable application programming on the Xilinx fully programmable platform even in extreme circumstances such as unexpected power outages or communication interruptions, this invention proposes an improved serial port FLASH programming method for the FSBL bootloader. This method not only achieves highly reliable application programming but also avoids simultaneous reuse of the serial port during startup, thereby reducing resource consumption.
[0004] The present invention adopts the following technical solution:
[0005] An improved method for serial port programming of FLASH using the FSBL bootloader is described below:
[0006] Within 0.5 seconds of powering on the Xilinx fully programmable processing platform, the host computer sends a command to burn the application program. The Xilinx fully programmable processing platform successfully receives the command and enters the application program burning mode through the improved FSBL bootloader. The improved FSBL bootloader works with the host computer to complete the application program burning. Within 0.5 seconds of powering on the Xilinx fully programmable processing platform, if the host computer does not send a command to burn the application program, the Xilinx fully programmable processing platform will start the application normally.
[0007] Furthermore, the improved FSBL bootloader enters the application programming mode through the following steps:
[0008] 1) Improve the FSBL bootloader to first complete the initialization of the serial port, configuration of the serial port interrupt, FLASH initialization, FLASH partition read and write, application data frame parsing, and the processing of information such as sending application data frame burning failure or success instructions;
[0009] The initial serial port function information includes the configured serial port number and the communication protocol with the host computer;
[0010] The configuration serial port interrupt function information includes receiving serial port data and parsing whether the serial port data is a programming instruction. If so, a programming instruction for successful programming mode is sent.
[0011] The FLASH initialization function information includes determining whether it is a FLASH initialization command; if so, the FLASH is initialized and a FLASH initialization success command is sent.
[0012] The FLASH partition read / write function information includes determining whether it is a FLASH partition erase, dividing the FLASH into two independent areas, namely the FSBL partition and the application partition. The FSBL partition is used to store the improved FSBL, and the application partition is used to store the application. If it is, the corresponding FLASH partition is erased and an erase success command is sent.
[0013] The application data frame writing failure or success instruction includes determining whether it is an application data frame. If it is, the application data frame is written to FLASH. If the data of the application data frame written to FLASH is the same, then an application data frame writing success instruction is sent.
[0014] 2) Use the Create Boot Image function in the Vivado SDK software to package the improved FSBL and application into a burning image Bin file. The application needs an address offset equal to the total FSBL partition size, such as 0x420000. After obtaining the burning image Bin file, modify the image data at 0xD00~0xDFF and 0xD3C~0xD3F.
[0015] 3) Use the Program Flash function in the Vivado SDK software to burn the improved FSBL program to the FSBL partition.
[0016] 4) The host computer works with the improved FSBL bootloader to enter the application programming mode.
[0017] Furthermore, the improved FSBL bootloader works with the host computer to complete the application programming through the following steps:
[0018] 1) Connect the Xilinx fully programmable processing platform to a PC equipped with a host computer via a serial-to-USB cable.
[0019] 2) Open the host computer and set the serial port parameters, such as the serial port number and baud rate; after setting, open the serial port, and the command list box will display the information that the serial port was successfully opened.
[0020] 3) After the Xilinx fully programmable processing platform is powered on, a data update command is sent through the host computer. The command list box shows that the data was sent successfully and the application programming mode response command is successfully received. It is important to note that the time interval between the power-on of the Xilinx fully programmable processing platform and the sending of the data update command should not exceed 0.5 seconds.
[0021] 4) After successfully entering the application burning mode, obtain the application burning image Bin file, and read the application burning data according to the offset address as the total FSBL partition size, such as 0x420000. The host computer command list box will display the "Successfully obtained Bin file" command.
[0022] 5) FLASH initialization and application partition erasure: Improved FSBL program to return initialization and erasure success instructions after successful execution, and display the reply information in the host computer command list box.
[0023] 6) Application program data frame download: The application program data frame is downloaded via serial port. The improved FSBL program receives the downloaded data frame. If the data frame is successfully received and the data written to the FLASH partition is consistent with the data in this frame, the improved FSBL program sends a data writing success command for this frame. After the host receives the writing success command, it continues to send the next frame of data until the application program is written; otherwise, it continues to write the current application program data frame.
[0024] Compared with the prior art, the advantages of the present invention are as follows:
[0025] 1. By improving the FSBL bootloader to enter data update mode, highly reliable application programming is achieved. Specifically, the improved FSBL bootloader adds the following functions: communication with the host computer (including serial port initialization and serial port interrupt configuration), FLASH initialization, FLASH partition read / write, application data frame parsing, and sending application data frame programming failure or success commands.
[0026] 2. The FSBL bootloader is improved using the relatively simple and highly portable C language, while avoiding the problem of application failure to start normally and application burning failure due to extreme situations such as unexpected power failure or communication interruption.
[0027] 3. The serial port interface is reused, simplifying the external communication interface of the Xilinx fully programmable processing platform.
[0028] 4. Burning the application does not require disassembling the product, making it convenient and practical. Attached Figure Description
[0029] Figure 1 Improve the FSBL startup flowchart;
[0030] Figure 2 Improved FSBL bootloader workflow diagram;
[0031] Figure 3 Workflow diagram for writing applications to the host computer. Detailed Implementation
[0032] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings.
[0033] This embodiment presents an improved method for serial port programming of the FSBL bootloader into FLASH memory. The specific implementation steps are as follows:
[0034] I. Improve FSBL startup, such as Figure 1 As shown;
[0035] Within 0.5 seconds of powering on the Xilinx fully programmable processing platform, the host computer sends a command to burn the application program. The Xilinx fully programmable processing platform successfully receives the command and enters the application burning mode through the improved FSBL bootloader. The improved FSBL bootloader works with the host computer to complete the application burning. Within 0.5 seconds of powering on the Xilinx fully programmable processing platform, if the host computer does not send a command to burn the application program, the Xilinx fully programmable processing platform will start the application normally.
[0036] II. Improve the FSBL bootloader by entering the application programming mode through the following steps, such as... Figure 2 As shown;
[0037] 1) Improve the FSBL bootloader to first complete the initialization of the serial port, configuration of the serial port interrupt, FLASH initialization, FLASH partition read and write, application data frame parsing, and the processing of information such as sending application data frame burning failure or success instructions;
[0038] Initializing serial port function information includes configuring the serial port number and the communication protocol with the host computer;
[0039] The configuration of serial port interrupt function information includes receiving serial port data and parsing whether the serial port data is a programming instruction. If so, a programming mode success instruction is sent.
[0040] The FLASH initialization function information includes determining whether it is a FLASH initialization command; if so, it initializes the FLASH and sends a FLASH initialization success command.
[0041] The FLASH partition read / write function information includes determining whether it is a FLASH partition erase, dividing the FLASH into two independent areas, namely the FSBL partition and the application partition. The FSBL partition is used to store the improved FSBL, and the application partition is used to store the application. If it is, the corresponding FLASH partition is erased and an erase success command is sent.
[0042] The application data frame writing failure or success instruction includes determining whether it is an application data frame. If it is, the application data frame is written to FLASH. If the data of the application data frame written to FLASH is the same, then an application data frame writing success instruction is sent.
[0043] 2) Use the Create Boot Image function in the Vivado SDK software to package the improved FSBL and application into a burning image Bin file. The application needs an address offset equal to the total FSBL partition size, such as 0x420000. After obtaining the burning image Bin file, modify the image data at 0xD00~0xDFF and 0xD3C~0xD3F.
[0044] 3) Use the Program Flash function in the Vivado SDK software to burn the improved FSBL program to the FSBL partition.
[0045] 4) The host computer works with the improved FSBL bootloader to enter the application programming mode.
[0046] III. Improve the FSBL bootloader's coordination with the host computer to complete the application program burning process, such as... Figure 3 As shown;
[0047] 1) Connect the Xilinx fully programmable processing platform to a PC equipped with a host computer via a serial-to-USB cable;
[0048] 2) Open the host computer and set the serial port parameters, such as the serial port number and baud rate; after setting, open the serial port, and the command list box will display the information that the serial port has been successfully opened;
[0049] 3) After the Xilinx fully programmable processing platform is powered on, a data update command is sent through the host computer. The command list box displays that the data was sent successfully and the application programming mode response command is successfully received. It is particularly important to note that the time interval between the power-on of the Xilinx fully programmable processing platform and the sending of the data update command must not exceed 0.5 seconds.
[0050] 4) After successfully entering the application burning mode, obtain the application burning image Bin file, and read the application burning data according to the offset address as the total FSBL partition size, such as 0x420000. The host computer command list box will display the instruction "Successfully obtained Bin file".
[0051] 5) Improved FLASH initialization and application partition erasure: after successful execution of the FSBL program, it returns initialization and erasure success instructions and displays the reply information in the host computer command list box;
[0052] 6) Application program data frame download: The application program data frame is downloaded via serial port. The improved FSBL program receives the downloaded data frame. If the data frame is successfully received and the data written to the FLASH partition is consistent with the data in this frame, the improved FSBL program sends a data writing success command for this frame. After the host receives the writing success command, it continues to send the next frame of data until the application program is written; otherwise, it continues to write the current application program data frame.
[0053] The above embodiments are merely preferred examples of the present invention and are not intended to limit the present invention. Various changes and modifications may be made to the present invention without departing from the spirit and scope thereof, and all such changes and modifications fall within the scope of protection of the present invention, which is defined by the appended claims and their equivalents.
Claims
1. An improved method for serial port programming of FLASH memory using the FSBL bootloader, characterized in that, The specific implementation steps are as follows:
1. Set the time interval between powering on the Xilinx fully programmable processing platform and sending the data update command to not exceed 0.5 seconds; 2. Within 0.5 seconds of powering on the Xilinx fully programmable processing platform, the host computer sends an application programming command. The Xilinx fully programmable processing platform successfully receives the command and enters the application programming mode through the improved FSBL bootloader. The improved FSBL bootloader works with the host computer to complete the application programming. The improved FSBL bootloader enters the application programming mode through the following steps: 1) Improve the FSBL bootloader to first complete the processing of functional information such as serial port initialization, serial port interrupt configuration, FLASH initialization, FLASH partition read and write, application data frame parsing, and sending application data frame burning failure or success instructions; 2) Use the Create Boot Image function in the Vivado SDK software to package the improved FSBL and application to generate a burning image Bin file. The application needs an address offset equal to the total FSBL partition size. After obtaining the burning image Bin file, modify the image data at 0xD00~0xDFF and 0xD3C~0xD3F. 3) Use the Program Flash function in the Vivado SDK software to burn the improved FSBL program to the FSBL partition; 4) The host computer works with the improved FSBL bootloader to enter the application programming mode; 3. Within 0.5 seconds of powering on the Xilinx fully programmable processing platform, if the host computer does not send an application programming command, the Xilinx fully programmable processing platform will start the application normally.
2. The improved FSBL bootloader serial port FLASH programming method as described in claim 1, characterized in that, The improved FSBL bootloader described in step two works with the host computer and the application program is burned through the following steps: 1) Connect the Xilinx fully programmable processing platform to a PC equipped with a host computer via a serial-to-USB cable; 2) Open the host computer and set the serial port parameters. After setting, open the serial port. The command list box will display the message that the serial port was successfully opened. 3) After the Xilinx fully programmable processing platform is powered on, a data update command is sent through the host computer. The command list box displays that the data was sent successfully and the application programming mode response command is successfully received. 4) After successfully entering the application burning mode, obtain the application burning image Bin file, read the application burning data according to the offset address equal to the total FSBL partition size, and the host computer command list box will display the successful acquisition of Bin file command. 5) Improved FLASH initialization and application partition erasure: after successful execution of the FSBL program, return the initialization and erasure success instructions and display the reply information in the host computer command list box; 6) Application program data frame download: The application program data frame is downloaded via serial port. The improved FSBL program receives the downloaded data frame. If the data frame is successfully received and the data written to the FLASH partition is consistent with the data in this frame, the improved FSBL program sends a data writing success command for this frame. After the host receives the writing success command, it continues to send the next frame of data until the application program is written; otherwise, it continues to write the current application program data frame.
Citation Information
Patent Citations
Interface extensible programming method based on DSP platform
CN103279061A
Upgrading application method of chip application program
CN111176675A