CN113608771A - Method, device and equipment for quickly programming FPGA firmware and readable medium - Google Patents

Method, device and equipment for quickly programming FPGA firmware and readable medium Download PDF

Info

Publication number
CN113608771A
CN113608771A CN202110682321.4A CN202110682321A CN113608771A CN 113608771 A CN113608771 A CN 113608771A CN 202110682321 A CN202110682321 A CN 202110682321A CN 113608771 A CN113608771 A CN 113608771A
Authority
CN
China
Prior art keywords
firmware
data
written
programming
response
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110682321.4A
Other languages
Chinese (zh)
Inventor
冯洋
陈贝
王正浩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd
Original Assignee
Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd filed Critical Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd
Priority to CN202110682321.4A priority Critical patent/CN113608771A/en
Publication of CN113608771A publication Critical patent/CN113608771A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/654Updates using techniques specially adapted for alterable solid state memories, e.g. for EEPROM or flash memories
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1004Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's to protect a block of data words, e.g. CRC or checksum

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides a method, a device, equipment and a readable medium for rapidly programming FPGA firmware, wherein the method comprises the following steps: judging whether the received data is a firmware upgrading instruction; in response to the received data being a firmware upgrading instruction, erasing the data to be written into the firmware at this time and caching the subsequently received data; in response to the cached data reaching a threshold size, beginning to write all of the cached data into the firmware; and responding to the completion of writing all the cached data into the firmware, reading the data written into the firmware and judging whether the firmware programming is successful according to the read data. By using the scheme of the invention, the rapid programming of the FPGA firmware can be realized, the firmware programming speed is greatly improved, the programming flexibility of the FPGA firmware is improved, and the method can be effectively applied to application scenes with special requirements on space and time.

Description

