[go: up one dir, main page]

CN102543193B - A kind of flash recordable method, recording device and programming system - Google Patents

A kind of flash recordable method, recording device and programming system Download PDF

Info

Publication number
CN102543193B
CN102543193B CN201110457782.8A CN201110457782A CN102543193B CN 102543193 B CN102543193 B CN 102543193B CN 201110457782 A CN201110457782 A CN 201110457782A CN 102543193 B CN102543193 B CN 102543193B
Authority
CN
China
Prior art keywords
data
valid data
information
file
area
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
CN201110457782.8A
Other languages
Chinese (zh)
Other versions
CN102543193A (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.)
Shenzhen Skyworth Digital Technology Co Ltd
Original Assignee
Shenzhen Skyworth Digital 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 Shenzhen Skyworth Digital Technology Co Ltd filed Critical Shenzhen Skyworth Digital Technology Co Ltd
Priority to CN201110457782.8A priority Critical patent/CN102543193B/en
Publication of CN102543193A publication Critical patent/CN102543193A/en
Application granted granted Critical
Publication of CN102543193B publication Critical patent/CN102543193B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明公开了一种闪存烧录方法,包括将下载的信息文件和至少一个数据文件合成为一个包括信息区和数据区的烧录文件,该数据区包括数据文件中的有效数据,信息区包括信息文件中对应有效数据的描述信息;读取烧录文件的信息区得到各个有效数据的描述信息;根据各个有效数据的描述信息,依次读取各个有效数据;当每读取到一个有效数据时,则根据有效数据的描述信息将该有效数据烧录到闪存中,从而避免因误操作而导致描述信息文件与有效数据文件不匹配的问题,且该烧录文件中不包括填充数据,从而烧录时跳过填充数据,烧录时更加方便、安全;并且只需要下载一次烧录文件,从而根据该烧录文件进行烧录,提高了效率。本发明还提供了烧录设备和烧录系统。

The invention discloses a flash memory programming method, comprising synthesizing a downloaded information file and at least one data file into a programming file including an information area and a data area, the data area includes valid data in the data file, and the information area includes The description information corresponding to the valid data in the information file; read the information area of the burning file to get the description information of each valid data; according to the description information of each valid data, read each valid data in turn; when each valid data is read , then burn the valid data into the flash memory according to the description information of the valid data, so as to avoid the problem that the description information file does not match the valid data file due to misoperation, and the burning file does not include filling data, thus burning The filling data is skipped during recording, which is more convenient and safe during burning; and it only needs to download the burning file once, so as to burn according to the burning file, which improves the efficiency. The invention also provides a burning device and a burning system.

Description

一种闪存烧录方法、烧录设备及烧录系统A flash memory burning method, burning equipment and burning system

技术领域 technical field

本发明涉及闪存,尤其涉及一种闪存烧录方法、烧录设备及烧录系统。 The invention relates to a flash memory, in particular to a flash memory programming method, a programming device and a programming system.

背景技术 Background technique

目前,闪存的烧录方法有两种:一为母片拷贝方式,即将用户原始flash上的内容拷贝到板载flash后,再将板载flash上相应的内容写入空的flash;二为文件方式,即将指定文件置于移动硬盘或者编程器内置硬盘,再读出该文件的内容并按照指定的方式写入flash。 At present, there are two methods of burning flash memory: one is the master copy method, that is, the content on the user’s original flash is copied to the onboard flash, and then the corresponding content on the onboard flash is written into the empty flash; the other is the file The method is to put the specified file on the mobile hard disk or the built-in hard disk of the programmer, and then read the content of the file and write it into the flash according to the specified method.

采用文件方式烧录时,需要两个文件:实际要烧录的数据文件,参见图1,为数据文件的格式;描述数据在flash中位置的描述信息文件,参见图2,为描述信息文件的格式。采用文件方式烧录时,需要分别下载该描述信息文件和数据文件,但如果由于操作失误时,数据文件和描述信息文件不匹配,从而导致烧录到flash的内容错误;并且烧录时,是顺序读取数据文件的内容,当数据在flash中不连续时,则会有填充数据,从而导致数据文件庞大。 When burning in the file mode, two files are required: the actual data file to be burned, see Figure 1, which is the format of the data file; the description information file describing the position of the data in the flash, see Figure 2, which is the description information file Format. When burning in the file mode, you need to download the description information file and the data file separately, but if the data file and the description information file do not match due to an operation error, the content burned to the flash will be wrong; and when burning, it is Read the content of the data file sequentially. When the data is not continuous in the flash, there will be filled data, resulting in a huge data file.

发明内容 Contents of the invention

本发明实施例所要解决的技术问题在于,提供一种闪存烧录方法、烧录设备及烧录系统,可避免信息文件与数据文件之间的匹配问题,且烧录方便、安全。 The technical problem to be solved by the embodiments of the present invention is to provide a flash memory programming method, a programming device and a programming system, which can avoid the matching problem between information files and data files, and the programming is convenient and safe.

为了解决上述技术问题,本发明实施例提供了一种闪存烧录方法,包括: In order to solve the above technical problems, an embodiment of the present invention provides a flash memory programming method, including:

将下载的信息文件和至少一个数据文件所述信息文件和所述数据文件合成为一个包括数据区和信息区的烧录文件,所述数据区包括各个所述数据文件中的有效数据,所述信息区包括所述信息文件中对应于所述有效数据的描述信息; The downloaded information file and at least one data file, the information file and the data file are synthesized into a burning file including a data area and an information area, the data area includes valid data in each of the data files, and the The information area includes descriptive information corresponding to the valid data in the information file;

读取所述烧录文件的信息区,得到各个有效数据的描述信息;所述描述信息包括所述有效数据在闪存中的起始地址和大小; Read the information area of the burning file to obtain the descriptive information of each valid data; the descriptive information includes the starting address and size of the valid data in the flash memory;

根据各个有效数据的描述信息,依次读取所述数据区中的各个有效数据; According to the description information of each valid data, sequentially read each valid data in the data area;

当每读取到一个有效数据时,则根据该有效数据的描述信息将所读取到的有效数据烧录到所述闪存中。 When each valid data is read, the read valid data is burned into the flash memory according to the description information of the valid data.

其中,所述读取所述烧录文件的信息区,得到各个有效数据的描述信息的步骤之前,还包括: Wherein, before the step of reading the information area of the burning file and obtaining the description information of each valid data, it also includes:

检测所述闪存,得到所述闪存的特征信息; Detecting the flash memory to obtain characteristic information of the flash memory;

根据所述特征信息擦除整个闪存。 Erase the entire flash memory according to the characteristic information.

其中,所述根据各个有效数据的描述信息,依次读取所述数据区中的各个有效数据的步骤,具体包括: Wherein, the step of sequentially reading each valid data in the data area according to the description information of each valid data specifically includes:

每读取一个有效数据之前,根据该有效数据的描述信息,擦除所述闪存中对应于该有效数据的区域; Before each valid data is read, according to the description information of the valid data, the area corresponding to the valid data in the flash memory is erased;

根据有效数据的描述信息,读取所述数据区中的有效数据。 According to the description information of the valid data, the valid data in the data area is read.

其中,所述当每读取到一个有效数据时,则根据所读取的有效数据的描述信息将所读取到的有效数据烧录到所述闪存中的步骤,具体包括: Wherein, when each valid data is read, the step of burning the read valid data into the flash memory according to the description information of the read valid data specifically includes:

每当读取到一个有效数据时,检测将要写入该有效数据的当前块是否为坏块,若不是,则将该有效数据写入到当前块中;若当前块为坏块,则跳过所述当前块,将读取的所述有效数据写入到后续的不为坏块的块中。 Whenever a valid data is read, check whether the current block to which the valid data is to be written is a bad block, if not, write the valid data into the current block; if the current block is a bad block, skip The current block writes the read valid data into a subsequent block that is not a bad block.

其中,所述信息区的大小为预先定义的,或者所述信息区内包括信息区结束标识。 Wherein, the size of the information area is predefined, or the information area includes an information area end identifier.

一种烧录设备,包括: A burning device, comprising:

