[go: up one dir, main page]

CN114461142B - Method, system, device and medium for reading and writing Flash data - Google Patents

Method, system, device and medium for reading and writing Flash data Download PDF

Info

Publication number
CN114461142B
CN114461142B CN202210017456.3A CN202210017456A CN114461142B CN 114461142 B CN114461142 B CN 114461142B CN 202210017456 A CN202210017456 A CN 202210017456A CN 114461142 B CN114461142 B CN 114461142B
Authority
CN
China
Prior art keywords
data
flash memory
main control
control chip
cpld
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.)
Active
Application number
CN202210017456.3A
Other languages
Chinese (zh)
Other versions
CN114461142A (en
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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202210017456.3A priority Critical patent/CN114461142B/en
Publication of CN114461142A publication Critical patent/CN114461142A/en
Application granted granted Critical
Publication of CN114461142B publication Critical patent/CN114461142B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Read Only Memory (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

本申请公开了一种读写Flash数据的方法、系统、装置及介质,CPLD分别与主控芯片和Flash存储器连接,CPLD接收Flash存储器发送的数据后将数据发送至主控芯片,CPLD用于在主控芯片读写Flash存储器中的数据时作为监控装置,判断主控芯片与Flash存储器中数据是否同步,若判断主控芯片与Flash存储器中数据不同步,由CPLD同时向主控芯片与Flash存储器发送复位信号,CPLD实现主控芯片对Flash存储器进行读写动作时的监控。

The application discloses a method, system, device and medium for reading and writing Flash data. The CPLD is respectively connected to the main control chip and the Flash memory. After receiving the data sent by the Flash memory, the CPLD sends the data to the main control chip. The CPLD is used in When the main control chip reads and writes the data in the Flash memory, it is used as a monitoring device to judge whether the data in the main control chip and the Flash memory are synchronized. If it is judged that the data in the main control chip and the Flash memory are not Send a reset signal, and the CPLD realizes the monitoring when the main control chip reads and writes the Flash memory.

Description

一种读写Flash数据的方法、系统、装置及介质A method, system, device and medium for reading and writing Flash data

技术领域technical field

本申请涉及数据读取技术领域,特别是涉及一种读写Flash数据的方法、系统、装置及介质。The present application relates to the technical field of data reading, in particular to a method, system, device and medium for reading and writing Flash data.

背景技术Background technique

服务器作为信息基础建设设施的重要组成部分,在高速发展的信息社会发挥着越来越重要的作用。服务器的设计上一般有存放运行程序的Flash存储器,系统启动时,主控芯片加载Flash存储器内的程序,从而正确的进行系统的配置等,保证服务器的正常运行。现有的,主控芯片与Flash存储器直接连接,当系统启动时,主控芯片直接开始读取Flash存储器内的数据,读取完成后,加载到内部的寄存器中,对寄存器进行配置,运行程序。As an important part of information infrastructure, servers are playing an increasingly important role in the rapidly developing information society. The design of the server generally has a Flash memory for storing the running program. When the system is started, the main control chip loads the program in the Flash memory, so as to correctly configure the system and ensure the normal operation of the server. Currently, the main control chip is directly connected to the Flash memory. When the system starts, the main control chip directly starts to read the data in the Flash memory. After the reading is completed, it is loaded into the internal register, configures the register, and runs the program. .

主控芯片读取Flash存储器内的数据的这一过程,是不受控制的,如果数据加载过程中出现加载失败,无法进行有效的定位分析,Flash存储器的硬件线路设计上不能使得Flash存储器跟随系统复位一起,存在复位后主控芯片的地址模式与Flash存储器的地址模式不一致的冲突,造成Flash存储器内数据被损坏以及擦除。The process of the main control chip reading the data in the Flash memory is uncontrollable. If there is a loading failure during the data loading process, effective positioning analysis cannot be performed. The hardware circuit design of the Flash memory cannot make the Flash memory follow the system. Together with the reset, there is a conflict between the address mode of the main control chip and the address mode of the Flash memory after the reset, causing data in the Flash memory to be damaged and erased.

由此可见,如何加强主控芯片对Flash存储器进行读写动作的监控,是本领域人员亟待解决的技术问题。It can be seen that how to strengthen the monitoring of the read and write actions of the flash memory by the main control chip is a technical problem to be solved urgently by those skilled in the art.

发明内容Contents of the invention

本申请的目的是提供一种读写Flash数据的方法、系统、装置及介质。The purpose of this application is to provide a method, system, device and medium for reading and writing Flash data.

为解决上述技术问题,本申请提供一种Flash数据读写方法,应用于CPLD,所述CPLD分别与主控芯片和Flash存储器连接,所述方法包括:In order to solve the above-mentioned technical problems, the application provides a method for reading and writing Flash data, which is applied to a CPLD, and the CPLD is respectively connected with a main control chip and a Flash memory, and the method includes:

接收所述Flash存储器发送的数据;Receive data sent by the Flash memory;

将所述数据发送至所述主控芯片和将所述数据存储至所述CPLD的UFM寄存器;Sending the data to the main control chip and storing the data to the UFM register of the CPLD;

判断所述主控芯片与所述Flash存储器中数据是否同步;Judging whether the main control chip is synchronized with the data in the Flash memory;

若否,向所述主控芯片和所述Flash存储器发送复位信号,所述复位信号用于控制所述主控芯片和所述Flash存储器同时进行复位。If not, send a reset signal to the main control chip and the Flash memory, where the reset signal is used to control the main control chip and the Flash memory to reset simultaneously.

优选地,所述的Flash数据读写方法中,所述将所述数据存储至UFM寄存器之后,还包括:Preferably, in the described Flash data reading and writing method, after the described data is stored in the UFM register, it also includes:

当所述主控芯片重启或加载所述数据失败时,向所述主控芯片和所述Flash存储器发送复位信号。When the main control chip restarts or fails to load the data, send a reset signal to the main control chip and the Flash memory.

优选地,所述的Flash数据读写方法中,所述将所述数据存储至UFM寄存器之后,还包括:Preferably, in the described Flash data reading and writing method, after the described data is stored in the UFM register, it also includes:

当接收到所述BMC发送的所述Flash存储器与所述UFM寄存器内的数据不一致的信号时,向所述主控芯片和所述Flash存储器发送复位信号。When receiving the signal sent by the BMC that the data in the Flash memory is inconsistent with the data in the UFM register, send a reset signal to the main control chip and the Flash memory.

优选地,所述的Flash数据读写方法中,所述将所述数据发送至主控芯片之后,还包括:Preferably, in the described Flash data reading and writing method, after the described data is sent to the main control chip, it also includes:

当所述主控芯片读取所述数据失败时,存储当前所述数据。When the main control chip fails to read the data, store the current data.

本申请还提供一种Flash数据读写系统,包括:The application also provides a Flash data reading and writing system, including:

主控芯片,CPLD,Flash存储器;Main control chip, CPLD, Flash memory;

所述CPLD包含UFM寄存器;Described CPLD comprises UFM register;

所述主控芯片与所述CPLD连接,所述CPLD与所述Flash存储器连接,The main control chip is connected to the CPLD, and the CPLD is connected to the Flash memory,

所述CPLD用于接收所述Flash存储器发送的数据,并将所述数据发送至所述主控芯片和将所述数据存储至所述UFM寄存器;所述CPLD还用于当所述主控芯片与所述Flash存储器中数据不同步时,向所述主控芯片和所述Flash存储器发送复位信号,所述复位信号用于控制所述主控芯片和所述Flash存储器同时进行复位。The CPLD is used to receive the data sent by the Flash memory, and send the data to the main control chip and store the data to the UFM register; the CPLD is also used as the main control chip When the data in the Flash memory is not synchronized, a reset signal is sent to the main control chip and the Flash memory, and the reset signal is used to control the main control chip and the Flash memory to reset simultaneously.

优选地,所述的Flash数据读写系统中,还包括:BMC;Preferably, in the described Flash data reading and writing system, also include: BMC;

所述BMC与所述CPLD和所述Flash存储器连接,所述BMC用于校验所述Flash存储器与所述UFM寄存器内的数据是否一致。The BMC is connected with the CPLD and the Flash memory, and the BMC is used to check whether the data in the Flash memory and the UFM register are consistent.

优选地,所述的Flash数据读写系统中,所述主控芯片与所述CPLD通过SPI总线连接,所述CPLD与所述Flash存储器通过所述SPI总线连接,所述CPLD与所述BMC通过IIC总线连接。Preferably, in the described Flash data reading and writing system, the main control chip is connected to the CPLD through the SPI bus, the CPLD is connected to the Flash memory through the SPI bus, and the CPLD is connected to the BMC through the IIC bus connection.

本申请还提供一种Flash数据读写装置,应用于CPLD,所述CPLD分别与主控芯片和Flash存储器连接,所述装置包括:The application also provides a Flash data reading and writing device, which is applied to CPLD, and the CPLD is respectively connected with the main control chip and the Flash memory, and the device includes:

接收模块,用于接收所述Flash存储器发送的数据;A receiving module, configured to receive data sent by the Flash memory;

存储模块,用于将所述数据发送至所述主控芯片和将所述数据存储至所述CPLD的UFM寄存器;A storage module, configured to send the data to the main control chip and store the data to the UFM register of the CPLD;

判断模块,用于判断所述主控芯片与所述Flash存储器中数据是否同步;若否,触发复位模块。The judging module is used to judge whether the main control chip is synchronized with the data in the Flash memory; if not, trigger the reset module.

所述复位模块,用于向所述主控芯片和所述Flash存储器发送复位信号,所述复位信号用于控制所述主控芯片和所述Flash存储器同时进行复位。The reset module is configured to send a reset signal to the main control chip and the Flash memory, and the reset signal is used to control the main control chip and the Flash memory to reset simultaneously.

发送模块,用于当所述主控芯片重启或加载所述数据失败时,向所述主控芯片和所述Flash存储器发送复位信号。A sending module, configured to send a reset signal to the main control chip and the Flash memory when the main control chip restarts or fails to load the data.

接收控制模块,用于当接收到所述BMC发送的所述Flash存储器与所述UFM寄存器内的数据不一致的信号时,向所述主控芯片和所述Flash存储器发送复位信号。The receiving control module is configured to send a reset signal to the main control chip and the Flash memory when receiving the signal sent by the BMC that the data in the Flash memory is inconsistent with the data in the UFM register.

错误存储模块,用于当所述主控芯片读取所述数据失败时,存储当前所述数据。The error storage module is used to store the current data when the main control chip fails to read the data.

本申请还提供一种Flash数据读写装置,包括:The application also provides a Flash data reading and writing device, including:

存储器,用于存储计算机程序;memory for storing computer programs;

处理器,用于执行所述计算机程序时实现所述的Flash数据读写方法的步骤。The processor is configured to implement the steps of the method for reading and writing Flash data when executing the computer program.

本申请还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如所述的Flash数据读写方法的步骤。The present application also provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method for reading and writing Flash data are realized.

本申请所提供的Flash数据读写方法,应用于复杂可编程逻辑器件(ComplexProgrammable Logic Device)CPLD,CPLD分别与主控芯片和Flash存储器连接,CPLD接收Flash存储器发送的数据后将数据发送至主控芯片,并将数据存储至CPLD的UFM寄存器;CPLD判断主控芯片与Flash存储器中数据是否同步;若否,向主控芯片和Flash存储器发送复位信号。CPLD用于在主控芯片读写Flash存储器中的数据时作为监控装置,判断主控芯片与Flash存储器中数据是否同步,若判断主控芯片与Flash存储器中数据不同步,由CPLD同时向主控芯片与Flash存储器发送复位信号,CPLD实现主控芯片对Flash存储器进行读写动作时的监控。The method for reading and writing Flash data provided by this application is applied to a complex programmable logic device (Complex Programmable Logic Device) CPLD. The CPLD is connected to the main control chip and the Flash memory respectively. After receiving the data sent by the Flash memory, the CPLD sends the data to the main control chip, and store the data in the UFM register of the CPLD; the CPLD judges whether the data in the main control chip and the Flash memory are synchronized; if not, sends a reset signal to the main control chip and the Flash memory. The CPLD is used as a monitoring device when the main control chip reads and writes data in the Flash memory, and judges whether the data in the main control chip and the Flash memory are synchronized. If it is judged that the data in the main control chip and the Flash memory are not The chip and the Flash memory send a reset signal, and the CPLD realizes the monitoring when the main control chip reads and writes the Flash memory.

另外,本申请还提供一种Flash数据读写系统,装置与计算机可读存储介质,与上述方法对应,效果同上。In addition, the present application also provides a Flash data reading and writing system, a device and a computer-readable storage medium, corresponding to the above method, and the effect is the same as above.

附图说明Description of drawings

为了更清楚地说明本申请实施例,下面将对实施例中所需要使用的附图做简单的介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the embodiments of the present application more clearly, the following will briefly introduce the accompanying drawings used in the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. As far as people are concerned, other drawings can also be obtained based on these drawings on the premise of not paying creative work.

图1为本申请实施例提供的一种Flash数据读写方法的流程图;Fig. 1 is the flowchart of a kind of Flash data reading and writing method that the embodiment of the present application provides;

图2为本申请实施例提供的一种Flash数据读写系统的结构图;Fig. 2 is the structural diagram of a kind of Flash data reading and writing system that the embodiment of the application provides;

图3为本申请实施例提供的一种Flash数据读写装置的结构图;Fig. 3 is the structural diagram of a kind of Flash data reading and writing device that the embodiment of the application provides;

图4为本申请另一实施例提供的Flash数据读写装置的结构图。FIG. 4 is a structural diagram of a Flash data reading and writing device provided by another embodiment of the present application.

具体实施方式Detailed ways

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下,所获得的所有其他实施例,都属于本申请保护范围。The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, not all of them. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of this application.

本申请的核心是提供一种加强对Flash存储器内数据读写的监控与管理的方法。The core of the application is to provide a method for strengthening the monitoring and management of reading and writing data in the Flash memory.

为了使本技术领域的人员更好地理解本申请方案,下面结合附图和具体实施方式对本申请作进一步的详细说明。In order to enable those skilled in the art to better understand the solution of the present application, the present application will be further described in detail below in conjunction with the drawings and specific implementation methods.

图1为本申请实施例提供的一种Flash数据读写方法的流程图,应用于CPLD22,所述CPLD22分别与主控芯片21和Flash存储器24连接,如图1所示,Flash数据读写方法包括:Fig. 1 is the flow chart of a kind of Flash data reading and writing method that the embodiment of the present application provides, is applied to CPLD22, and described CPLD22 is connected with main control chip 21 and Flash memory 24 respectively, as shown in Figure 1, Flash data reading and writing method include:

S10:接收Flash存储器24发送的数据;S10: receiving the data sent by the Flash memory 24;

S11:将数据发送至主控芯片21和将数据存储至CPLD22的UFM寄存器23;S11: sending data to the main control chip 21 and storing the data to the UFM register 23 of the CPLD22;

S12:判断主控芯片21与Flash存储器24中数据是否同步;S12: judging whether the data in the main control chip 21 and the Flash memory 24 are synchronized;

S13:若否,向主控芯片21和Flash存储器24发送复位信号,复位信号用于控制主控芯片21和Flash存储器24同时进行复位。S13: If not, send a reset signal to the main control chip 21 and the Flash memory 24, the reset signal is used to control the main control chip 21 and the Flash memory 24 to reset simultaneously.

本实施例提到的CPLD22指的是复杂可编程逻辑器件,由完全可编程与/或阵列以及宏单元库构成。AND/OR阵列可重编程,能够执行众多逻辑功能。宏单元是执行组合逻辑或时序逻辑的功能块,同时还提供了真值或补码输出和以不同的路径反馈等更高灵活性。另外,CPLD22中包含用户存储空间(User Flash Memory,UFM),保存在UFM寄存器23内的数据在CPLD22掉电后仍然存在,不会被清空。The CPLD22 mentioned in this embodiment refers to a complex programmable logic device, which is composed of a fully programmable and/or array and a macro cell library. The AND/OR array is reprogrammable and capable of performing numerous logic functions. Macrocells are functional blocks that implement combinational or sequential logic, while also providing greater flexibility such as true-value or complement output and feedback in different paths. In addition, the CPLD22 includes a user storage space (User Flash Memory, UFM), and the data stored in the UFM register 23 still exists after the CPLD22 is powered off, and will not be cleared.

Flash存储器24又称闪存,不仅具备电子可擦除可编程的性能,还不会因断电丢失数据,同时可以快速读取数据,在服务器上用于存储BIOS程序、BMC25程序等。服务器的主控芯片21通过读取Flash存储器24中存储的数据,读取完成后,加载到内部的寄存器中,对寄存器进行配置,运行程序。在主控芯片21读取数据的过程中,若主控芯片21读取失败,或主控芯片21突然掉电,主控芯片21会重新上电,但Flash存储器24不会跟随主控芯片21进行复位,因此会导致主控芯片21与Flash存储器24之间数据不同步。Flash memory 24, also known as flash memory, not only has electronic erasable and programmable performance, but also will not lose data due to power failure, and can read data quickly, and is used to store BIOS programs, BMC25 programs, etc. on the server. The main control chip 21 of the server reads the data stored in the Flash memory 24, and after the reading is completed, loads the data into the internal registers, configures the registers, and runs the program. In the process of the main control chip 21 reading data, if the main control chip 21 fails to read, or the main control chip 21 suddenly loses power, the main control chip 21 will be powered on again, but the Flash memory 24 will not follow the main control chip 21. Performing a reset will result in data asynchrony between the main control chip 21 and the Flash memory 24 .

步骤S10提到的CPLD22接收Flash存储器24发送的数据,步骤S11将数据发送至主控芯片21,以便于主控芯片21进行读取与加载,在这个过程中,CPLD22仅作为一个主控芯片21读取Flash存储器24的数据的过程中的一个中介,CPLD22串行在主控芯片21与Flash存储器24的连接线路上。另外,步骤S11,CPLD22将数据存储至CPLD22的UFM寄存器23,也可以看作当主控芯片21读取Flash存储器24的数据时,CPLD22读取主控芯片21和Flash存储器24通信总线上的数据,并将数据存储至UFM寄存器23。另外,将数据存储至UFM寄存器23,当主控芯片21读取数据失败时,便可以通过加载CPLD22中存储的这笔数据来分析主控芯片21加载失败的原因,以便于解决错误。The CPLD22 mentioned in step S10 receives the data sent by the Flash memory 24, and step S11 sends the data to the main control chip 21, so that the main control chip 21 reads and loads. In this process, the CPLD22 is only used as a main control chip 21 An intermediary in the process of reading the data of the Flash memory 24, the CPLD22 is serially connected on the connection line between the main control chip 21 and the Flash memory 24. In addition, in step S11, CPLD22 stores data to the UFM register 23 of CPLD22, which can also be regarded as when main control chip 21 reads the data of Flash memory 24, CPLD22 reads data on the communication bus between main control chip 21 and Flash memory 24 , and store the data into the UFM register 23. In addition, the data is stored in the UFM register 23. When the main control chip 21 fails to read the data, the reason for the failure of the main control chip 21 to load can be analyzed by loading the data stored in the CPLD22, so as to solve the error.

步骤S12判断主控芯片21与Flash存储器24中数据是否同步,包括判断主控芯片21与Flash存储器24中数据的时钟状态,地址状态是否同步,若主控芯片21与Flash存储器24中数据不同步,则可能因为主控芯片21与Flash存储器24工作在不同的地址模式下,导致Flash存储器24中存储的内存被损坏。通过步骤S12判断主控芯片21与Flash存储器24中数据是否同步,若不同步,步骤S13向主控芯片21和Flash存储器24发送复位信号,复位信号用于控制主控芯片21和Flash存储器24同时进行复位,主控芯片21和Flash存储器24同时进行复位动作,这样就保证了主控芯片21和Flash存储器24工作在同样的地址模式下,杜绝了Flash存储器24内容被损坏的问题。Step S12 judges whether the data in the main control chip 21 and the Flash memory 24 are synchronous, including judging the clock state of the data in the main control chip 21 and the Flash memory 24, whether the address state is synchronous, if the data in the main control chip 21 and the Flash memory 24 are not synchronous , the memory stored in the Flash memory 24 may be damaged because the main control chip 21 and the Flash memory 24 work in different address modes. Judging by step S12 whether the data in the main control chip 21 and the Flash memory 24 are synchronous, if not synchronous, step S13 sends a reset signal to the main control chip 21 and the Flash memory 24, and the reset signal is used to control the main control chip 21 and the Flash memory 24 simultaneously Carry out reset, main control chip 21 and Flash memory 24 carry out reset action simultaneously, have just guaranteed like this main control chip 21 and Flash memory 24 work under the same address mode, stopped the problem that Flash memory 24 content is damaged.

另外,本实施例不限制主控芯片21与CPLD22的连接方式,也不限制CPLD22与Flash存储器24的连接方式,根据实际需要设计即可;另外,本实施例也不限制主控芯片21的具体类型,例如CPU,MCU,PCH,MCH等。In addition, the present embodiment does not limit the connection mode between the main control chip 21 and the CPLD22, nor does it limit the connection mode between the CPLD22 and the Flash memory 24, it can be designed according to actual needs; in addition, the present embodiment does not limit the specific configuration of the main control chip 21. Type, such as CPU, MCU, PCH, MCH, etc.

通过本实施例提供的方法,CPLD22串行在主控芯片21与Flash存储之间,CPLD22接收Flash存储器24发送的数据后将数据发送至主控芯片21,并将数据存储至CPLD22的UFM寄存器23;CPLD22判断主控芯片21与Flash存储器24中数据是否同步;若否,向主控芯片21和Flash存储器24发送复位信号。CPLD22用于在主控芯片21读写Flash存储器24中的数据时作为监控装置,判断主控芯片21与Flash存储器24中数据是否同步,若判断主控芯片21与Flash存储器24中数据不同步,由CPLD22同时向主控芯片21与Flash存储器24发送复位信号,这样就保证了主控芯片21和Flash存储器24中的数据同步,由CPLD22实现主控芯片21对Flash存储器24进行读写动作时的监控。Through the method provided by this embodiment, the CPLD22 is serially connected between the main control chip 21 and the Flash memory, and the CPLD22 receives the data sent by the Flash memory 24 and sends the data to the main control chip 21, and stores the data in the UFM register 23 of the CPLD22 ; CPLD22 judges whether the data in the main control chip 21 and the Flash memory 24 are synchronized; if not, send a reset signal to the main control chip 21 and the Flash memory 24. CPLD22 is used as monitoring device when main control chip 21 reads and writes the data in Flash memory 24, judges whether the data in main control chip 21 and Flash memory 24 are synchronous, if judge main control chip 21 and data in Flash memory 24 are out of sync, Send reset signal to main control chip 21 and Flash memory 24 simultaneously by CPLD22, like this has just guaranteed the data synchronization in main control chip 21 and Flash memory 24, realizes main control chip 21 when carrying out read-write action to Flash memory 24 by CPLD22 monitor.

根据上述实施例,当主控芯片21因掉电或其他原因重启时,很可能导致主控芯片21与Flash存储器24中的数据不同步,因此,本实施例提供一种优选方案,步骤S11将数据存储至UFM寄存器23之后,还包括:当主控芯片21重启或加载数据失败时,向主控芯片21和Flash存储器24发送复位信号。According to the above-mentioned embodiment, when the main control chip 21 restarts due to power failure or other reasons, it is likely to cause the data in the main control chip 21 and the Flash memory 24 to be out of sync. Therefore, this embodiment provides a preferred solution. Step S11 will After the data is stored in the UFM register 23 , it also includes: sending a reset signal to the main control chip 21 and the Flash memory 24 when the main control chip 21 restarts or fails to load data.

当CPLD22检测到主控芯片21掉电重启或加载数据失败时,直接向主控芯片21和Flash存储器24发送复位信号,复位信号用于控制主控芯片21和Flash存储器24同时进行复位,主控芯片21和Flash存储器24同时进行复位动作,这样就保证了主控芯片21和Flash存储器24工作在同样的地址模式下,杜绝了Flash存储器24内容被损坏的问题。When the CPLD22 detects that the main control chip 21 is powered off and restarts or fails to load data, it directly sends a reset signal to the main control chip 21 and the Flash memory 24. The reset signal is used to control the main control chip 21 and the Flash memory 24 to reset simultaneously, and the main control The chip 21 and the Flash memory 24 reset at the same time, which ensures that the main control chip 21 and the Flash memory 24 work in the same address mode, and prevents the problem that the content of the Flash memory 24 is damaged.

通过本实施例提供的方法,当主控芯片21重启或加载数据失败时,向主控芯片21和Flash存储器24发送复位信号,由CPLD22同时向主控芯片21与Flash存储器24发送复位信号,这样就保证了主控芯片21和Flash存储器24中的数据同步,由CPLD22实现主控芯片21对Flash存储器24进行读写动作时的监控。By the method provided by this embodiment, when the main control chip 21 restarts or fails to load data, a reset signal is sent to the main control chip 21 and the Flash memory 24, and the reset signal is sent to the main control chip 21 and the Flash memory 24 by the CPLD22 simultaneously, thus This ensures that the data in the main control chip 21 and the Flash memory 24 are synchronized, and the CPLD22 realizes the monitoring when the main control chip 21 reads and writes to the Flash memory 24 .

根据上述实施例,为了保证CPLD22读取Flash存储器24中数据准确,因此,本实施例提供一种优选方案,步骤S11将数据存储至UFM寄存器23之后,还包括:当接收到基板管理控制器(Baseboard Management Controller,BMC25)发送的Flash存储器24与UFM寄存器23内的数据不一致的信号时,向主控芯片21和Flash存储器24发送复位信号。According to the foregoing embodiment, in order to ensure that the CPLD22 reads the data in the Flash memory 24 accurately, therefore, this embodiment provides a preferred solution, after step S11 stores the data to the UFM register 23, it also includes: when receiving the baseboard management controller ( When the Flash memory 24 sent by the Baseboard Management Controller (BMC25) is inconsistent with the data in the UFM register 23, a reset signal is sent to the main control chip 21 and the Flash memory 24.

本实施例提到的基板管理控制器BMC25与CPLD22和Flash存储器24连接,用于监测CPLD22中存储到的数据信息和Flash存储器24中的数据是否一致,检验数据的准确性,工作人员可通过读取BMC25的检验结果分析主控芯片21与Flash存储器24中数据通信存在的问题。当BMC25检测到CPLD22的UFM寄存器23中存储的数据与Flash存储器24中的数据不一致时,BMC25向CPLD22发送信号,由CPLD22向主控芯片21和Flash存储器24发送复位信号,这样就保证了主控芯片21和Flash存储器24中的数据同步,由CPLD22实现主控芯片21对Flash存储器24进行读写动作时的监控。The baseboard management controller BMC25 that present embodiment mentions is connected with CPLD22 and Flash memory 24, is used for monitoring whether the data information stored in CPLD22 is consistent with the data in Flash memory 24, checks the accuracy of data, and the staff can read through Take the test result of BMC25 to analyze the problems existing in the data communication between main control chip 21 and Flash memory 24 . When BMC25 detects that the data stored in the UFM register 23 of CPLD22 is inconsistent with the data in the Flash memory 24, the BMC25 sends a signal to the CPLD22, and the CPLD22 sends a reset signal to the main control chip 21 and the Flash memory 24, thus ensuring that the main control The data in the chip 21 and the Flash memory 24 are synchronized, and the CPLD22 realizes the monitoring when the main control chip 21 reads and writes the Flash memory 24 .

通过本实施例提供的方法,使BMC25参与数据读写的校验,提高了数据的安全性与可靠性,进一步提升了系统整体的可靠性。Through the method provided in this embodiment, the BMC25 is allowed to participate in the verification of data reading and writing, which improves the security and reliability of the data, and further improves the reliability of the overall system.

根据上述实施例,主控芯片21读取Flash存储器24中的数据时,可能读取失败,为了能够分析主控芯片21读取数据失败的原因,以便于解决问题,本实施例提供一种优选方案,步骤S11将数据发送至主控芯片21之后,还包括:According to the above-mentioned embodiment, when the main control chip 21 reads the data in the Flash memory 24, it may fail to read. In order to analyze the reason why the main control chip 21 fails to read the data, so as to solve the problem, this embodiment provides a preferred The scheme, after step S11 sends the data to the main control chip 21, also includes:

当主控芯片21读取数据失败时,存储当前数据。When the main control chip 21 fails to read the data, the current data is stored.

当主控芯片21读取数据失败时,主控芯片21会丢失这笔数据,提供CPLD22将这笔数据存储,工作人员可通过查看这笔数据的类型,来分析读取失败的原因,以便于解决问题。When the main control chip 21 failed to read data, the main control chip 21 would lose this data, and provide CPLD22 to store this data, and the staff can analyze the reason for the failure of reading by checking the type of this data, so that Solve the problem.

本申请实施例还提供一种Flash数据读写系统,图2为本申请实施例提供的一种Flash数据读写系统的结构图,如图2所示,包括:The embodiment of the present application also provides a Flash data reading and writing system, and Fig. 2 is a structural diagram of a Flash data reading and writing system provided by the present application embodiment, as shown in Fig. 2 , including:

主控芯片21,CPLD22,Flash存储器24;Main control chip 21, CPLD22, Flash memory 24;

CPLD22包含UFM寄存器23;CPLD22 includes UFM register 23;

主控芯片21与CPLD22连接,CPLD22与Flash存储器24连接,Main control chip 21 is connected with CPLD22, and CPLD22 is connected with Flash memory 24,

CPLD22用于接收Flash存储器24发送的数据,并将数据发送至主控芯片21和将数据存储至UFM寄存器23;CPLD22还用于当主控芯片21与Flash存储器24中数据不同步时,向主控芯片21和Flash存储器24发送复位信号,复位信号用于控制主控芯片21和Flash存储器24同时进行复位。CPLD22 is used for receiving the data that Flash memory 24 sends, and data is sent to main control chip 21 and data is stored in UFM register 23; The control chip 21 and the Flash memory 24 send a reset signal, and the reset signal is used to control the main control chip 21 and the Flash memory 24 to reset simultaneously.

CPLD22将数据存储至CPLD22的UFM寄存器23,也可以看作当主控芯片21读取Flash存储器24的数据时,CPLD22读取主控芯片21和Flash存储器24通信总线上的数据,并将数据存储至UFM寄存器23。另外,将数据存储至UFM寄存器23,当主控芯片21读取数据失败时,便可以通过加载CPLD22中存储的这笔数据来分析主控芯片21加载失败的原因,以便于解决错误。CPLD22 stores data to the UFM register 23 of CPLD22, also can be regarded as when main control chip 21 reads the data of Flash memory 24, CPLD22 reads the data on the communication bus of main control chip 21 and Flash memory 24, and stores the data to UFM register 23. In addition, the data is stored in the UFM register 23. When the main control chip 21 fails to read the data, the reason for the failure of the main control chip 21 to load can be analyzed by loading the data stored in the CPLD22, so as to solve the error.

CPLD22当主控芯片21与Flash存储器24中数据不同步时,向主控芯片21和Flash存储器24发送复位信号,复位信号用于控制主控芯片21和Flash存储器24同时进行复位,主控芯片21和Flash存储器24同时进行复位动作,这样就保证了主控芯片21和Flash存储器24工作在同样的地址模式下,杜绝了Flash存储器24内容被损坏的问题。CPLD22 sends reset signal to main control chip 21 and Flash memory 24 when main control chip 21 and data in Flash memory 24 are out of sync, reset signal is used to control main control chip 21 and Flash memory 24 to reset simultaneously, main control chip 21 The reset action is performed simultaneously with the Flash memory 24, which ensures that the main control chip 21 and the Flash memory 24 work in the same address mode, and prevents the problem that the content of the Flash memory 24 is damaged.

通过本实施例提供的Flash数据读写系统,CPLD22串行在主控芯片21与Flash存储之间,CPLD22接收Flash存储器24发送的数据后将数据发送至主控芯片21,并将数据存储至CPLD22的UFM寄存器23;CPLD22当主控芯片21与Flash存储器24中数据不同步时,向主控芯片21和Flash存储器24发送复位信号,复位信号用于控制主控芯片21和Flash存储器24同时进行复位,CPLD22用于在主控芯片21读写Flash存储器24中的数据时作为监控装置,保证主控芯片21和Flash存储器24中的数据同步,由CPLD22实现主控芯片21对Flash存储器24进行读写动作时的监控。Through the Flash data reading and writing system provided by this embodiment, the CPLD22 is serially connected between the main control chip 21 and the Flash memory, and the CPLD22 receives the data sent by the Flash memory 24 and sends the data to the main control chip 21, and stores the data in the CPLD22 UFM register 23; CPLD22 sends a reset signal to the main control chip 21 and the Flash memory 24 when the data in the main control chip 21 and the Flash memory 24 are not synchronized, and the reset signal is used to control the main control chip 21 and the Flash memory 24 to reset simultaneously , CPLD22 is used as monitoring device when main control chip 21 reads and writes the data in Flash memory 24, guarantees the data synchronization in main control chip 21 and Flash memory 24, realizes that main control chip 21 reads and writes Flash memory 24 by CPLD22 Monitoring during operation.

根据上述实施例,本申请还提供一种优选方案,Flash数据读写系统,还包括:BMC25;According to the foregoing embodiments, the present application also provides a preferred solution, the Flash data reading and writing system, which also includes: BMC25;

所述BMC25与所述CPLD22和所述Flash存储器24连接,所述BMC25用于校验所述Flash存储器24与所述UFM寄存器23内的数据是否一致。The BMC25 is connected with the CPLD22 and the Flash memory 24, and the BMC25 is used to check whether the data in the Flash memory 24 and the UFM register 23 are consistent.

基板管理控制器BMC25与CPLD22和Flash存储器24连接,用于监测CPLD22中存储到的数据信息和Flash存储器24中的数据是否一致,检验数据的准确性,工作人员可通过读取BMC25的检验结果分析主控芯片21与Flash存储器24中数据通信存在的问题。当BMC25检测到CPLD22的UFM寄存器23中存储的数据与Flash存储器24中的数据不一致时,BMC25向CPLD22发送信号,由CPLD22向主控芯片21和Flash存储器24发送复位信号,这样就保证了主控芯片21和Flash存储器24中的数据同步,由CPLD22实现主控芯片21对Flash存储器24进行读写动作时的监控。The baseboard management controller BMC25 is connected with the CPLD22 and the Flash memory 24, and is used to monitor whether the data information stored in the CPLD22 is consistent with the data in the Flash memory 24, and check the accuracy of the data. The staff can analyze the results by reading the BMC25. Problems existing in the data communication between the main control chip 21 and the Flash memory 24 . When BMC25 detects that the data stored in the UFM register 23 of CPLD22 is inconsistent with the data in the Flash memory 24, the BMC25 sends a signal to the CPLD22, and the CPLD22 sends a reset signal to the main control chip 21 and the Flash memory 24, thus ensuring that the main control The data in the chip 21 and the Flash memory 24 are synchronized, and the CPLD22 realizes the monitoring when the main control chip 21 reads and writes the Flash memory 24 .

根据上述实施例,本申请还提供一种优选方案,Flash数据读写系统,所述主控芯片21与所述CPLD22通过串行外设接口(Serial Peripheral Interface,SPI)总线连接,所述CPLD22与所述Flash存储器24通过所述SPI总线连接,CPLD22与BMC25通过集成电路总线(Inter-Integrated Circuit,IIC)总线连接。According to the foregoing embodiments, the present application also provides a preferred solution, a Flash data read-write system, the main control chip 21 and the CPLD22 are connected by a serial peripheral interface (Serial Peripheral Interface, SPI) bus, and the CPLD22 and the The Flash memory 24 is connected through the SPI bus, and the CPLD22 is connected with the BMC25 through an integrated circuit bus (Inter-Integrated Circuit, IIC) bus.

需要说明的是,SPI总线是一种高速的,全双工,同步的通信总线,支持全双工通信,通信简单,数据传输速率块。IIC总线主要是用来连接整体电路,IIC是一种多向控制总线,也就是说多个芯片可以连接到同一总线结构下,同时每个芯片都可以作为实时数据传输的控制源。这种方式简化了信号传输总线接口。It should be noted that the SPI bus is a high-speed, full-duplex, synchronous communication bus that supports full-duplex communication, simple communication, and fast data transfer rates. The IIC bus is mainly used to connect the overall circuit. IIC is a multi-directional control bus, which means that multiple chips can be connected to the same bus structure, and each chip can be used as a control source for real-time data transmission. This approach simplifies the bus interface for signal transmission.

通过SPI总线实现CPLD22与主控芯片21和Flash存储器24之间的通信连接,通信简单,数据传输速率块;通过IIC总线实现CPLD22与BMC25之间的通信连接,结构简单、低功耗、抗干扰强、传输距离长。Realize the communication connection between CPLD22 and the main control chip 21 and Flash memory 24 through SPI bus, the communication is simple, the data transmission speed block; Realize the communication connection between CPLD22 and BMC25 through IIC bus, simple structure, low power consumption, anti-interference Strong, long transmission distance.

在上述实施例中,对于Flash数据读写方法进行了详细描述,本申请还提供Flash数据读写装置对应的实施例。需要说明的是,本申请从两个角度对装置部分的实施例进行描述,一种是基于功能模块的角度,另一种是基于硬件的角度。In the foregoing embodiments, the method for reading and writing Flash data is described in detail, and the present application also provides corresponding embodiments of a device for reading and writing Flash data. It should be noted that this application describes the embodiments of the device part from two perspectives, one is based on the perspective of functional modules, and the other is based on the perspective of hardware.

图3为本申请实施例提供的Flash数据读写装置的结构图,如图3所示,Flash数据读写装置包括:Fig. 3 is the structural diagram of the Flash data read-write device that the embodiment of the present application provides, as shown in Fig. 3, Flash data read-write device comprises:

接收模块31,用于接收Flash存储器24发送的数据;Receiving module 31, for receiving the data that Flash memory 24 sends;

存储模块32,用于将数据发送至主控芯片21和将数据存储至CPLD22的UFM寄存器23;The storage module 32 is used to send data to the main control chip 21 and store the data to the UFM register 23 of the CPLD22;

判断模块33,用于判断主控芯片21与Flash存储器24中数据是否同步;若否,触发复位模块34。The judgment module 33 is used to judge whether the data in the main control chip 21 and the Flash memory 24 are synchronized; if not, trigger the reset module 34 .

复位模块34,用于向主控芯片21和Flash存储器24发送复位信号,复位信号用于控制主控芯片21和Flash存储器24同时进行复位。The reset module 34 is configured to send a reset signal to the main control chip 21 and the Flash memory 24, and the reset signal is used to control the main control chip 21 and the Flash memory 24 to reset simultaneously.

Flash数据读写装置应用于CPLD22,CPLD22分别与主控芯片21和Flash存储器24连接,接收模块31接收Flash存储器24发送的数据,存储模块32将数据发送至主控芯片21和将数据存储至CPLD22的UFM寄存器23,判断模块33判断主控芯片21与Flash存储器24中数据是否同步;若否,触发复位模块34,向主控芯片21和Flash存储器24发送复位信号,复位信号用于控制主控芯片21和Flash存储器24同时进行复位。The Flash data reading and writing device is applied to CPLD22, and CPLD22 is connected with main control chip 21 and Flash memory 24 respectively, and receiving module 31 receives the data that Flash memory 24 sends, and storage module 32 sends data to main control chip 21 and stores data to CPLD22 UFM register 23, judging module 33 judges whether the data in main control chip 21 and Flash memory 24 are synchronized; If not, trigger reset module 34, send reset signal to main control chip 21 and Flash memory 24, reset signal is used for controlling The chip 21 and the Flash memory 24 are reset simultaneously.

CPLD22串行在主控芯片21与Flash存储之间,在主控芯片21读写Flash存储器24中的数据时作为监控装置,判断主控芯片21与Flash存储器24中数据是否同步,若判断主控芯片21与Flash存储器24中数据不同步,由CPLD22同时向主控芯片21与Flash存储器24发送复位信号,这样就保证了主控芯片21和Flash存储器24中的数据同步,由CPLD22实现主控芯片21对Flash存储器24进行读写动作时的监控。The CPLD22 is serially connected between the main control chip 21 and the Flash memory, and is used as a monitoring device when the main control chip 21 reads and writes the data in the Flash memory 24 to judge whether the data in the main control chip 21 and the Flash memory 24 are synchronous. Data in the chip 21 and the Flash memory 24 are asynchronous, and the reset signal is sent to the main control chip 21 and the Flash memory 24 by the CPLD22 simultaneously, so that the data synchronization in the main control chip 21 and the Flash memory 24 has been guaranteed, and the main control chip is realized by the CPLD22 21 Monitoring when the Flash memory 24 is read and written.

该装置还包括:The unit also includes:

发送模块,用于当主控芯片重启或加载数据失败时,向主控芯片和Flash存储器发送复位信号。The sending module is used to send a reset signal to the main control chip and the Flash memory when the main control chip restarts or fails to load data.

接收控制模块,用于当接收到BMC发送的Flash存储器与UFM寄存器内的数据不一致的信号时,向主控芯片和Flash存储器发送复位信号。The receiving control module is used to send a reset signal to the main control chip and the Flash memory when receiving a signal that the Flash memory sent by the BMC is inconsistent with the data in the UFM register.

错误存储模块,用于当主控芯片读取数据失败时,存储当前数据。The error storage module is used to store the current data when the main control chip fails to read the data.

由于装置部分的实施例与方法部分的实施例相互对应,因此装置部分的实施例请参见方法部分的实施例的描述,这里暂不赘述。Since the embodiment of the device part corresponds to the embodiment of the method part, please refer to the description of the embodiment of the method part for the embodiment of the device part, and details will not be repeated here.

图4为本申请另一实施例提供的Flash数据读写装置的结构图,如图4所示,Flash数据读写装置包括:存储器40,用于存储计算机程序;FIG. 4 is a structural diagram of a Flash data read-write device provided by another embodiment of the present application. As shown in FIG. 4, the Flash data read-write device includes: a memory 40 for storing computer programs;

处理器41,用于执行计算机程序时实现如上述实施例Flash数据读写方法的步骤。The processor 41 is configured to implement the steps of the method for reading and writing Flash data in the above-mentioned embodiment when executing the computer program.

本实施例提供的Flash数据读写装置可以包括但不限于智能手机、平板电脑、笔记本电脑或台式电脑等。The Flash data reading and writing device provided in this embodiment may include, but is not limited to, a smart phone, a tablet computer, a notebook computer or a desktop computer, and the like.

其中,处理器41可以包括一个或多个处理核心,比如4核心处理器、8核心处理器等。处理器41可以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable LogicArray,PLA)中的至少一种硬件形式来实现。处理器41也可以包括主处理器和协处理器,主处理器是用于对在唤醒状态下的数据进行处理的处理器,也称中央处理器(CentralProcessing Unit,CPU);协处理器是用于对在待机状态下的数据进行处理的低功耗处理器。在一些实施例中,处理器41可以在集成有图像处理器(Graphics Processing Unit,GPU),GPU用于负责显示屏所需要显示的内容的渲染和绘制。一些实施例中,处理器41还可以包括人工智能(Artificial Intelligence,AI)处理器,该AI处理器用于处理有关机器学习的计算操作。Wherein, the processor 41 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 41 can be realized by using at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field-programmable gate array (Field-Programmable Gate Array, FPGA), programmable logic array (Programmable LogicArray, PLA) . The processor 41 may also include a main processor and a coprocessor, the main processor is a processor for processing data in the wake-up state, and is also called a central processing unit (Central Processing Unit, CPU); Low-power processor for processing data in standby state. In some embodiments, the processor 41 may be integrated with a graphics processor (Graphics Processing Unit, GPU), and the GPU is used for rendering and drawing the content that needs to be displayed on the display screen. In some embodiments, the processor 41 may also include an artificial intelligence (AI) processor, and the AI processor is used to process calculation operations related to machine learning.

存储器40可以包括一个或多个计算机可读存储介质,该计算机可读存储介质可以是非暂态的。存储器40还可包括高速随机存取存储器,以及非易失性存储器,比如一个或多个磁盘存储设备、闪存存储设备。本实施例中,存储器40至少用于存储以下计算机程序401,其中,该计算机程序被处理器41加载并执行之后,能够实现前述任一实施例公开的Flash数据读写方法的相关步骤。另外,存储器40所存储的资源还可以包括操作系统402和数据403等,存储方式可以是短暂存储或者永久存储。其中,操作系统402可以包括Windows、Unix、Linux等。数据403可以包括但不限于实现Flash数据读写方法所涉及到的步骤等。Memory 40 may include one or more computer-readable storage media, which may be non-transitory. The memory 40 may also include high-speed random access memory, and non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In this embodiment, the memory 40 is at least used to store the following computer program 401, wherein, after the computer program is loaded and executed by the processor 41, the relevant steps of the method for reading and writing Flash data disclosed in any of the foregoing embodiments can be implemented. In addition, the resources stored in the memory 40 may also include an operating system 402 and data 403, etc., and the storage method may be temporary storage or permanent storage. Wherein, the operating system 402 may include Windows, Unix, Linux and so on. The data 403 may include, but is not limited to, the steps involved in implementing the method for reading and writing Flash data.

在一些实施例中,Flash数据读写装置还可包括有显示屏42、输入输出接口43、通信接口44、电源45以及通信总线46。In some embodiments, the Flash data reading and writing device may further include a display screen 42 , an input and output interface 43 , a communication interface 44 , a power supply 45 and a communication bus 46 .

本领域技术人员可以理解,图4中示出的结构并不构成对Flash数据读写装置的限定,可以包括比图示更多或更少的组件。Those skilled in the art can understand that the structure shown in FIG. 4 does not constitute a limitation on the Flash data reading and writing device, and may include more or less components than those shown in the figure.

本申请实施例提供的Flash数据读写装置,包括存储器和处理器,处理器在执行存储器存储的程序时,能够实现如下方法:Flash数据读写方法,CPLD22用于在主控芯片21读写Flash存储器24中的数据时作为监控装置,判断主控芯片21与Flash存储器24中数据是否同步,若判断主控芯片21与Flash存储器24中数据不同步,由CPLD22同时向主控芯片21与Flash存储器24发送复位信号,这样就保证了主控芯片21和Flash存储器24中的数据同步,由CPLD22实现主控芯片21对Flash存储器24进行读写动作时的监控。The Flash data read-write device that the embodiment of the present application provides, comprises memory and processor, and processor can realize following method when executing the program stored in memory: Flash data read-write method, CPLD22 is used for reading and writing Flash at main control chip 21 When the data in the memory 24 is used as a monitoring device, it is judged whether the data in the main control chip 21 and the Flash memory 24 are synchronous; 24 sends a reset signal, so that the data synchronization in the main control chip 21 and the Flash memory 24 is guaranteed, and the monitoring when the main control chip 21 performs read and write actions to the Flash memory 24 is realized by the CPLD22.

最后,本申请还提供一种计算机可读存储介质对应的实施例。计算机可读存储介质上存储有计算机程序,计算机程序被处理器执行时实现如上述Flash数据读写方法实施例中记载的步骤。Finally, the present application also provides an embodiment corresponding to a computer-readable storage medium. A computer program is stored on the computer-readable storage medium, and when the computer program is executed by the processor, the steps described in the above-mentioned embodiment of the Flash data reading and writing method are implemented.

可以理解的是,如果上述实施例中的方法以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(RandomAccess Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。It can be understood that if the methods in the above embodiments are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or part of the contribution to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , executing all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk, and various media capable of storing program codes.

本实施例提供的计算机可读存储介质,其上存储有计算机程序,当处理器执行该程序时,可实现以下方法:Flash数据读写方法,CPLD22用于在主控芯片21读写Flash存储器24中的数据时作为监控装置,判断主控芯片21与Flash存储器24中数据是否同步,若判断主控芯片21与Flash存储器24中数据不同步,由CPLD22同时向主控芯片21与Flash存储器24发送复位信号,这样就保证了主控芯片21和Flash存储器24中的数据同步,由CPLD22实现主控芯片21对Flash存储器24进行读写动作时的监控。The computer-readable storage medium provided by the present embodiment stores a computer program on it, and when the processor executes the program, the following methods can be realized: the Flash data reading and writing method, and the CPLD22 is used to read and write the Flash memory 24 at the main control chip 21 When the data in the data is used as a monitoring device, it is judged whether the data in the main control chip 21 and the Flash memory 24 are synchronous. If it is judged that the data in the main control chip 21 and the Flash memory 24 are out of sync, the CPLD22 sends the data to the main control chip 21 and the Flash memory 24 simultaneously. reset signal, thus ensuring the data synchronization between the main control chip 21 and the Flash memory 24, and the monitoring when the main control chip 21 performs read and write actions to the Flash memory 24 by the CPLD22.

以上对本申请所提供的Flash数据读写方法,Flash数据读写系统,装置及介质进行了详细介绍。说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以对本申请进行若干改进和修饰,这些改进和修饰也落入本申请权利要求的保护范围内。The Flash data reading and writing method, Flash data reading and writing system, device and medium provided by this application have been introduced in detail above. Each embodiment in the description is described in a progressive manner, each embodiment focuses on the difference from other embodiments, and the same and similar parts of each embodiment can be referred to each other. As for the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and for relevant details, please refer to the description of the method part. It should be pointed out that those skilled in the art can make some improvements and modifications to the application without departing from the principles of the application, and these improvements and modifications also fall within the protection scope of the claims of the application.

还需要说明的是,在本说明书中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should also be noted that in this specification, relative terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that these entities or operations There is no such actual relationship or order between the operations. Furthermore, the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article, or apparatus comprising a set of elements includes not only those elements, but also includes elements not expressly listed. other elements of or also include elements inherent in such a process, method, article, or device. Without further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising said element.

Claims (10)

1.一种Flash数据读写方法,其特征在于,应用于CPLD,所述CPLD分别与主控芯片和Flash存储器连接,所述方法包括:1. a Flash data reading and writing method, is characterized in that, is applied to CPLD, and described CPLD is connected with main control chip and Flash memory respectively, and described method comprises: 接收所述Flash存储器发送的数据;Receive data sent by the Flash memory; 将所述数据发送至所述主控芯片和将所述数据存储至所述CPLD的UFM寄存器;Sending the data to the main control chip and storing the data to the UFM register of the CPLD; 判断所述主控芯片与所述Flash存储器中数据是否同步;Judging whether the main control chip is synchronized with the data in the Flash memory; 若否,向所述主控芯片和所述Flash存储器发送复位信号,所述复位信号用于控制所述主控芯片和所述Flash存储器同时进行复位。If not, send a reset signal to the main control chip and the Flash memory, where the reset signal is used to control the main control chip and the Flash memory to reset simultaneously. 2.根据权利要求1所述的Flash数据读写方法,其特征在于,所述将所述数据存储至所述CPLD的UFM寄存器之后,还包括:2. Flash data reading and writing method according to claim 1, is characterized in that, described data is stored after the UFM register of described CPLD, also comprises: 当所述主控芯片重启或加载所述数据失败时,向所述主控芯片和所述Flash存储器发送复位信号。When the main control chip restarts or fails to load the data, send a reset signal to the main control chip and the Flash memory. 3.根据权利要求1所述的Flash数据读写方法,其特征在于,所述将所述数据存储至所述CPLD的UFM寄存器之后,还包括:3. Flash data reading and writing method according to claim 1, is characterized in that, described data is stored after the UFM register of described CPLD, also comprises: 当接收到BMC发送的所述Flash存储器与所述UFM寄存器内的数据不一致的信号时,向所述主控芯片和所述Flash存储器发送复位信号;When receiving the signal that the data in the Flash memory sent by the BMC is inconsistent with the data in the UFM register, send a reset signal to the main control chip and the Flash memory; 所述BMC与所述CPLD和所述Flash存储器连接,所述BMC用于校验所述Flash存储器与所述UFM寄存器内的数据是否一致。The BMC is connected with the CPLD and the Flash memory, and the BMC is used to check whether the data in the Flash memory and the UFM register are consistent. 4.根据权利要求1所述的Flash数据读写方法,其特征在于,所述将所述数据发送至所述主控芯片之后,还包括:4. Flash data reading and writing method according to claim 1, is characterized in that, after described described data is sent to described main control chip, also comprise: 当所述主控芯片读取所述数据失败时,存储当前所述数据。When the main control chip fails to read the data, store the current data. 5.一种Flash数据读写系统,其特征在于,包括:5. A Flash data read-write system is characterized in that, comprising: 主控芯片,CPLD,Flash存储器;Main control chip, CPLD, Flash memory; 所述CPLD包含UFM寄存器;Described CPLD comprises UFM register; 所述主控芯片与所述CPLD连接,所述CPLD与所述Flash存储器连接,The main control chip is connected to the CPLD, and the CPLD is connected to the Flash memory, 所述CPLD用于接收所述Flash存储器发送的数据,并将所述数据发送至所述主控芯片和将所述数据存储至所述CPLD的UFM寄存器;所述CPLD还用于当所述主控芯片与所述Flash存储器中数据不同步时,向所述主控芯片和所述Flash存储器发送复位信号,所述复位信号用于控制所述主控芯片和所述Flash存储器同时进行复位。The CPLD is used to receive the data sent by the Flash memory, and send the data to the main control chip and store the data to the UFM register of the CPLD; the CPLD is also used when the main When the control chip and the data in the Flash memory are not synchronized, a reset signal is sent to the main control chip and the Flash memory, and the reset signal is used to control the main control chip and the Flash memory to reset simultaneously. 6.根据权利要求5所述的Flash数据读写系统,其特征在于,还包括:BMC;6. The Flash data reading and writing system according to claim 5, further comprising: BMC; 所述BMC与所述CPLD和所述Flash存储器连接,所述BMC用于校验所述Flash存储器与所述UFM寄存器内的数据是否一致。The BMC is connected with the CPLD and the Flash memory, and the BMC is used to check whether the data in the Flash memory and the UFM register are consistent. 7.根据权利要求6所述的Flash数据读写系统,其特征在于,所述主控芯片与所述CPLD通过SPI总线连接,所述CPLD与所述Flash存储器通过所述SPI总线连接,所述CPLD与所述BMC通过IIC总线连接。7. Flash data reading and writing system according to claim 6, is characterized in that, described main control chip and described CPLD are connected by SPI bus, and described CPLD and described Flash memory are connected by described SPI bus, and described The CPLD is connected with the BMC through the IIC bus. 8.一种Flash数据读写装置,其特征在于,应用于CPLD,所述CPLD分别与主控芯片和Flash存储器连接,所述装置包括:8. A Flash data read-write device, is characterized in that, is applied to CPLD, and described CPLD is connected with main control chip and Flash memory respectively, and described device comprises: 接收模块,用于接收所述Flash存储器发送的数据;A receiving module, configured to receive data sent by the Flash memory; 存储模块,用于将所述数据发送至所述主控芯片和将所述数据存储至所述CPLD的UFM寄存器;A storage module, configured to send the data to the main control chip and store the data to the UFM register of the CPLD; 判断模块,用于判断所述主控芯片与所述Flash存储器中数据是否同步;若否,触发复位模块;Judging module, used to judge whether the data in the main control chip and the Flash memory are synchronized; if not, trigger the reset module; 所述复位模块,用于向所述主控芯片和所述Flash存储器发送复位信号,所述复位信号用于控制所述主控芯片和所述Flash存储器同时进行复位。The reset module is configured to send a reset signal to the main control chip and the Flash memory, and the reset signal is used to control the main control chip and the Flash memory to reset simultaneously. 9.一种Flash数据读写装置,其特征在于,包括:9. A Flash data read-write device, characterized in that, comprising: 存储器,用于存储计算机程序;memory for storing computer programs; 处理器,用于执行所述计算机程序时实现如权利要求1至4任一项所述的Flash数据读写方法的步骤。The processor is configured to implement the steps of the method for reading and writing Flash data according to any one of claims 1 to 4 when executing the computer program. 10.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至4任一项所述的Flash数据读写方法的步骤。10. A computer-readable storage medium, characterized in that, a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the Flash memory according to any one of claims 1 to 4 is realized. The steps of the data read and write methods.
CN202210017456.3A 2022-01-07 2022-01-07 Method, system, device and medium for reading and writing Flash data Active CN114461142B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210017456.3A CN114461142B (en) 2022-01-07 2022-01-07 Method, system, device and medium for reading and writing Flash data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210017456.3A CN114461142B (en) 2022-01-07 2022-01-07 Method, system, device and medium for reading and writing Flash data

Publications (2)

Publication Number Publication Date
CN114461142A CN114461142A (en) 2022-05-10
CN114461142B true CN114461142B (en) 2023-08-08

Family

ID=81410371

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210017456.3A Active CN114461142B (en) 2022-01-07 2022-01-07 Method, system, device and medium for reading and writing Flash data

Country Status (1)

Country Link
CN (1) CN114461142B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115061532B (en) * 2022-06-10 2024-06-21 北京主导时代科技有限公司 Triggering resetting device for safe touch edge

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101206162A (en) * 2007-12-14 2008-06-25 哈尔滨工程大学 Flat wheel detection data acquisition and signal processing system
CN202424658U (en) * 2011-12-28 2012-09-05 天津市亚安科技股份有限公司 Synchronous resetting circuit for master control chip and video camera
CN110187923A (en) * 2019-05-10 2019-08-30 杭州迪普科技股份有限公司 A kind of CPU starting method and apparatus applied to multi -CPU board

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101206162A (en) * 2007-12-14 2008-06-25 哈尔滨工程大学 Flat wheel detection data acquisition and signal processing system
CN202424658U (en) * 2011-12-28 2012-09-05 天津市亚安科技股份有限公司 Synchronous resetting circuit for master control chip and video camera
CN110187923A (en) * 2019-05-10 2019-08-30 杭州迪普科技股份有限公司 A kind of CPU starting method and apparatus applied to multi -CPU board

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
嵌入式Nor Flash数据安全存储系统设计;方彬浩;;计算机产品与流通(第02期);全文 *

Also Published As

Publication number Publication date
CN114461142A (en) 2022-05-10

Similar Documents

Publication Publication Date Title
CN113076227B (en) MCU verification method, system and terminal device
US8898517B2 (en) Handling a failed processor of a multiprocessor information handling system
US8341434B2 (en) Optimizing voltage on a power plane using a networked voltage regulation module array
CN112231005A (en) Method for managing FPGA (field programmable Gate array) version based on UBOOT (Universal boot on Board)
CN104156234A (en) Multi-core processor starting and bootloader big-little endian mode adapting method device
CN112506745B (en) Memory temperature reading method and device and computer readable storage medium
CN114461142B (en) Method, system, device and medium for reading and writing Flash data
CN108121842A (en) The verification method and device of the low energy consumption operation mode of multiprocessor system chip
CN114996069A (en) A motherboard testing method, device and medium
CN113608684B (en) Memory information acquisition method, device, system, electronic equipment and storage medium
CN111399871B (en) System updating method, device, equipment and medium of HBA card
CN114461286B (en) A server startup method, device, electronic equipment and readable storage medium
CN114153303B (en) A power consumption control system, a power consumption control method, a device, and a medium
CN113419884B (en) Method, device, terminal and storage medium for preventing BMC image file from being damaged
CN116089139A (en) Method, device and medium for processing serial hard disk faults
CN116107945A (en) Device, method, system, equipment and medium for configuring bandwidth
CN116662050A (en) A method, device, terminal and medium for error injection support function verification
CN115168119A (en) A server PCIE link detection method, device and medium
CN116089124A (en) Communication method, device and medium of simulation system
CN115904787A (en) Method, device and medium for determining reason of lost disk
CN115129529A (en) Method, device and medium for detecting server startup fault
CN108304280A (en) Control method, BMC and the device of isomery mixing memory system abnormal restoring
CN114461471A (en) A method, device and medium for judging PCIE link training process state
CN115242753A (en) Network card MAC address burning method, system, electronic equipment and storage medium
CN114816023B (en) Server backup function optimization method, system, terminal and storage medium

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
GR01 Patent grant
GR01 Patent grant