Method, device and equipment for quickly programming FPGA firmware and readable medium
Technical Field
The field relates to the field of computers, and more particularly to a method, a device, equipment and a readable medium for quickly programming FPGA firmware.
Background
The FPGA is called as a field programmable gate array, the chip internally comprises abundant programmable logic units and wiring resources, and the internal logic units and the interconnection structure can be configured and changed by means of software to complete the established design function. The FPGA has high reliability, high parallel processing capability and flexible programmability, and is widely applied to the aspects of communication, medical treatment, industrial Internet and the like.
According to different FPGA implementation processes, the FPGA can be divided into an FPGA based on an SRAM structure, an FPGA based on an antifuse structure and an FPGA based on a Flash structure. The FPGA based on the SRAM structure is widely applied due to its advantages of low implementation cost, large-scale integration, high performance, etc., and at present, the FPGA products of the Altera company and the Xilinx company, which are the largest two FPGA manufacturers, are implemented based on the SRAM process. But the disadvantage is that the SRAM loses all configuration after power is lost, and the FPGA needs to be reconfigured every time it is powered up. The configuration file in which the circuit is to be implemented is generally referred to as the firmware of the FPGA.
Taking the FPGA of Xilinx as an example, the loading modes of the upper electrical firmware file are divided into a main string, a main parallel, a slave string, a slave parallel and a SelectMap. A common loading method is loading a main string, a main parallel and a SelectMAP, where the main string or the main parallel mode is loaded by an FPGA providing a clock, reading a firmware file from a board program memory to complete loading, and the SelectMAP loading is loading by an external controller reading the firmware file from the board program memory or receiving the firmware file from an external interface, and transferring the firmware file to the FPGA to complete loading. It can be seen that the FPGA basically requires an external program memory for storing configuration files when applied, and for larger-scale FPGAs, the configuration files are generally larger, and basically all adopt Flash of SPI or BPI interface as the program memory.
For the programming of the firmware, a JTAG interface programming mode is generally adopted. An FPGA manufacturer can provide a set of complete programming tool kit and a guide file, and a user stores programs and designs circuits related to an external interconnection interface according to the guide file. When the firmware is programmed, the upper computer programming tool and the hardware onboard FPGA are connected through the USB-JTAG download line, and the firmware is programmed to the program memory. At present, with the increasing of the FPGA scale, the data volume of FPGA firmware is increased, in the process of programming by adopting a JTAG interface, the firmware can be read back to an upper computer for verification after being written, and the data transmission volume in the process of programming the firmware is doubled. The programming time of the firmware of the large-scale FPGA is generally over 20 minutes due to the lower data transmission rate of the JTAG, and the USB-JTAG download line is easily interfered by the outside world, so that the programming failure of the firmware is caused, and the programming efficiency of the FPGA firmware is seriously influenced. In some special applications, the conventional firmware programming method cannot meet the requirement under the condition that the whole machine has a strict requirement on firmware programming time or cannot be connected with a JTAG (joint test action group) download line.
Disclosure of Invention
In view of this, an object of the embodiments of the present invention is to provide a method, an apparatus, a device, and a readable medium for fast programming an FPGA firmware, which can implement fast programming of an FPGA firmware by using the technical solution of the present invention, thereby greatly improving a firmware programming speed, improving flexibility of programming an FPGA firmware, and being effectively applied to an application scenario with special requirements on space and time.
Based on the above purpose, an aspect of the embodiments of the present invention provides a method for fast programming FPGA firmware, including the following steps:
judging whether the received data is a firmware upgrading instruction;
in response to the received data being a firmware upgrading instruction, erasing the data to be written into the firmware at this time and caching the subsequently received data;
in response to the cached data reaching a threshold size, beginning to write all of the cached data into the firmware;
and responding to the completion of writing all the cached data into the firmware, reading the data written into the firmware and judging whether the firmware programming is successful according to the read data.
According to an embodiment of the present invention, determining whether the received data is a firmware upgrade instruction includes:
analyzing the received data, and judging whether the analyzed content contains a firmware upgrading instruction;
and determining the received data as a firmware upgrading instruction in response to the analyzed content including the firmware upgrading instruction.
According to an embodiment of the present invention, in response to that the received data is a firmware upgrade instruction, erasing the data to be written into the firmware this time and caching the subsequently received data includes:
in response to the received data being a firmware upgrading instruction, erasing the address data to be written into the firmware;
and buffering the received data again.
According to one embodiment of the invention, the threshold size is 256B.
According to an embodiment of the present invention, in response to that all the cached data is written into the firmware, reading the data written into the firmware and determining whether the firmware programming is successful according to the read data includes:
reading data written into the firmware and calculating a Cyclic Redundancy Check (CRC) of the read data;
calculating the CRC of all data in the cache, and comparing the CRC of all data in the cache with the CRC of the read data;
and judging that the firmware programming is successful in response to the fact that the CRC of all the data in the cache is the same as the CRC of the read data.
According to an embodiment of the present invention, further comprising:
and judging that the firmware programming fails in response to the fact that the CRC of all the data in the cache is different from the CRC of the read data.
According to an embodiment of the present invention, further comprising:
and in response to the failure of the firmware programming, erasing the address data written into the firmware.
In another aspect of the embodiments of the present invention, there is also provided an apparatus for fast programming FPGA firmware, where the apparatus includes:
the judging module is configured to judge whether the received data is a firmware upgrading instruction;
the cache module is configured to respond to that the received data is a firmware upgrading instruction, erase the data to be written into the firmware at this time and cache the subsequently received data;
a write-in module configured to begin writing all of the cached data into the firmware in response to the cached data reaching a threshold size;
and the reading module is configured to respond to the completion of the writing of all the cached data into the firmware, read the data written into the firmware and judge whether the firmware programming is successful according to the read data.
In another aspect of an embodiment of the present invention, there is also provided a computer apparatus including:
at least one processor; and
a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of any of the methods described above.
In another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium storing a computer program, which when executed by a processor implements the steps of any one of the above-mentioned methods.
The invention has the following beneficial technical effects: the method for rapidly programming the FPGA firmware provided by the embodiment of the invention judges whether the received data is a firmware upgrading instruction; in response to the received data being a firmware upgrading instruction, erasing the data to be written into the firmware at this time and caching the subsequently received data; in response to the cached data reaching a threshold size, beginning to write all of the cached data into the firmware; the technical scheme of responding to the fact that all cached data are written into the firmware, reading the data written into the firmware and judging whether the firmware programming is successful according to the read data can achieve rapid programming of the FPGA firmware, greatly improve the firmware programming speed, improve the flexibility of the programming of the FPGA firmware, and can be effectively applied to application scenes with special requirements on space and time.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by using the drawings without creative efforts.
FIG. 1 is a schematic flow chart diagram of a method for fast programming of FPGA firmware, according to one embodiment of the present invention;
FIG. 2 is a schematic diagram of a system for fast programming of FPGA firmware according to an embodiment of the present invention
FIG. 3 is a schematic diagram of an apparatus for fast programming of FPGA firmware according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a computer device according to one embodiment of the present invention;
fig. 5 is a schematic diagram of a computer-readable storage medium according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention are described in further detail with reference to the accompanying drawings.
In view of the above, a first aspect of the embodiments of the present invention provides an embodiment of a method for fast programming FPGA firmware. Fig. 1 shows a schematic flow diagram of the method.
As shown in fig. 1, the method may include the steps of:
s1 judges whether the received data is a firmware upgrade instruction.
Receiving external input data in real time, performing instruction analysis on the data, judging whether the analyzed data is a firmware upgrading instruction or not, and returning to continue receiving and analyzing the data if the firmware upgrading instruction is not analyzed.
S2, in response to the received data being a firmware upgrade instruction, erases the data to be written into the firmware this time and caches subsequently received data.
If the firmware upgrading instruction is successfully analyzed, starting firmware upgrading, sending a Flash erasing instruction, erasing address data to be written into the firmware, and sending the subsequently received data to a data cache module for caching as firmware data.
S3 begins writing all of the buffered data to firmware in response to the buffered data reaching a threshold size.
The data is continuously cached in the cache module, when the cache exceeds the threshold size, the threshold size is 256B, that is, when the data cache is larger than 256B, the data in the data cache module is read and written into the firmware, the instruction that the firmware data is sent is received after the firmware data is sent, and all the data before the instruction needs to be written into the firmware.
S4, responding to the fact that all the cached data are written into the firmware, reading the data written into the firmware and judging whether the firmware programming is successful according to the read data.
After all data are written into the firmware, the firmware data which are just written are read back and sent to the data checking module to complete CRC calculation of the read-back data, the calculation result is compared with the received firmware data CRC to determine whether the written firmware data are completely correct, if the comparison is completely consistent, the firmware programming is successful, a firmware programming success state indication is generated, if the comparison is not consistent, the firmware programming is failed, a firmware programming failure state indication is generated, and meanwhile, the address field which is just written into the firmware is erased.
According to the technical scheme, the FPGA firmware can be quickly programmed, the firmware programming speed is greatly improved, the programming flexibility of the FPGA firmware is improved, and the method can be effectively applied to application scenes with special requirements on space and time.
In a preferred embodiment of the present invention, determining whether the received data is a firmware upgrade instruction includes:
analyzing the received data, and judging whether the analyzed content contains a firmware upgrading instruction;
and determining the received data as a firmware upgrading instruction in response to the analyzed content including the firmware upgrading instruction.
In a preferred embodiment of the present invention, in response to that the received data is a firmware upgrade instruction, erasing the data to be written into the firmware this time and caching the subsequently received data includes:
in response to the received data being a firmware upgrading instruction, erasing the address data to be written into the firmware;
and buffering the received data again.
In a preferred embodiment of the present invention, the threshold size is 256B.
In a preferred embodiment of the present invention, in response to that all the cached data are written into the firmware, reading the data written into the firmware and determining whether the firmware programming is successful according to the read data includes:
reading data written in the firmware and calculating CRC of the read data;
calculating the CRC of all data in the cache, and comparing the CRC of all data in the cache with the CRC of the read data;
and judging that the firmware programming is successful in response to the fact that the CRC of all the data in the cache is the same as the CRC of the read data.
In a preferred embodiment of the present invention, the method further comprises:
and judging that the firmware programming fails in response to the fact that the CRC of all the data in the cache is different from the CRC of the read data.
In a preferred embodiment of the present invention, the method further comprises:
and in response to the failure of the firmware programming, erasing the address data written into the firmware. After all data are written into the firmware, the firmware data which are just written are read back and sent to the data checking module to complete CRC calculation of the read-back data, the calculation result is compared with the received firmware data CRC to determine whether the written firmware data are completely correct, if the comparison is completely consistent, the firmware programming is successful, a firmware programming success state indication is generated, if the comparison is not consistent, the firmware programming is failed, a firmware programming failure state indication is generated, and meanwhile, the address field which is just written into the firmware is erased.
The above method can be implemented by using a system shown in fig. 2, as shown in fig. 2, the system includes an external data receiving module, a data caching module, a read-write control logic module, a data checking module, and a QSPI driving module, and the implementation and functions of each module are as follows:
the external data receiving module can be connected with an external processor, completes input data receiving, completes data content analysis, judges whether a firmware upgrading instruction is received or not, and sends subsequent firmware data to the lower module. The external input interface can adopt PCIE, SRIO, Ethernet or UART and the like according to specific conditions, the module and an external exchange interface are designed into a standard AXI bus interface, so that the module can be conveniently butted with various bus IPs, and when the interfaces are not matched and can not be butted, the external input interface part of the module needs to be customized;
the data cache module can finish caching of firmware data, when the writing of the SPI Flash is considered, the data to be written in needs to be sent after an instruction is sent firstly, in order to improve the writing efficiency of the SPI interface, the FLASH writing adopts a Page writing mode, taking MT25QU type Flash of Meixin corporation as an example, the size of a Page is 256B, and therefore the writing is started when the firmware data cache is larger than 256B;
the read-write control logic module can complete the jump of a Flash read-write erasing control state machine, when a firmware programming instruction is received or a state indication of firmware programming failure is detected, a Flash erasing instruction is sent to a lower-level module, and when data of the data cache module is larger than 256B, a Flash page writing instruction and firmware data to be written are sent to the lower-level module; after firmware data is completely written in, after a firmware data sending finishing instruction is received, Flash quick reading is sent to a lower-level module, written data is read out, and the written data is sent to a data verification module for verification;
the data check module compares the data read back from the Flash with the received firmware data CRC after CRC calculation, and generates firmware upgrading state indication information according to the check result;
and the QSPI driving module finishes the read-write operation of the SPI Flash according to the operation instruction sent by the upper level. To increase the firmware programming rate, the SPI operation is in four-wire two-edge mode, with a clock frequency of 50 MHz.
According to the technical scheme, the FPGA firmware can be quickly programmed, the firmware programming speed is greatly improved, the programming flexibility of the FPGA firmware is improved, and the method can be effectively applied to application scenes with special requirements on space and time.
It should be noted that, as will be understood by those skilled in the art, all or part of the processes in the methods of the above embodiments may be implemented by instructing relevant hardware through a computer program, and the above programs may be stored in a computer-readable storage medium, and when executed, the programs may include the processes of the embodiments of the methods as described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like. The embodiments of the computer program may achieve the same or similar effects as any of the above-described method embodiments.
Furthermore, the method disclosed according to an embodiment of the present invention may also be implemented as a computer program executed by a CPU, and the computer program may be stored in a computer-readable storage medium. The computer program, when executed by the CPU, performs the above-described functions defined in the method disclosed in the embodiments of the present invention.
In view of the above object, according to a second aspect of the embodiments of the present invention, there is provided an apparatus for fast programming FPGA firmware, as shown in fig. 3, the apparatus 200 includes:
and the judging module is configured to judge whether the received data is a firmware upgrading instruction.
Receiving external input data in real time, performing instruction analysis on the data, judging whether the analyzed data is a firmware upgrading instruction or not, and returning to continue receiving and analyzing the data if the firmware upgrading instruction is not analyzed.
And the cache module is configured to erase the data to be written into the firmware and cache the subsequently received data in response to the received data being a firmware upgrading instruction.
If the firmware upgrading instruction is successfully analyzed, starting firmware upgrading, sending a Flash erasing instruction, erasing address data to be written into the firmware, and sending the subsequently received data to a data cache module for caching as firmware data.
A write module configured to begin writing all of the cached data to the firmware in response to the cached data reaching a threshold size.
The data is continuously cached in the cache module, when the cache exceeds the threshold size, the threshold size is 256B, that is, when the data cache is larger than 256B, the data in the data cache module is read and written into the firmware, the instruction that the firmware data is sent is received after the firmware data is sent, and all the data before the instruction needs to be written into the firmware.
And the reading module is configured to respond to the completion of the writing of all the cached data into the firmware, read the data written into the firmware and judge whether the firmware programming is successful according to the read data.
After all data are written into the firmware, the firmware data which are just written are read back and sent to the data checking module to complete CRC calculation of the read-back data, the calculation result is compared with the received firmware data CRC to determine whether the written firmware data are completely correct, if the comparison is completely consistent, the firmware programming is successful, a firmware programming success state indication is generated, if the comparison is not consistent, the firmware programming is failed, a firmware programming failure state indication is generated, and meanwhile, the address field which is just written into the firmware is erased.
In view of the above object, a third aspect of the embodiments of the present invention provides a computer device. Fig. 4 is a schematic diagram of an embodiment of a computer device provided by the present invention. As shown in fig. 4, an embodiment of the present invention includes the following means: at least one processor S21; and a memory S22, the memory S22 storing computer instructions S23 executable on the processor, the instructions when executed by the processor implementing the method steps of:
judging whether the received data is a firmware upgrading instruction;
in response to the received data being a firmware upgrading instruction, erasing the data to be written into the firmware at this time and caching the subsequently received data;
in response to the cached data reaching a threshold size, beginning to write all of the cached data into the firmware;
and responding to the completion of writing all the cached data into the firmware, reading the data written into the firmware and judging whether the firmware programming is successful according to the read data.
In a preferred embodiment of the present invention, determining whether the received data is a firmware upgrade instruction includes:
analyzing the received data, and judging whether the analyzed content contains a firmware upgrading instruction;
and determining the received data as a firmware upgrading instruction in response to the analyzed content including the firmware upgrading instruction.
In a preferred embodiment of the present invention, in response to that the received data is a firmware upgrade instruction, erasing the data to be written into the firmware this time and caching the subsequently received data includes:
in response to the received data being a firmware upgrading instruction, erasing the address data to be written into the firmware;
and buffering the received data again.
In a preferred embodiment of the present invention, the threshold size is 256B.
In a preferred embodiment of the present invention, in response to that all the cached data are written into the firmware, reading the data written into the firmware and determining whether the firmware programming is successful according to the read data includes:
reading data written in the firmware and calculating CRC of the read data;
calculating the CRC of all data in the cache, and comparing the CRC of all data in the cache with the CRC of the read data;
and judging that the firmware programming is successful in response to the fact that the CRC of all the data in the cache is the same as the CRC of the read data.
In a preferred embodiment of the present invention, the method further comprises:
and judging that the firmware programming fails in response to the fact that the CRC of all the data in the cache is different from the CRC of the read data.
In a preferred embodiment of the present invention, the method further comprises:
and in response to the failure of the firmware programming, erasing the address data written into the firmware.
In view of the above object, a fourth aspect of the embodiments of the present invention proposes a computer-readable storage medium. FIG. 5 is a schematic diagram illustrating an embodiment of a computer-readable storage medium provided by the present invention. As shown in fig. 5, the computer readable storage medium stores S31 a computer program that, when executed by a processor, performs the method of S32:
judging whether the received data is a firmware upgrading instruction;
in response to the received data being a firmware upgrading instruction, erasing the data to be written into the firmware at this time and caching the subsequently received data;
in response to the cached data reaching a threshold size, beginning to write all of the cached data into the firmware;
and responding to the completion of writing all the cached data into the firmware, reading the data written into the firmware and judging whether the firmware programming is successful according to the read data.
In a preferred embodiment of the present invention, determining whether the received data is a firmware upgrade instruction includes:
analyzing the received data, and judging whether the analyzed content contains a firmware upgrading instruction;
and determining the received data as a firmware upgrading instruction in response to the analyzed content including the firmware upgrading instruction.
In a preferred embodiment of the present invention, in response to that the received data is a firmware upgrade instruction, erasing the data to be written into the firmware this time and caching the subsequently received data includes:
in response to the received data being a firmware upgrading instruction, erasing the address data to be written into the firmware;
and buffering the received data again.
In a preferred embodiment of the present invention, the threshold size is 256B.
In a preferred embodiment of the present invention, in response to that all the cached data are written into the firmware, reading the data written into the firmware and determining whether the firmware programming is successful according to the read data includes:
reading data written in the firmware and calculating CRC of the read data;
calculating the CRC of all data in the cache, and comparing the CRC of all data in the cache with the CRC of the read data;
and judging that the firmware programming is successful in response to the fact that the CRC of all the data in the cache is the same as the CRC of the read data.
In a preferred embodiment of the present invention, the method further comprises:
and judging that the firmware programming fails in response to the fact that the CRC of all the data in the cache is different from the CRC of the read data.
In a preferred embodiment of the present invention, the method further comprises:
and in response to the failure of the firmware programming, erasing the address data written into the firmware.
Furthermore, the methods disclosed according to embodiments of the present invention may also be implemented as a computer program executed by a processor, which may be stored in a computer-readable storage medium. Which when executed by a processor performs the above-described functions defined in the methods disclosed in embodiments of the invention.
Further, the above method steps and system elements may also be implemented using a controller and a computer readable storage medium for storing a computer program for causing the controller to implement the functions of the above steps or elements.
Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as software or hardware depends upon the particular application and design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the disclosed embodiments of the present invention.
In one or more exemplary designs, the functions may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer. By way of example, and not limitation, such computer-readable media can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a general-purpose or special-purpose computer, or a general-purpose or special-purpose processor. Also, any connection is properly termed a computer-readable medium. For example, if the software is transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, Digital Subscriber Line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. Disk and disc, as used herein, includes Compact Disc (CD), laser disc, optical disc, Digital Versatile Disc (DVD), floppy disk, blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
The foregoing is an exemplary embodiment of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the present disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements of the disclosed embodiments of the invention may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.
It should be understood that, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.
The numbers of the embodiments disclosed in the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, of embodiments of the invention is limited to these examples; within the idea of an embodiment of the invention, also technical features in the above embodiment or in different embodiments may be combined and there are many other variations of the different aspects of the embodiments of the invention as described above, which are not provided in detail for the sake of brevity. Therefore, any omissions, modifications, substitutions, improvements, and the like that may be made without departing from the spirit and principles of the embodiments of the present invention are intended to be included within the scope of the embodiments of the present invention.