描述信息读取模块,用于读取将信息文件和至少一个数据文件合成为一个包括信息区和数据区的烧录文件的信息区,得到各个数据文件中有效数据的描述信息;所述数据区包括各个数据文件中的有效数据,所述信息区包括所述信息文件中的对应于所述有效数据的描述信息,所述描述信息包括所述有效数据的大小以及其在闪存中的起始地址; The description information reading module is used to read the information area that synthesizes the information file and at least one data file into a burning file including the information area and the data area, and obtains the description information of valid data in each data file; the data area Including valid data in each data file, the information area includes description information corresponding to the valid data in the information file, and the description information includes the size of the valid data and its starting address in the flash memory ;

有效数据读取模块,用于根据各个有效数据的描述信息,依次读取所述数据区中的各个有效数据; a valid data reading module, configured to sequentially read each valid data in the data area according to the description information of each valid data;

烧录模块,用于在每读取到一个有效数据时,根据该有效数据的描述信息将所读取到的所述有效数据烧录到闪存中。 The burning module is configured to burn the read valid data into the flash memory according to the description information of the valid data each time a valid data is read.

其中,所述烧录设备还包括: Wherein, the burning device also includes:

特征信息获取模块,用于检测所述闪存,得到所述闪存的特征信息; A feature information acquisition module, configured to detect the flash memory and obtain feature information of the flash memory;

闪存擦除模块,用于根据所述特征信息擦除整个闪存。 The flash memory erasing module is used for erasing the entire flash memory according to the characteristic information.

其中,所述烧录设备还包括; Wherein, the burning device also includes;

区域擦除模块,用于在所述有效数据读取模块每读取一个有效数据之前,根据该有效数据的描述信息,擦除所述闪存中对应于所述有效数据的区域; The area erasing module is used to erase the area corresponding to the valid data in the flash memory according to the description information of the valid data before each valid data read by the valid data reading module;

所述烧录模块用于在每读取到一个有效数据时,根据该有效数据的描述信息,将读取到的该有效数据写入所述区域擦除模块所擦除的对应于该有效数据的区域中。 The burning module is used to write the read valid data into the area corresponding to the valid data erased by the area erasing module according to the description information of the valid data each time a valid data is read. in the area.

其中,所述烧录设备还包括: Wherein, the burning device also includes:

检测模块,用于在每读取到一个有效数据时,检测所述闪存中将要写入该有效数据的当前块是否为坏块; The detection module is used to detect whether the current block to be written with the valid data in the flash memory is a bad block when each valid data is read;

所述烧录模块用于在每读取到一个有效数据,并且检测到将要写入该有效数据的当前块不为坏块时,将读取到的该有效数据写入所述当前块中;或者 The burning module is used to write the read valid data into the current block when each valid data is read and it is detected that the current block to which the valid data will be written is not a bad block; or

在每读取到一个有效数据,并且检测到将要写入该有效数据的当前块为坏块时,跳过所述当前块,将读取的该有效数据写入到后续的不为坏块的块中。 Every time a valid data is read, and when it is detected that the current block to be written into the valid data is a bad block, the current block is skipped, and the valid data read is written into the subsequent non-bad block block.

一种烧录系统,包括: A burning system, comprising:

合成模块,用于将下载的信息文件和至少一个数据文件合成为一个包括数据区和信息区的烧录文件;以及如上述的烧录设备。 A synthesis module, used for synthesizing the downloaded information file and at least one data file into a burning file including a data area and an information area; and the above-mentioned burning device.

实施本发明实施例,具有如下有益效果: Implementing the embodiment of the present invention has the following beneficial effects:

本发明实施例的闪存烧录方法,通过将信息文件和数据文件合成为包括数 In the flash memory programming method of the embodiment of the present invention, by synthesizing information files and data files into

据区和信息区的烧录文件,其中数据区包括多个有效数据,信息区包括各个有效数据的描述信息,即通过将数据文件和信息文件合成为即包括了有效数据,又包括了有效数据的描述信息的烧录文件,避免了将有效数据和有效数据的描述信息分别放置在两个文件中时,由于误操作而导致描述信息文件与有效数据文件不匹配的问题,同时由于该烧录文件中不包括填充数据,该烧录文件小巧,从而烧录时跳过了填充数据,烧录时更加方便、安全;并且即便闪存中存在坏块,也只需要下载一次该烧录文件,从而根据该烧录文件来进行烧录,提高了效率,且不易出错。 The burning files of the data area and the information area, in which the data area includes multiple valid data, and the information area includes the description information of each valid data, that is, the data file and the information file are synthesized to include both valid data and valid data. The burning file of the description information avoids the problem that the description information file does not match the effective data file due to misoperation when the valid data and the description information of the valid data are placed in two files respectively. The file does not include filling data, and the burning file is small, so the filling data is skipped during burning, which is more convenient and safe during burning; and even if there are bad blocks in the flash memory, the burning file only needs to be downloaded once, so that Burning is performed according to the burning file, which improves efficiency and is less prone to errors.

本发明实施例的闪存烧录方法由于烧录文件中预先定义了大小的信息区,从而读取数据时,可直接到该烧录文件的固定位置开始读取数据,进而使得该方法更加简单。 In the flash memory programming method of the embodiment of the present invention, since the information area of a predetermined size is defined in the programming file, when reading data, the data can be read directly at a fixed position of the programming file, thereby making the method simpler.

本发明实施例的闪存烧录方法,通过根据设置在信息区内的结束标识来识别数据区的开始位置,从而读取数据,由于该信息区的大小可变,进而具有较强的灵活性。 The flash memory programming method of the embodiment of the present invention reads data by identifying the start position of the data area according to the end mark set in the information area. Since the size of the information area is variable, it has strong flexibility.

本发明实施例的闪存烧录方法,通过下载既包括有效数据,又包括了有效数据的描述信息的烧录文件,当烧录有效数据时,即便遇到坏块,也可直接从已下载的该烧录文件中读取有效数据和有效数据的描述信息,避免需要将各个有效数据分开写入,即将包括多个有效数据的数据文件,切割成多份,放到多个文件,而导致烧录数据时,需要下载、擦除、写入多次的情况,从而提高烧录效率,并且不容易出错。 In the flash memory programming method of the embodiment of the present invention, by downloading a programming file that includes not only valid data but also description information of valid data, when programming valid data, even if a bad block is encountered, it can be directly downloaded from the downloaded file. The effective data and the description information of the effective data are read in the burning file to avoid the need to write each effective data separately, that is, to cut the data file including multiple effective data into multiple copies and put them into multiple files, which will cause burning When recording data, it needs to be downloaded, erased, and written multiple times, so as to improve the recording efficiency and make it less prone to errors.

附图说明 Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。 In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without creative work.

图1是现有的数据文件的格式示意图; Fig. 1 is a schematic diagram of the format of an existing data file;

图2是现有的描述信息文件的格式示意图; FIG. 2 is a schematic diagram of the format of an existing description information file;

图3是本发明的闪存烧录方法的一实施例的流程图; Fig. 3 is a flowchart of an embodiment of the flash memory programming method of the present invention;

图4是本发明的闪存烧录方法的一实施例中的烧录文件的格式示意图; Fig. 4 is a schematic format diagram of the burning file in an embodiment of the flash memory burning method of the present invention;

图5是本发明的闪存烧录方法的又一实施例的流程图; Fig. 5 is the flow chart of another embodiment of the flash memory programming method of the present invention;

图6是本发明的闪存烧录方法的再一实施例的流程图; Fig. 6 is the flow chart of another embodiment of the flash memory programming method of the present invention;

图7是本发明的烧录设备的一实施例的功能模块图; Fig. 7 is a functional block diagram of an embodiment of the burning device of the present invention;

图8是本发明的烧录设备的又一实施例的功能模块图; Fig. 8 is a functional block diagram of another embodiment of the burning device of the present invention;

图9是本发明的烧录系统的一实施例的功能模块图。 FIG. 9 is a functional block diagram of an embodiment of the programming system of the present invention.

具体实施方式 Detailed ways

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

本发明实施例通过将信息文件和数据文件合成为包括信息区和数据区的烧录文件,并根据该信息区内的有效数据的描述信息来读取数据区的有效数据,并将读取的有效数据烧录到闪存中,由于该烧录文件中既包括了有效数据又包括有效数据的描述信息,避免了数据文件与描述文件之间的不匹配的问题,同时由于该烧录文件中不包括填充数据,该烧录文件小巧,从而烧录时跳过了填充数据,烧录时更加方便、安全,并且提高了烧录效率。 In the embodiment of the present invention, the information file and the data file are synthesized into a burning file including the information area and the data area, and the effective data in the data area is read according to the description information of the effective data in the information area, and the read The valid data is burned into the flash memory, because the burning file includes both the valid data and the description information of the valid data, avoiding the problem of mismatch between the data file and the description file, and because the burning file does not contain Including filling data, the burning file is small, so the filling data is skipped during burning, which is more convenient and safe during burning, and the burning efficiency is improved.

参见图3,为本发明实施例的闪存烧录方法的一实施例的流程图。本实施例的闪存烧录方法,具体实施过程如下: Referring to FIG. 3 , it is a flow chart of an embodiment of a flash memory programming method according to an embodiment of the present invention. The flash memory programming method of the present embodiment, specific implementation process is as follows:

S11,将下载的信息文件和至少一个数据文件合成为一个包括信息区和数据区的烧录文件,该数据区包括各个数据文件中的有效数据,信息区包括该信息文件中对应于有效数据的描述信息。具体实施时,首先下载终端中生成的信息文件和多个数据文件;然后再将所下载的信息文件和多个数据文件合成为一个包括信息区和数据区的烧录文件,即将信息文件中的有效数据的描述信息复制到该烧录文件的信息区,并将各个有效数据文件中的有效数据复制到该烧录文件的数据区,从而合成了一个既包括有效数据又包括有效数据描述信息的烧录文件,然后烧录设备加电初始化,使其进入准备状态,并下载该合成后包括信息区和数据区的烧录文件。在一具体实施例中,可通过直接将该信息文件中的所有有效数据的描述信息复制到信息区,然后再根据各个有效数据的描述信息将各个数据文件中的有效数据复制到数据区。由于该描述信息包括了各个数据文件在闪存中的起始地址,大小,以及对应的数据文件名,即可按照该信息文件中各个有效数据的描述信息的排列顺序复制各个数据文件中的有效数据,从而完成信息文件和数据文件的合成;或者先将第一个有效数据对应的描述信息复制到信息区,再将对应的第一个数据文件中的有效数据复制到数据区;然后再复制下一个有效数据的描述信息到信息区,再将对应的该下一个数据文件中的有效数据复制到数据区。当然也可以采用其他方式将信息文件中的描述信息复制到该信息区,将各个有效数据复制到该数据区,参见图4,为本实施例中合成的烧录文件的格式。在一具体实施例中,需要烧录一个机顶盒软件到128M大小的nandflash中,该软件内容包括:uboot、loader、kernel、application、userdata等,且这些数据,需要烧录到flash中的特定位置,但这些数据未占满整个flash,本实施例中生成的烧录文件如下所示: S11, the downloaded information file and at least one data file are synthesized into a burning file including an information area and a data area, the data area includes valid data in each data file, and the information area includes information corresponding to the valid data in the information file Description. During specific implementation, at first download the information file and a plurality of data files generated in the terminal; The description information of valid data is copied to the information area of the programming file, and the valid data in each valid data file is copied to the data area of the programming file, thereby synthesizing a program that includes both valid data and valid data description information. Burn the file, and then the burning device is powered on and initialized to make it enter the ready state, and download the synthesized burning file including the information area and the data area. In a specific embodiment, the description information of all valid data in the information file can be directly copied to the information area, and then the valid data in each data file can be copied to the data area according to the description information of each valid data. Since the description information includes the starting address of each data file in the flash memory, the size, and the corresponding data file name, the effective data in each data file can be copied according to the arrangement order of the description information of each effective data in the information file , so as to complete the synthesis of the information file and the data file; or first copy the description information corresponding to the first valid data to the information area, and then copy the valid data in the corresponding first data file to the data area; and then copy the The descriptive information of a valid data is sent to the information area, and then the corresponding valid data in the next data file is copied to the data area. Of course, other methods can also be used to copy the description information in the information file to the information area, and copy each valid data to the data area. Refer to FIG. 4 , which is the format of the programming file synthesized in this embodiment. In a specific embodiment, it is necessary to burn a set-top box software into the nandflash of 128M size, the software content includes: uboot, loader, kernel, application, userdata, etc., and these data need to be burned into a specific position in the flash, However, these data do not occupy the entire flash, and the burning file generated in this embodiment is as follows:

00000000000004000000010000008000 00000000000004000000010000008000

0000A000000028000000D0000000A000 0000A000000028000000D0000000A000

0000000200002000 0000000200002000

…… ...

uboot数据(256K) uboot data (256K)

loader数据(8M) loader data (8M)

kernel数据(2.5M) kernel data (2.5M)

application数据(10M) application data (10M)

userdata数据(2M)。 userdata data (2M).

后续将继续沿用本实施例中的有效数据及其描述信息。 The valid data and its description information in this embodiment will continue to be used later.

本实施例中,在合成烧录文件之前,可预先定义该烧录文件的信息区的大小,从而当读取有效数据时,可直接从该烧录文件中固定位置开始读取有效数据即可。当然该信息区的大小也可不是预先定义的,而是在该信息区内设置一个信息区结束标识,从而便于根据该结束标识来区分信息区和数据区,该结束标识可为设置在信息区结束位置的某特定值,例如“0”,也可为设置在该信息区开头的表示数据区包括的有效数据的个数的一个数值。 In this embodiment, before synthesizing the programming file, the size of the information area of the programming file can be pre-defined, so that when valid data is read, the valid data can be read directly from a fixed position in the programming file. . Of course, the size of the information area may not be pre-defined, but an information area end mark is set in the information area, so as to facilitate the distinction between the information area and the data area according to the end mark, and the end mark may be set in the information area A specific value at the end position, such as "0", may also be a numerical value set at the beginning of the information area indicating the number of valid data included in the data area.

S12,读取烧录文件的信息区,得到各个有效数据的描述信息,该描述信息包括有效数据的大小以及其在闪存中的起始地址。在一具体实施例中,由于合成的烧录文件的信息区的描述信息采用了高低字节反转的方式,则读取该烧录文件的信息区得到的该5个有效数据uboot、loader、kernel、application、userdata的描述信息分别为:起始地址0x0,大小0x40000;起始地址0x100000,大小0x800000;起始地址0xA00000,大小0x280000;起始地址0xD00000,大小0xA00000;起始地址0x2000000,大小0x200000。 S12. Read the information area of the programming file to obtain the description information of each valid data, and the description information includes the size of the valid data and its starting address in the flash memory. In a specific embodiment, since the description information of the information area of the synthesized burning file adopts the high and low byte inversion mode, the 5 valid data uboot, loader, The description information of kernel, application, and userdata are: start address 0x0, size 0x40000; start address 0x100000, size 0x800000; start address 0xA00000, size 0x280000; start address 0xD00000, size 0xA00000; start address 0x2000000, size 0x200000 .

S13,根据各个有效数据的描述信息,依次读取烧录文件的数据区内的各个有效数据。具体实施时,在执行该步骤S13之前,还需要检测闪存,得到该闪存包括多少个块,以及每个块的大小等特征信息,并根据该特征信息擦除整个闪存,以便于后续烧录。在一具体实施例中,首先由烧录设备检测flash芯片,读取flash芯片特征信息,并根据该特征信息擦除整个flash。 S13. According to the description information of each valid data, sequentially read each valid data in the data area of the programming file. During specific implementation, before executing step S13, it is also necessary to detect the flash memory to obtain characteristic information such as how many blocks the flash memory includes and the size of each block, and erase the entire flash memory according to the characteristic information for subsequent programming. In a specific embodiment, first, the flash chip is detected by the burning device, the characteristic information of the flash chip is read, and the entire flash is erased according to the characteristic information.

根据第一个有效数据uboot的大小;0x40000,从数据区开始位置顺序读取256k数据; According to the size of the first valid data uboot; 0x40000, read 256k data sequentially from the beginning of the data area;

根据第二个有效数据loader的大小:0x800000,从数据区中第一个有效数据结束的位置开始顺序读取8M数据; According to the size of the second valid data loader: 0x800000, read 8M data sequentially from the end position of the first valid data in the data area;

根据第三个有效数据kernel的大小:0x280000,从数据区中上一个有效数据结束的位置开始顺序读取2.5M数据; According to the size of the third valid data kernel: 0x280000, read 2.5M data sequentially from the position where the last valid data in the data area ends;

根据第四个有效数据application的大小:大小0xA00000,从数据区上一个有效数据结束位置开始顺序读取10M数据; According to the size of the fourth valid data application: size 0xA00000, read 10M data sequentially from the end position of the previous valid data in the data area;

根据第五个有效数据userdata的大小:0x200000,从数据区上一个有效数据接结束位置开始顺序读取2M数据。 According to the size of the fifth valid data userdata: 0x200000, read 2M data sequentially from the end position of the previous valid data in the data area.

S14,当每读取到一个有效数据时,则根据该有效数据的描述信息,将所读取到的该有效数据烧录到闪存中。在一具体实施例中,根据步骤S12中读取到的该有效数据的大小和在flash中的起始地址等描述信息,将读取的该有效数据写入到flash中: S14, when each valid data is read, burn the read valid data into the flash memory according to the description information of the valid data. In a specific embodiment, according to the descriptive information such as the size of this valid data read in step S12 and the starting address in flash, write this valid data that reads in the flash:

当读取到第一个有效数据uboot时,根据该第一个有效数据uboot的大小及其在flash中的起始地址:0x0,立即将该第一个有效数据uboot写入flash的0x0处; When the first valid data uboot is read, according to the size of the first valid data uboot and its starting address in the flash: 0x0, immediately write the first valid data uboot to 0x0 of the flash;

当读取到第二有效数据loader时,根据该第二个有效数据loader的大小及其在flash中的起始地址:0x100000,立即将该第二个有效数据loader写入flash的0x100000处; When the second valid data loader is read, according to the size of the second valid data loader and its starting address in the flash: 0x100000, immediately write the second valid data loader to 0x100000 of the flash;

当读取到第三个有效数据kernel时,根据该第三个有效数据kernel的大小及其在flash中的起始地址:0xA00000,立即将该第三个有效数据kernel写入flash的0xA00000处; When the third valid data kernel is read, according to the size of the third valid data kernel and its starting address in the flash: 0xA00000, immediately write the third valid data kernel to 0xA00000 of the flash;

当读取到第四个有效数据application时,根据该第四个有效数据application的大小及其在flash中的起始地址:0xD00000,立即将该第四个有效数据applicationl写入flash的0xD00000处; When the fourth valid data application is read, according to the size of the fourth valid data application and its starting address in the flash: 0xD00000, immediately write the fourth valid data application1 to the 0xD00000 place of the flash;

当读取到第五个有效数据userdata时,根据该第五个有效数据userdata的大小及其在flash中的起始地址:0x2000000,立即将该第五个有效数据userdata写入flash的0x2000000处。 When the fifth valid data userdata is read, according to the size of the fifth valid data userdata and its starting address in flash: 0x2000000, immediately write the fifth valid data userdata to the 0x2000000 place of flash.

本实施例通过将信息文件和至少一个数据文件合成为一个既包括信息区和数据区的烧录文件,其中该数据区包括数据文件中的有效数据,信息区包括信息文件中对应各个有效数据的描述信息,再读取该烧录文件的信息区,得到有效数据的描述信息,并根据有效数据的描述信息,读取该烧录文件的数据区的有效数据,将读取到的有效数据烧录到闪存中,即通过将有效数据的描述信息和有效数据本身合成到一个烧录文件,使得该烧录文件即包括了有效数据,又包括了有效数据的描述信息,从而避免将有效数据和有效数据的描述信息分别放置在两个文件中时,由于误操作而导致描述信息文件与有效数据文件不匹配的问题,同时由于该烧录文件中不包括填充数据,该烧录文件小巧,进而烧录时跳过了填充数据,烧录时更加方便、安全;并且即便闪存中存在坏块,也只需要下载一次该烧录文件,从而根据该烧录文件来进行烧录,提高了效率,且不易出错。 In this embodiment, the information file and at least one data file are synthesized into a burning file including both the information area and the data area, wherein the data area includes valid data in the data file, and the information area includes information corresponding to each valid data in the information file. description information, and then read the information area of the burning file to obtain the description information of the effective data, and read the effective data in the data area of the burning file according to the description information of the effective data, and burn the read effective data Recording into the flash memory, that is, by synthesizing the description information of the effective data and the effective data itself into a burning file, so that the burning file includes both the effective data and the description information of the effective data, thereby avoiding combining the effective data and the effective data When the description information of valid data is placed in two files respectively, the description information file does not match the valid data file due to misoperation. At the same time, because the burning file does not include filling data, the burning file is small and exquisite, and then The filling data is skipped during burning, which is more convenient and safe; and even if there are bad blocks in the flash memory, it only needs to download the burning file once, so as to burn according to the burning file, which improves the efficiency. And less error-prone.

同时,本实施例的闪存烧录方法还适用于对闪存内的数据进行更新,首先将生成的需要更新的数据文件,以及对应的信息文件合成为一个烧录文件,即该烧录文件的信息区包括需要更新的有效数据的描述信息,数据区包括了需要更新的有效数据,再读取该烧录文件的信息区,得到需要更新的各个有效数据的描述信息,根据各个有效数据的描述信息擦除闪存中对应的区域或者块,当每擦除一个区域或者块后,则根据描述信息,读取对应一个有效数据,并将其写入所擦除的区域或者块中,避免了将需要更新的有效数据及其描述信息分别放置在多个文件中时,由于误操作而导致描述信息文件与包括更新数据的数据文件不匹配的问题,并且即便闪存中存在坏块,也只需要下载一次该烧录文件,从而根据该烧录文件来进行烧录,提高了数据的更新效率,并且不易出错。 At the same time, the flash memory programming method of this embodiment is also suitable for updating the data in the flash memory. First, the generated data files that need to be updated and the corresponding information files are synthesized into a burning file, that is, the information of the burning file The area includes the description information of the effective data that needs to be updated, and the data area includes the effective data that needs to be updated. Then read the information area of the burning file to obtain the description information of each effective data that needs to be updated. Erase the corresponding area or block in the flash memory. When each area or block is erased, according to the description information, read the corresponding valid data and write it into the erased area or block, avoiding the need to When the updated valid data and its description information are placed in multiple files, the description information file does not match the data file including the updated data due to misoperation, and even if there are bad blocks in the flash memory, it only needs to be downloaded once The burning file, so the burning is performed according to the burning file, which improves the update efficiency of data and is less prone to errors.

然而,由于闪存的特性,在擦除或写入过程中,容易出现坏块。当出现坏块时,烧录时会把数据顺延,即写到下一个好块,从而导致本来应该烧在某个位置的数据,烧在了其后的某个位置。例如,当flash的loader部分出现坏块时,会导致kernel、application、userdata部分的数据,都烧在了后面与起始地址不对应的位置,从而导致uboot加载kernel时出错。而为避免上述问题,目前,当写入文件到存在坏块的flash时,通常将各个有效数据分开写入,即将包括多个有效数据的数据文件,切割成5份,放到5个文件,从而导致烧录数据时,需要下载、擦除、写入,各5次,进而使得烧录的效率不高,并且容易出错。然而,采用本发明实施例的闪存烧录方法则能够避免这种问题,从而提高烧录的效率,并且不容易出错。 However, due to the characteristics of flash memory, bad blocks are prone to appear during erasing or writing. When a bad block occurs, the data will be postponed during burning, that is, written to the next good block, so that the data that should have been burned in a certain position is burned in a certain position after that. For example, when there is a bad block in the loader part of the flash, the data in the kernel, application, and userdata parts will be burned in a position that does not correspond to the starting address, which will cause an error when uboot loads the kernel. In order to avoid the above-mentioned problems, at present, when writing files to the flash with bad blocks, each valid data is usually written separately, that is, the data file including multiple valid data is cut into 5 parts and put into 5 files. As a result, when burning data, it needs to be downloaded, erased, and written five times each, which makes the efficiency of burning low and error-prone. However, this problem can be avoided by adopting the flash memory programming method of the embodiment of the present invention, thereby improving the efficiency of programming, and is less prone to errors.

参见图5,为本发明的闪存烧录方法的又一实施例的流程图。本实施例中包括上述实施例中的步骤S11至S14,不同的是本实施例中,执行该步骤S13之前还包括步骤:S15,每读取一个有效数据之前,根据该有效数据的描述信息,擦除闪存中对应该有效数据的一个区域。即是说本实施例中当每擦除一个区域,然后再读取一个有效数据,并将读取的有效数据写入所擦除的区域中。在一具体实施例中,若flash中已经有可以运行的uboot,并且能通过tftp下载文件,具体烧录实施过程如下: Referring to FIG. 5 , it is a flow chart of another embodiment of the flash memory programming method of the present invention. This embodiment includes steps S11 to S14 in the above embodiments, the difference is that in this embodiment, before executing step S13, it also includes step: S15, before each valid data is read, according to the description information of the valid data, Erases an area of flash memory that corresponds to valid data. That is to say, in this embodiment, each time an area is erased, another valid data is read, and the read valid data is written into the erased area. In a specific embodiment, if there is uboot that can run in the flash, and the file can be downloaded through tftp, the specific burning implementation process is as follows:

uboot擦除flash从0x0开始的256K大小区域;uboot跳到烧录文件的数据区,顺序读取256K数据,即第一个有效数据uboot;并将该第一个有效数据uboot写入所擦除的区域中; Uboot erases the 256K area of flash starting from 0x0; uboot jumps to the data area of the burning file, reads 256K data sequentially, that is, the first valid data uboot; and writes the first valid data uboot into the erased in the area;

uboot擦除flash从0x100000开始的8M大小区域;uboot跳到烧录文件的数据区,顺序读取8M数据,即第二个有效数据loader;并将该第二个有效数据uboot写入所擦除的区域中; Uboot erases the 8M area of flash starting from 0x100000; uboot jumps to the data area of the burning file, reads 8M data sequentially, that is, the second valid data loader; and writes the second valid data uboot into the erased in the area;

uboot擦除flash从0xA00000开始的2.5M大小区域;uboot跳到烧录文件的数据区,顺序读取2.5M数据,即第三个有效数据kernel;并将该第三个有效数据uboot写入所擦除的区域中; Uboot erases the 2.5M size area of the flash starting from 0xA00000; uboot jumps to the data area of the burning file, reads 2.5M data sequentially, that is, the third valid data kernel; and writes the third valid data uboot into all in the erased area;

uboot擦除flash从0xD00000开始的10M大小区域;uboot跳到烧录文件的数据区,顺序读取10M数据有效数据,即第四个application;并将该第四个有效数据uboot写入所擦除的区域中; Uboot erases the 10M area of flash starting from 0xD00000; uboot jumps to the data area of the burning file, reads the 10M valid data sequentially, that is, the fourth application; and writes the fourth valid data into the erased in the area;

uboot擦除flash从0x2000000开始的2M大小区域,uboot跳到烧录文件的数据区,顺序读取2M数据,即第五个有效数据userdata;并将该第五个有效数据uboot写入所擦除的区域中。 Uboot erases the 2M size area of flash starting from 0x2000000, uboot jumps to the data area of the burning file, reads 2M data sequentially, that is, the fifth valid data userdata; and writes the fifth valid data uboot into the erased in the area.

参见图6,为本发明的闪存烧录方法的再一实施例的流程图。本实施例中包括上述实施例中的步骤S11至S14,不同的是本实施例中,执行该步骤S14之前还包括步骤:S16,每当读取到一个有效数据时,检测将要写入该有效数据的当前块是否为坏块。若检测结果为不是,则将该有效数据烧录到当前块中,即执行步骤S14;若检测结果为是,则执行步骤S17。具体实施时,检测当前块是否为坏块的方式包括:一、闪存中的坏块有坏块标识,当写入有效数据之前,检测该块是否有坏块标识,若有,则检测下一个块是否有坏块标识,若无,则将该有效数据写入该块中,若有,则继续检测再下一个块,直至找到一个好块为止;二、将数据写入该块中,再将写入的数据读出来,比较读取的数据与写入的数据是否相同,若相同,则该块不为坏块,否则该块为坏块,若为坏块,则采用相同的方式检测下一个块,直至找到好块为止。 Referring to FIG. 6 , it is a flow chart of another embodiment of the flash memory programming method of the present invention. This embodiment includes steps S11 to S14 in the above embodiment, the difference is that in this embodiment, before executing this step S14, it also includes a step: S16, whenever a valid data is read, it is detected that the valid data will be written. Whether the current block of data is a bad block. If the detection result is no, burn the valid data into the current block, that is, execute step S14; if the detection result is yes, execute step S17. During specific implementation, the mode of detecting whether the current block is a bad block includes: one, the bad block in the flash memory has a bad block mark, before writing valid data, detect whether this block has a bad block mark, if so, then detect the next Whether the block has a bad block mark, if not, then write the valid data into the block, if so, continue to detect the next block until a good block is found; 2, write the data into the block, and then Read the written data and compare whether the read data is the same as the written data. If they are the same, the block is not a bad block, otherwise the block is a bad block. If it is a bad block, use the same method to detect Next block until a good block is found.

S17,跳过当前块,将读取的该有效数据写入到后续的不为坏块的块中。 S17. Skip the current block, and write the read valid data into a subsequent block that is not a bad block.

实施本发明实施例的闪存烧录方法,通过将信息文件和数据文件合成为包括有效数据,又包括有效数据的描述信息的烧录文件,并从中获取有效数据,及其对应的描述信息,再根据该描述信息将有效数据写入闪存中,并且当遇到坏块时,也不需要将各个有效数据分割为多个文件,即只需要下载一次烧录文件,便可从该烧录文件中获取到各个有效数据的描述信息和有效数据本身,并根据该描述信息将有效数据写入闪存中,从而提高了烧录的效率,也不容易出错。 Implement the flash memory programming method of the embodiment of the present invention, by synthesizing the information file and the data file into a programming file including valid data and description information of the valid data, and obtaining valid data and corresponding description information therefrom, and then Write valid data into the flash memory according to the description information, and when a bad block is encountered, there is no need to divide each valid data into multiple files, that is, only need to download the burning file once, and then the burning file can be downloaded from the burning file. The description information of each valid data and the valid data itself are obtained, and the valid data is written into the flash memory according to the description information, thereby improving the burning efficiency and making it less prone to errors.

基于上述的闪存烧录方法,本发明实施例还提供了一种烧录设备。下面将结合说明书附图对本发明实施例的烧录设备进行详细的说明。 Based on the above flash memory programming method, an embodiment of the present invention also provides a programming device. The burning device according to the embodiment of the present invention will be described in detail below with reference to the accompanying drawings.

参见图7,为本发明的烧录设备的一实施例的功能模块图。具体实施时,本发明实施例的烧录设备包括: Referring to FIG. 7 , it is a functional block diagram of an embodiment of the burning device of the present invention. During specific implementation, the burning equipment of the embodiment of the present invention includes:

描述信息读取模块11,用于读取将下载的信息文件和至少一个数据文件合成为一个包括信息区和数据区的烧录文件的信息区,得到各个数据文件中有效数据的描述信息;该数据区包括各个数据文件中的有效数据,该信息区包括该信息文件中对应于各个有效数据的描述信息;具体实施时,该信息区的大小可以是预先定义的,当然也可以在该信息区内设置结束标识; Descriptive information reading module 11, is used for reading the information file that downloads and at least one data file is synthesized into the information area that comprises the burning file of information area and data area, obtains the descriptive information of effective data in each data file; The The data area includes valid data in each data file, and the information area includes description information corresponding to each valid data in the information file; during specific implementation, the size of the information area can be pre-defined, and of course it can also be included in the information area Set the end flag inside;

有效数据读取模块12,用于根据各个有效数据的描述信息,依次读取数据区中的各个有效数据;具体实施时,若该信息区的大小预先定义的,则有效数据读取模块12直接从该烧录文件固定位置开始顺序读取数据区内的有效数据;或者若在该信息区内设置了信息区结束标识,则该有效数据读取模块12直接根据该信息区结束标识从数据区读取有效数据; The valid data reading module 12 is used to read each valid data in the data area sequentially according to the description information of each valid data; during specific implementation, if the size of the information area is predefined, the valid data reading module 12 directly Begin to sequentially read the valid data in the data area from the fixed position of the burning file; or if the information area end mark is set in the information area, then the valid data reading module 12 directly reads from the data area according to the end mark of the information area read valid data;

烧录模块13,用于在每读取到一个有效数据时,根据该有效数据的描述信息,将该有效数据烧录到闪存中。 The burning module 13 is used for burning the valid data into the flash memory according to the description information of the valid data when each valid data is read.

实施本实施例的烧录设备,通过读取包括信息区和数据区的烧录文件的信息区来获取有效数据的描述信息,再根据描述信息读取有效数据,即通过读取包括了有效数据,又包括了对应于有效数据的描述信息的烧录文件来进行数据的烧录,从而避免了将有效数据和有效数据的描述信息分别放置在多个文件(多个数据文件和一个描述信息文件)中时,由于误操作而导致描述信息文件与有效数据文件不匹配的问题,同时由于该烧录文件中不包括填充数据,该烧录文件小巧,进而烧录时跳过了填充数据,烧录时更加方便、安全;并且即便闪存中存在坏块,也只需要下载一次该烧录文件,进而根据该烧录文件来进行烧录,提高了效率,且不易出错。 Implement the burning equipment of this embodiment, obtain the description information of effective data by reading the information area of the burning file that includes information area and data area, then read effective data according to description information, namely by reading and include effective data , including the burning file corresponding to the description information of the valid data to burn the data, thereby avoiding placing the valid data and the description information of the valid data in multiple files (multiple data files and a description information file ), the description information file does not match the effective data file due to misoperation. At the same time, because the burning file does not include filling data, the burning file is small, and the filling data is skipped during burning. It is more convenient and safe when recording; and even if there are bad blocks in the flash memory, it only needs to download the burning file once, and then burn according to the burning file, which improves the efficiency and is not easy to make mistakes.

参见图8,为本发明的烧录设备的又一实施例的功能模块图。具体实施时,本实施例的烧录设备也包括上述的描述信息读取模块11、有效数据读取模块12和烧录模块13,相同的模块采用相同的名称和附图标记,不同的是本发明实施例的烧录设备还包括: Referring to FIG. 8 , it is a functional block diagram of another embodiment of the burning device of the present invention. During specific implementation, the burning device of this embodiment also includes the above-mentioned description information reading module 11, valid data reading module 12 and burning module 13, and the same modules use the same names and reference signs, and the difference is that this The burning device of the embodiment of the invention also includes:

检测模块14,用于在每读取到一个有效数据时,检测闪存中将要写入该有效数据的当前块是否为块; Detection module 14 is used to detect whether the current block of the valid data to be written in the flash memory is a block when each valid data is read;

本实施例的烧录模块14用于在每读取到一个有效数据,并且检测到将要写入该有效数据的当前块不为坏块时,将读取到的该有效数据写入该当前块中;或者在每读取到一个有效数据,并且检测到将要写入该有效数据的当前块为坏块时,跳过当前块,将读取的该有效数据写入到后续的不为坏块的块中。 The burning module 14 of the present embodiment is used to write the valid data read into the current block when it detects that the current block to be written into the valid data is not a bad block every time a valid data is read. or when each valid data is read and the current block to which the valid data is to be written is detected to be a bad block, the current block is skipped and the valid data read is written to the subsequent non-bad block in the block.

本实施例中的后续的不为坏块的块是指当检测模块检测到当前块为坏块时,则继续检测下一个的块是否为坏块,若是则再继续检测再下一个块是否为坏块,直至检测到一个不为坏块的块,则该不为坏块的块即为当前块的后续块,且不为坏块。 Subsequent blocks that are not bad blocks in this embodiment refer to that when the detection module detects that the current block is a bad block, then continue to detect whether the next block is a bad block, and if so, continue to detect whether the next block is a bad block. Bad blocks until a block that is not a bad block is detected, then the block that is not a bad block is the subsequent block of the current block and is not a bad block.

本实施例的烧录设备还可包括: The recording device of this embodiment may also include:

特征信息获取模块,用于检测闪存,得到该闪存的特征信息,例如该闪存包括多少个块,每个块的大小等; The feature information acquisition module is used to detect the flash memory and obtain the feature information of the flash memory, such as how many blocks the flash memory includes, the size of each block, etc.;

闪存擦除模块,用于根据得到特征信息擦除整个闪存。 The flash memory erasing module is used for erasing the entire flash memory according to the obtained feature information.

本实施例中的烧录设备通过读取既包括有效数据描述信息,又包括有效数据的烧录文件,并且当描述信息读取模块读取到该烧录文件的信息区中对应各个有效数据的描述信息之前,该闪存擦除模块将闪存整个擦除,再读取描述信息,并由有效数据读取模块根据读取的描述信息读取数据区中对应的有效数据,最后由烧录模块将该有效数据写入到该闪存中,从而遇到坏块时,不需要多次下载数据文件,提高了烧录效率,也不容易出错。 The burning device in this embodiment reads the burning file that includes both valid data description information and valid data, and when the description information reading module reads the corresponding valid data in the information area of the burning file Before describing the information, the flash memory erasing module will erase the entire flash memory, and then read the description information, and the valid data reading module will read the corresponding valid data in the data area according to the read description information, and finally the burning module will The valid data is written into the flash memory, so that when a bad block is encountered, the data file does not need to be downloaded multiple times, which improves the burning efficiency and is not prone to errors.

在另一具体实施例中,本发明实施例的烧录设备也包括上述的描述信息读取模块11、有效数据读取模块12和烧录模块13,相同的模块采用相同的名称和附图标记,不同的是本实施例的烧录设备还包括: In another specific embodiment, the burning device of the embodiment of the present invention also includes the above-mentioned description information reading module 11, valid data reading module 12 and burning module 13, and the same modules use the same names and reference numerals , the difference is that the burning device of this embodiment also includes:

区域擦除模块,用于在每读取一个有效数据之前,根据该有效数据的描述信息,擦除闪存中对应该有效数据的区域。 The area erasing module is used for erasing the area corresponding to the valid data in the flash memory according to the description information of the valid data before each valid data is read.

本实施例中的烧录设备通过读取既包括有效数据描述信息,又包括有效数据的烧录文件,并且当描述信息读取模块读取到各个有效数据的描述信息,该区域擦除模块根据各个有效数据的描述信息,每擦除对应一个有效数据的一个区域时,再由有效数据读取模块读取数据区中对应的该有效数据,并由烧录模块将该有效数据写入到该区域中,从而遇到坏块时,不需要多次下载数据文件,提高了烧录效率,也不容易出错。 The burning device in this embodiment reads the burning file that includes both valid data description information and valid data, and when the description information reading module reads the description information of each valid data, the area erasing module according to The description information of each valid data, when erasing a region corresponding to a valid data, read the corresponding valid data in the data area by the valid data reading module, and write the valid data into the valid data by the burning module In the area, when a bad block is encountered, there is no need to download the data file multiple times, which improves the burning efficiency and is not easy to make mistakes.

参见图9,本发明实施例还提供了一种烧录系统,包括: Referring to Fig. 9, the embodiment of the present invention also provides a burning system, including:

合成模块21,用于将下载的信息文件和至少一个数据文件合成为包括数据区和信息区的烧录文件,其中该数据区包括各个数据文件中的有效数据,信息区包括对应于有效数据的描述信息;具体实施时,该合成模块21可在终端(例如电脑)中先下载或者导入一个信息文件和对应的多个数据文件,并将该信息文件中的有效数据的描述信息复制到烧录文件中的信息区,将各个数据文件中的有效数据复制到该烧录文件中的数据区,从而合成为一个既包括有效数据,又包括描述信息的烧录文件,从而使得烧录设备只需要读取这一个烧录文件即可执行数据的烧录;在一具体实施例中,该合成模块21可通过一个软件来实现; Combination module 21, is used for synthesizing the information file of downloading and at least one data file into the burning file that comprises data area and information area, wherein this data area comprises the effective data in each data file, and information area comprises corresponding effective data Description information; during specific implementation, the synthesis module 21 can first download or import an information file and corresponding multiple data files in a terminal (such as a computer), and copy the description information of the effective data in the information file to the burning The information area in the file, copy the valid data in each data file to the data area in the burning file, and then synthesize a burning file that includes both valid data and description information, so that the burning device only needs to Reading the burning file can execute the burning of data; in a specific embodiment, the synthesis module 21 can be realized by a piece of software;

该烧录系统还包括上述实施例中的烧录设备1;具体实施时,该烧录设备1可直接读取合成的烧录文件中的信息区的描述信息,和数据区的有效数据,并根据读取的描述信息将各个有效数据写入到闪存中。 The burning system also includes the burning device 1 in the above-mentioned embodiment; during specific implementation, the burning device 1 can directly read the description information of the information area in the synthesized burning file, and the valid data of the data area, and Each effective data is written into the flash memory according to the read description information.

以上所揭露的仅为本发明较佳实施例而已,当然不能以此来限定本发明之权利范围,本领域普通技术人员可以理解实现上述实施例的全部或部分流程,并依本发明权利要求所作的等同变化,仍属于发明所涵盖的范围。 What is disclosed above is only a preferred embodiment of the present invention, and certainly cannot limit the scope of rights of the present invention with this. Those of ordinary skill in the art can understand the whole or part of the process of realizing the above-mentioned embodiment, and make according to the claims of the present invention The equivalent changes still belong to the scope covered by the invention.

Claims (10)

1.一种闪存烧录方法,其特征在于,包括:1. A flash memory programming method, is characterized in that, comprising: 将下载的信息文件和至少一个数据文件合成为一个包括数据区和信息区的烧录文件,所述数据区包括各个所述数据文件中的有效数据,所述信息区包括所述信息文件中的对应于所述有效数据的描述信息;The downloaded information file and at least one data file are synthesized into a burning file including a data area and an information area, the data area includes valid data in each of the data files, and the information area includes the information in the information file Descriptive information corresponding to the valid data; 读取所述烧录文件的信息区,得到各个有效数据的描述信息;所述描述信息包括所述有效数据在闪存中的起始地址和大小;Read the information area of the burning file to obtain the descriptive information of each valid data; the descriptive information includes the starting address and size of the valid data in the flash memory; 根据各个有效数据的描述信息,依次读取所述数据区中的各个有效数据;According to the description information of each valid data, sequentially read each valid data in the data area; 当每读取到一个有效数据时,则根据该有效数据的描述信息将所读取到的有效数据烧录到所述闪存中;When each valid data is read, burn the read valid data into the flash memory according to the description information of the valid data; 其中,所述将下载的信息文件和至少一个数据文件合成为一个包括数据区和信息区的烧录文件,包括:Wherein, the downloading information file and at least one data file are synthesized into a burning file including a data area and an information area, including: 将下载的信息文件中的有效数据的描述信息复制到烧录文件的信息区;Copy the description information of the valid data in the downloaded information file to the information area of the burning file; 根据所述信息区中的描述信息将下载的各个数据文件中的有效数据复制到所述烧录文件的数据区。According to the description information in the information area, the valid data in each downloaded data file is copied to the data area of the burning file. 2.如权利要求1所述的闪存烧录方法,其特征在于,所述读取所述烧录文件的信息区,得到各个有效数据的描述信息的步骤之前,还包括:2. flash memory programming method as claimed in claim 1, is characterized in that, before the step of obtaining the descriptive information of each valid data, also comprising: 检测所述闪存,得到所述闪存的特征信息;Detecting the flash memory to obtain characteristic information of the flash memory; 根据所述特征信息擦除整个闪存。Erase the entire flash memory according to the characteristic information. 3.如权利要求1所述的闪存烧录方法,其特征在于,所述根据各个有效数据的描述信息,依次读取所述数据区中的各个有效数据的步骤,具体包括:3. The flash memory programming method according to claim 1, wherein the step of sequentially reading each valid data in the data area according to the description information of each valid data specifically includes: 每读取一个有效数据之前,根据该有效数据的描述信息,擦除所述闪存中对应于该有效数据的区域;Before each valid data is read, according to the description information of the valid data, the area corresponding to the valid data in the flash memory is erased; 根据有效数据的描述信息,读取所述数据区中的有效数据。According to the description information of the valid data, the valid data in the data area is read. 4.如权利要求2或3所述的闪存烧录方法,其特征在于,所述当每读取到一个有效数据时,则根据所读取的有效数据的描述信息将所读取到的有效数据烧录到所述闪存中的步骤,具体包括:4. The flash memory programming method according to claim 2 or 3, wherein when each valid data is read, the read valid data is read according to the description information of the valid data read. The steps of burning data into the flash memory include: 当每读取到一个有效数据时,检测将要写入该有效数据的当前块是否为坏块,若不是,则将该有效数据写入到当前块中;若当前块为坏块,则跳过所述当前块,将读取的所述有效数据写入到后续的不为坏块的块中。When each valid data is read, check whether the current block to be written into the valid data is a bad block, if not, write the valid data into the current block; if the current block is a bad block, skip The current block writes the read valid data into a subsequent block that is not a bad block. 5.如权利要求4所述的闪存烧录方法,其特征在于,所述信息区的大小为预先定义的或者所述信息区包括信息区结束标识。5. The flash memory programming method according to claim 4, wherein the size of the information area is predefined or the information area includes an information area end mark. 6.一种烧录设备,其特征在于,包括:6. A burning device, characterized in that, comprising: 描述信息读取模块,用于读取将信息文件和至少一个数据文件合成为包括信息区和数据区的烧录文件的信息区,得到各个数据文件中有效数据的描述信息;所述数据区包括各个数据文件中的有效数据,所述信息区包括信息文件中的对应于所述有效数据的描述信息;所述描述信息包括所述有效数据的大小以及其在闪存中的起始地址,所述描述信息是由所述烧录设备复制到所述信息区中的信息,每个所述有效数据是由所述烧录设备按照所述信息区中与该有效数据对应的描述信息复制到所述数据区的数据;The description information reading module is used to read the information area that synthesizes the information file and at least one data file into the burning file including the information area and the data area, and obtains the description information of valid data in each data file; the data area includes Effective data in each data file, the information area includes description information corresponding to the effective data in the information file; the description information includes the size of the effective data and its starting address in the flash memory, the The description information is information copied into the information area by the burning device, and each valid data is copied to the information area by the burning device according to the description information corresponding to the valid data in the information area. data in the data area; 有效数据读取模块,用于根据各个有效数据的描述信息,依次读取所述数据区中的各个有效数据;a valid data reading module, configured to sequentially read each valid data in the data area according to the description information of each valid data; 烧录模块,用于在每读取到一个有效数据时,根据该有效数据的描述信息将所读取到的所述有效数据烧录到闪存中。The burning module is configured to burn the read valid data into the flash memory according to the description information of the valid data each time a valid data is read. 7.如权利要求6所述的烧录设备,其特征在于,所述烧录设备还包括:7. burning equipment as claimed in claim 6, is characterized in that, described burning equipment also comprises: 特征信息获取模块,用于检测所述闪存,得到所述闪存的特征信息;A feature information acquisition module, configured to detect the flash memory and obtain feature information of the flash memory; 闪存擦除模块,用于根据所述特征信息擦除整个闪存。The flash memory erasing module is used for erasing the entire flash memory according to the characteristic information. 8.如权利要求6所述的烧录设备,其特征在于,所述烧录设备还包括;8. The burning device according to claim 6, characterized in that, the burning device further comprises; 区域擦除模块,用于在所述有效数据读取模块每读取一个有效数据之前,根据该有效数据的描述信息,擦除所述闪存中对应于所述有效数据的区域;The area erasing module is used to erase the area corresponding to the valid data in the flash memory according to the description information of the valid data before each valid data read by the valid data reading module; 所述烧录模块用于在每读取到一个有效数据时,根据该有效数据的描述信息,将读取到的该有效数据写入所述区域擦除模块所擦除的对应于该有效数据的区域中。The burning module is used to write the read valid data into the area corresponding to the valid data erased by the area erasing module according to the description information of the valid data each time a valid data is read. in the area. 9.如权利要求6至8中任意一项所述的烧录设备,其特征在于,还包括:9. The burning device according to any one of claims 6 to 8, further comprising: 检测模块,用于在每读取到一个有效数据时,检测所述闪存中将要写入该有效数据的当前块是否为坏块;The detection module is used to detect whether the current block to be written with the valid data in the flash memory is a bad block when each valid data is read; 所述烧录模块用于在每读取到一个有效数据,并且检测到将要写入该有效数据的当前块不为坏块时,将读取到的该有效数据写入所述当前块中;或者The burning module is used to write the read valid data into the current block when each valid data is read and it is detected that the current block to which the valid data will be written is not a bad block; or 在每读取到一个有效数据,并且检测到将要写入该有效数据的当前块为坏块时,跳过所述当前块,将读取的该有效数据写入到后续的不为坏块的块中。Every time a valid data is read, and when it is detected that the current block to be written into the valid data is a bad block, the current block is skipped, and the valid data read is written into the subsequent non-bad block block. 10.一种烧录系统,其特征在于,包括:10. A burning system, characterized in that, comprising: 合成模块,用于将下载的信息文件和至少一个数据文件合成为一个包括数据区和信息区的烧录文件;Synthesis module, for synthesizing the downloaded information file and at least one data file into a burning file including data area and information area; 如权利要求6至9中任意一项所述的烧录设备。The burning device according to any one of claims 6-9.
CN201110457782.8A 2011-12-31 2011-12-31 A kind of flash recordable method, recording device and programming system Active CN102543193B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110457782.8A CN102543193B (en) 2011-12-31 2011-12-31 A kind of flash recordable method, recording device and programming system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110457782.8A CN102543193B (en) 2011-12-31 2011-12-31 A kind of flash recordable method, recording device and programming system

Publications (2)

Publication Number Publication Date
CN102543193A CN102543193A (en) 2012-07-04
CN102543193B true CN102543193B (en) 2015-12-09

Family

ID=46349884

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110457782.8A Active CN102543193B (en) 2011-12-31 2011-12-31 A kind of flash recordable method, recording device and programming system

Country Status (1)

Country Link
CN (1) CN102543193B (en)

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103064710B (en) * 2012-12-26 2016-09-07 深圳市诺威达科技有限公司 A kind of flash method for burn-recording and device
CN103324503A (en) * 2013-05-29 2013-09-25 京东方科技集团股份有限公司 Data programming system and method
CN103593216B (en) * 2013-11-12 2017-12-05 上海斐讯数据通信技术有限公司 The system file of ubi forms is fabricated to factory's burning image file method
CN103605540B (en) * 2013-11-18 2017-05-03 四川长虹电器股份有限公司 Flash mirror fast writing method based on Android system
CN105005482B (en) * 2015-08-06 2018-04-06 上海斐讯数据通信技术有限公司 A kind of NOR FLASH recordable paper preparation methods
CN105306569B (en) * 2015-10-20 2018-07-17 红石阳光(北京)科技股份有限公司 One kind being based on the data download method of Flash (flash memory)
CN105843768B (en) * 2016-04-20 2019-01-25 芯海科技(深圳)股份有限公司 A kind of single line communication time-after-time programmable memory method for burn-recording and the burning device based on this method
CN109271174A (en) * 2018-08-01 2019-01-25 广州市星翼电子科技有限公司 A kind of multiple firmwares dispersion method for burn-recording of single-chip microcontroller
CN109614118B (en) * 2018-11-23 2022-05-06 信利光电股份有限公司 SPI Flash firmware burning method and device
CN112486506B (en) * 2019-09-12 2024-02-02 恒为科技(上海)股份有限公司 NAND Flash burning method and device
CN111625184A (en) * 2020-04-20 2020-09-04 珠海妙存科技有限公司 Flash memory data burning method and system
CN113721935A (en) * 2021-07-21 2021-11-30 深圳市奋达智能技术有限公司 Method for copying mirror image of file system, storage medium, burning board and flash chip
CN115857976A (en) * 2022-12-28 2023-03-28 龙芯中科(太原)技术有限公司 Chip programming method, device, equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1466060A (en) * 2002-06-10 2004-01-07 三星电子株式会社 Flash memory file system
CN101158922A (en) * 2006-10-02 2008-04-09 三星电子株式会社 Method and device for writing files through different writing schemes according to file characteristics
CN102298534A (en) * 2011-09-22 2011-12-28 四川长虹电器股份有限公司 Method for writing software into set-top box

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI243303B (en) * 2003-11-14 2005-11-11 Hon Hai Prec Ind Co Ltd System and method for managing flash file stored in a flash memory

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1466060A (en) * 2002-06-10 2004-01-07 三星电子株式会社 Flash memory file system
CN101158922A (en) * 2006-10-02 2008-04-09 三星电子株式会社 Method and device for writing files through different writing schemes according to file characteristics
CN102298534A (en) * 2011-09-22 2011-12-28 四川长虹电器股份有限公司 Method for writing software into set-top box

Also Published As

Publication number Publication date
CN102543193A (en) 2012-07-04

Similar Documents

Publication Publication Date Title
CN102543193B (en) A kind of flash recordable method, recording device and programming system
WO2015070521A1 (en) Method for making ubi format system file into factory burnt image file
CN101208755B (en) Apparatus, system and method for accessing persistent files in non-XIP flash memory
CN102819442B (en) A kind of method and system of embedded device program burn writing
KR101555210B1 (en) Apparatus and method for downloadin contents using movinand in portable terminal
CN102693283A (en) Data partition storage method and system boot method of embedded system
CN102360569A (en) Burning method, system and apparatus for nand flash chips
CN109542495A (en) A kind of method for upgrading software and device
WO2019041891A1 (en) Method and device for generating upgrade package
TW201344434A (en) Memory formatting method, memory controller and memory storage apparatus
CN111273942A (en) Code generation method, storage medium, electronic device and system
TW201526007A (en) Method, device and operating system for processing, using a NAND flash memory burn data
KR20100101517A (en) System and method to respond to a data file deletion instruction
CN107783724A (en) A kind of generation method and device of full image file
CN100440383C (en) External storage performance testing method and device
CN113190258A (en) Eight-core DSP software offline upgrading method based on serial port
JP2008084184A (en) Memory controller
JP3792232B2 (en) Information processing apparatus, storage location management method, and program
CN100367237C (en) Method and device for file information writing processing
CN102629259A (en) Read-only file system setting up method in embedded system, device and embedded system
CN115794188A (en) Firmware upgrading method and device based on USB DFU equipment and storage medium
KR100811559B1 (en) Method and device for managing data storage of nonvolatile memory
CN112463042A (en) Data volume import data verification method, device, terminal and storage medium
CN112394963B (en) Method for updating domestic platform SMBIOS and BIOS device
JP2000243093A (en) Data storing method for flash memory and data reading out method from flash memory

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 518000 Guangdong city of Shenzhen province Nanshan District Gao Xin Road Building A14, SKYWORTH

Applicant after: Shenzhen Skyworth Digital Technology Co., Ltd.

Address before: 518000 Guangdong city of Shenzhen province Nanshan District Gao Xin Road Building A14, SKYWORTH

Applicant before: Shenzhen Skyworth Digital Technology Co., Ltd.

COR Change of bibliographic data
C14 Grant of patent or utility model
GR01 Patent grant