Claims (10)

1. A method for quickly programming FPGA firmware is characterized by comprising the following steps:
judging whether the received data is a firmware upgrading instruction;
in response to the received data being a firmware upgrading instruction, erasing the data to be written into the firmware at this time and caching the subsequently received data;
in response to the cached data reaching a threshold size, beginning to write all of the cached data into the firmware;
and responding to the completion of writing all the cached data into the firmware, reading the data written into the firmware and judging whether the firmware programming is successful according to the read data.
2. The method of claim 1, wherein determining whether the received data is a firmware upgrade instruction comprises:
analyzing the received data, and judging whether the analyzed content contains a firmware upgrading instruction;
and determining the received data as a firmware upgrading instruction in response to the analyzed content including the firmware upgrading instruction.
3. The method of claim 1, wherein in response to the received data being a firmware upgrade instruction, erasing data to be written into the firmware this time and caching subsequently received data comprises:
in response to the received data being a firmware upgrading instruction, erasing the address data to be written into the firmware;
and buffering the received data again.
4. The method of claim 1, wherein the threshold size is 256B.
5. The method of claim 1, wherein in response to the buffered data being written to the firmware, reading the data written to the firmware and determining whether the firmware programming was successful based on the read data comprises:
reading data written in the firmware and calculating CRC of the read data;
calculating the CRC of all data in the cache, and comparing the CRC of all data in the cache with the CRC of the read data;
and judging that the firmware programming is successful in response to the fact that the CRC of all the data in the cache is the same as the CRC of the read data.
6. The method of claim 5, further comprising:
and judging that the firmware programming fails in response to the fact that the CRC of all the data in the cache is different from the CRC of the read data.
7. The method of claim 6, further comprising:
and in response to the failure of the firmware programming, erasing the address data written into the firmware.
8. An apparatus for rapidly programming FPGA firmware, the apparatus comprising:
the judging module is configured to judge whether the received data is a firmware upgrading instruction;
the cache module is configured to respond to that the received data is a firmware upgrading instruction, erase the data to be written into the firmware at this time and cache the subsequently received data;
a write module configured to begin writing all of the cached data to firmware in response to the cached data reaching a threshold size;
and the reading module is configured to respond to the completion of the writing of all the cached data into the firmware, read the data written into the firmware and judge whether the firmware programming is successful according to the read data.
9. A computer device, comprising:
at least one processor; and
a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of the method of any one of claims 1 to 7.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
CN202110682321.4A 2021-06-20 2021-06-20 Method, device and equipment for quickly programming FPGA firmware and readable medium Pending CN113608771A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110682321.4A CN113608771A (en) 2021-06-20 2021-06-20 Method, device and equipment for quickly programming FPGA firmware and readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110682321.4A CN113608771A (en) 2021-06-20 2021-06-20 Method, device and equipment for quickly programming FPGA firmware and readable medium

Publications (1)

Publication Number Publication Date
CN113608771A true CN113608771A (en) 2021-11-05

Family

ID=78336622

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110682321.4A Pending CN113608771A (en) 2021-06-20 2021-06-20 Method, device and equipment for quickly programming FPGA firmware and readable medium

Country Status (1)

Country Link
CN (1) CN113608771A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117348909A (en) * 2023-12-04 2024-01-05 成都佰维存储科技有限公司 eMMC upgrading method, chip, equipment and storage medium

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107450945A (en) * 2017-07-13 2017-12-08 北京小鸟看看科技有限公司 A kind of firmware update of virtual reality device
CN108153482A (en) * 2016-12-05 2018-06-12 厦门鑫忆讯科技有限公司 I/O command processing method and Media Interface Connector controller
CN108170457A (en) * 2017-12-27 2018-06-15 上海闻泰电子科技有限公司 Firmware upgrade method, device and VR head-mounted displays
CN111459526A (en) * 2019-01-18 2020-07-28 苏州信卓胜电子科技有限公司 Single chip microcomputer online upgrading method based on CAN communication
CN111752583A (en) * 2020-06-11 2020-10-09 Oppo广东移动通信有限公司 Firmware upgrading method and device, electronic equipment and computer readable storage medium
CN111752584A (en) * 2020-06-11 2020-10-09 Oppo广东移动通信有限公司 Firmware upgrading method and device, electronic equipment and computer readable storage medium
CN111786820A (en) * 2020-06-16 2020-10-16 浙江国利网安科技有限公司 Firmware updating method and device and network equipment
CN111831309A (en) * 2020-07-16 2020-10-27 深圳市朗科智能电气股份有限公司 Upgrading method, device, equipment and medium for multiple MCUs (micro control units) in Wifi (wireless fidelity) of Internet of things
CN111857571A (en) * 2020-06-12 2020-10-30 苏州浪潮智能科技有限公司 Solid state disk physical block address distribution method, device, equipment and storage medium
CN112136104A (en) * 2019-07-29 2020-12-25 深圳市大疆创新科技有限公司 Data packet writing method and device, control terminal and movable platform
CN112214230A (en) * 2020-09-15 2021-01-12 广芯微电子(广州)股份有限公司 Chip program programming device and chip program programming method

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108153482A (en) * 2016-12-05 2018-06-12 厦门鑫忆讯科技有限公司 I/O command processing method and Media Interface Connector controller
CN107450945A (en) * 2017-07-13 2017-12-08 北京小鸟看看科技有限公司 A kind of firmware update of virtual reality device
CN108170457A (en) * 2017-12-27 2018-06-15 上海闻泰电子科技有限公司 Firmware upgrade method, device and VR head-mounted displays
CN111459526A (en) * 2019-01-18 2020-07-28 苏州信卓胜电子科技有限公司 Single chip microcomputer online upgrading method based on CAN communication
CN112136104A (en) * 2019-07-29 2020-12-25 深圳市大疆创新科技有限公司 Data packet writing method and device, control terminal and movable platform
CN111752583A (en) * 2020-06-11 2020-10-09 Oppo广东移动通信有限公司 Firmware upgrading method and device, electronic equipment and computer readable storage medium
CN111752584A (en) * 2020-06-11 2020-10-09 Oppo广东移动通信有限公司 Firmware upgrading method and device, electronic equipment and computer readable storage medium
CN111857571A (en) * 2020-06-12 2020-10-30 苏州浪潮智能科技有限公司 Solid state disk physical block address distribution method, device, equipment and storage medium
CN111786820A (en) * 2020-06-16 2020-10-16 浙江国利网安科技有限公司 Firmware updating method and device and network equipment
CN111831309A (en) * 2020-07-16 2020-10-27 深圳市朗科智能电气股份有限公司 Upgrading method, device, equipment and medium for multiple MCUs (micro control units) in Wifi (wireless fidelity) of Internet of things
CN112214230A (en) * 2020-09-15 2021-01-12 广芯微电子(广州)股份有限公司 Chip program programming device and chip program programming method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117348909A (en) * 2023-12-04 2024-01-05 成都佰维存储科技有限公司 eMMC upgrading method, chip, equipment and storage medium
CN117348909B (en) * 2023-12-04 2024-02-27 成都佰维存储科技有限公司 eMMC upgrading method, chip, equipment and storage medium

Similar Documents

Publication Publication Date Title
US9164682B2 (en) Nonvolatile storage device and operating system (OS) image program method thereof
JP5192587B2 (en) Memory system copyback optimization
US8234541B2 (en) Method and controller for data access in a flash memory
KR101819014B1 (en) Method and controller for managing memory device
US20100241914A1 (en) Controller having flash memory testing functions, and storage system and testing method thereof
US9099193B2 (en) Data storage device and operating method thereof
US20160110255A1 (en) Data storage system, data storage device and raid controller
US20070168736A1 (en) Breakpoint groups
US20150019904A1 (en) Data processing system and operating method thereof
US20130166991A1 (en) Non-Volatile Semiconductor Memory Device Using Mats with Error Detection and Correction and Methods of Managing the Same
CN106575250B (en) Method and system for improving transfer buffer utilization of solid state drives using NAND page buffers
TWI506438B (en) Data storage apparatus and management method thereof
CN103544994A (en) Flash memory controller and flash memory debugging method
CN113608771A (en) Method, device and equipment for quickly programming FPGA firmware and readable medium
US11093369B2 (en) Reconfigurable simulation system and method for testing firmware of storage
CN111813432A (en) FPGA configuration upgrading method and FPGA platform
KR20140030733A (en) Memory controller and electronic device having the memory controller
US11373723B2 (en) Encoder built-in self-test circuit applied in flash memory controller and associated method
CN111090539A (en) Dual-flash-memory self-repairing method and device based on CPLD
CN109445686B (en) Storage disk and data access method
US10304557B2 (en) Methods for operating a data storage device and data storage device utilizing the same
CN117976023A (en) Memory capacity testing method and device, storage medium and electronic equipment
CN112820341B (en) Memory inspection method, memory inspection device and memory inspection system
CN213211012U (en) Online upgrading device of laser radar system and laser radar system
CN111370051B (en) Nonvolatile memory verification system and method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination