CN111158697B - Method for manufacturing burning mirror image - Google Patents

Method for manufacturing burning mirror image Download PDF

Info

Publication number
CN111158697B
CN111158697B CN201911358391.3A CN201911358391A CN111158697B CN 111158697 B CN111158697 B CN 111158697B CN 201911358391 A CN201911358391 A CN 201911358391A CN 111158697 B CN111158697 B CN 111158697B
Authority
CN
China
Prior art keywords
partition
image file
file
mirror image
target
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
CN201911358391.3A
Other languages
Chinese (zh)
Other versions
CN111158697A (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.)
Huizhou Foryou General Electronics Co Ltd
Original Assignee
Huizhou Foryou General Electronics 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 Huizhou Foryou General Electronics Co Ltd filed Critical Huizhou Foryou General Electronics Co Ltd
Priority to CN201911358391.3A priority Critical patent/CN111158697B/en
Publication of CN111158697A publication Critical patent/CN111158697A/en
Application granted granted Critical
Publication of CN111158697B publication Critical patent/CN111158697B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/63Image based installation; Cloning; Build to order
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • 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

Abstract

The invention provides a method for manufacturing a burning mirror image, which comprises the following steps: step 1, manufacturing an original mirror image file; step 2, copying the original image file into storage equipment; and step 3, connecting the storage equipment with a target upgrading board, and burning the original mirror image. And 4, generating a target image file. The invention reduces the dependence on third-party burning tools and intermediate manual operation steps, and achieves the effect of safely and reliably manufacturing burning mirror images.

Description

Method for manufacturing burning mirror image
Technical Field
The invention relates to the technical field of memories, in particular to a method for manufacturing a burning mirror image.
Background
At present, for the conventional manufacturing method of the Nandflash burning mirror image for calculating ECC by hardware, a burning tool (such as ST_A2Flash of a legal semiconductor) provided by a main control chip manufacturer is used for writing all compiled files into a Nandflash chip according to partitions, then the original data of all the files are read through a U-Boot command, and then the files are spliced into a complete burning mirror image file. This method has the following disadvantages: the method is dependent on a burning tool of a manufacturer of the main control chip, and has a plurality of manual operation steps, and the mirror image length is required to be calculated manually.
Accordingly, there is a need for further improvements in the art.
Disclosure of Invention
The invention provides a method for manufacturing a burning mirror image, which aims to solve the defects in the prior art, reduce the dependence on a third-party burning tool and intermediate manual operation steps, and achieve the effect of safely and reliably manufacturing the burning mirror image.
In order to achieve the above purpose, the technical scheme adopted by the invention is as follows:
the invention provides a method for manufacturing a burning mirror image, which comprises the following steps:
step 1, manufacturing an original mirror image file;
step 2, copying the original image file into storage equipment;
and step 3, connecting the storage equipment with a target upgrading board, and burning the original mirror image.
And 4, generating a target image file.
Specifically, the step 1 includes:
step 101, compiling a target source program to generate an original image file of each partition;
step 102, splicing the original image files of all the partitions into a main image file according to the sequence of the partition table;
step 103, calculating a first CRC code according to the main body mirror image file;
104, calculating a second CRC code according to the file identification, the length and offset address of the original image file of each partition and the first CRC code;
step 105, splicing the file identifier, the length and offset address of the original image file of each partition, the first CRC check code and the second CRC check code into a file header;
and 106, splicing the file header and the main body image file into an original image file.
Specifically, the step 3 includes:
step 301, detecting whether the original image file exists in the storage device by the U-boot of the target upgrading board, if yes, entering the next step, otherwise, circularly executing the step;
step 302, analyzing the file header, obtaining the file identifier, judging whether the file identifier is legal, if yes, entering the next step, otherwise, exiting the upgrading;
step 303, calculating a third CRC check code of the file identifier, the length of each partition mirror image and the offset address, and judging whether the third CRC check code is identical to the second CRC check code, if yes, entering the next step, otherwise, exiting the upgrading;
step 304, calculating a fourth CRC check code of the main body mirror image file, judging whether the fourth CRC check code is the same as the first CRC check code, if so, entering the next step, otherwise, exiting the upgrading;
step 305, obtaining the length and offset address of each partition mirror image;
step 306, upgrading the system data area in the partition table according to the order of the partition table.
Specifically, the step 4 includes:
and step 401, calculating the size of the effective data of the target upgrading board burning memory.
And step 402, reading the data of the system data area and the OOB area in the partition table of the target upgrading board burning memory according to the order from low to high.
And step 403, splicing the target image files into target image files according to the reading sequence of the data and storing the target image files.
Specifically, the number of the original image files of each partition is the same as the number of the partitions of the data area in the partition table.
Specifically, the first 12 partitions of the partition table are system data partitions, the 13 th partition is an application program partition, and the 14 th partition is a user data partition.
Specifically, the file header is in front and the body image file is in back.
Specifically, the size of the effective data is equal to the sum of the size of the system data area and the size of the OOB area corresponding to the system data area in the partition table.
Specifically, the OOB area size is 1/32 of the system data area size.
The invention has the beneficial effects that: according to the invention, the main image file and the file header are generated and spliced into the original image file, the original image file is burnt on the target upgrading plate, the effective data size of the target upgrading plate burnt memory is automatically calculated, and finally the data read in the target upgrading plate burnt memory are spliced into the target image file, so that the dependence on a third party burnt tool and intermediate manual operation steps are reduced, and the effect of safely and reliably manufacturing the burnt image is achieved.
Drawings
FIG. 1 is a flow chart of a method for manufacturing a burn mirror image according to the present invention;
FIG. 2 is a schematic diagram of a partition table structure of the present invention.
Detailed Description
Embodiments of the present invention will now be described in detail with reference to the accompanying drawings, which are for reference and illustration only, and are not intended to limit the scope of the invention.
The embodiment of the invention provides a method for manufacturing a burning mirror image, which comprises the following steps:
and step 1, manufacturing an original mirror image file.
In this embodiment, the step 1 includes:
and step 101, compiling the target source program to generate an original image file of each partition.
The number of the original image files of each partition is the same as the number of the partitions of the data area in the partition table, for example, 12 partitions exist in the data area in the partition table, and then the number of the original image files of each partition is also 12. As an example, the original image file for each partition is named as follows: file1.bin, file2.bin, … File12.bin correspond to partition 1, partition 2 … …, partition 12, respectively, in the partition table.
As shown in fig. 2, in this embodiment, the first 12 partitions of the partition table are system data partitions, the 13 th partition is an application partition, and the 14 th partition is a user data partition.
And 102, splicing the original image files of all the partitions into a main image file according to the sequence of the partition table.
And step 103, calculating a first CRC code according to the main body mirror image file.
And 104, calculating a second CRC code according to the file identification, the length and offset address of the original image file of each partition and the first CRC code.
The file identifier is used for verifying the validity of the upgrade file corresponding to the target image file, for example, the file identifier is set as TBOX, then only the upgrade file identified as TBOX is legal, the upgrade operation is allowed to be executed, otherwise, the system considers that the upgrade file is illegal, and the upgrade operation is refused to be executed.
And 105, splicing the file identifier, the length and offset address of the original image file of each partition, the first CRC check code and the second CRC check code into a file header.
And 106, splicing the file header and the main body image file into an original image file.
Specifically, the file header is in front and the body image file is in back.
And step 2, copying the original image file into storage equipment.
The storage device comprises a U disk, an SD card, a TF card, a mobile hard disk and the like.
And step 3, connecting the storage equipment with a target upgrading board, and burning the original mirror image.
The original program of the target upgrading board comprises the same U-BOOT as that in the original image.
In this embodiment, the step 3 includes:
step 301, detecting whether the original image file exists in the storage device by the U-boot of the target upgrading board, if yes, entering the next step, otherwise, exiting the upgrading;
step 302, analyzing the file header, obtaining the file identifier, judging whether the file identifier is legal, if yes, entering the next step, otherwise, exiting the upgrading;
step 303, calculating a third CRC check code of the file identifier, the length of each partition mirror image and the offset address, and judging whether the third CRC check code is identical to the second CRC check code, if yes, entering the next step, otherwise, exiting the upgrading;
step 304, calculating a fourth CRC check code of the main body mirror image file, judging whether the fourth CRC check code is the same as the first CRC check code, if so, entering the next step, otherwise, exiting the upgrading;
step 305, obtaining the length and offset address of each partition mirror image;
step 306, upgrading the system data area in the partition table according to the order of the partition table.
And 4, generating a target image file.
In this embodiment, the step 4 includes:
and step 401, calculating the size of the effective data of the target upgrading board burning memory.
In this embodiment, the size of the effective data is equal to the sum of the size of the system data area in the partition table and the size of the OOB area corresponding to the system data area.
In this embodiment, the OOB area size is 1/32 of the system data area size.
OOB is an abbreviation for Out-Of-Band, in NandFlash each page, for setting states, such as bad block flags, ECC, etc., after the command is executed.
And step 402, reading the data of the system data area and the OOB area in the partition table of the target upgrading board burning memory according to the order from low to high.
And step 403, splicing the target image files into target image files according to the reading sequence of the data and storing the target image files.
The above disclosure is illustrative of the preferred embodiments of the present invention and should not be construed as limiting the scope of the invention, which is defined by the appended claims.

Claims (5)

1. A method for producing a burn mirror image, comprising:
step 1, manufacturing an original mirror image file;
step 2, copying the original image file into storage equipment;
step 3, connecting the storage device with a target upgrading board, and burning the original mirror image;
step 4, generating a target mirror image file;
the step 4 comprises the following steps:
step 401, calculating the size of effective data of a target upgrade board burning memory, wherein the size of the effective data is equal to the sum of the size of a system data area in a partition table and the size of an OOB area corresponding to the system data area;
step 402, reading the data of the system data area and the OOB area in the partition table of the target upgrade board burning memory according to the order from low to high;
step 403, splicing the data into a target image file according to the reading sequence of the data and storing the target image file;
the step 1 comprises the following steps:
step 101, compiling a target source program to generate an original image file of each partition;
step 102, splicing the original image files of all the partitions into a main image file according to the sequence of the partition table;
step 103, calculating a first CRC code according to the main body mirror image file;
104, calculating a second CRC code according to the file identification, the length and offset address of the original image file of each partition and the first CRC code;
step 105, splicing the file identifier, the length and offset address of the original image file of each partition, the first CRC check code and the second CRC check code into a file header;
step 106, splicing the file header and the main body image file into an original image file;
the step 3 comprises the following steps:
step 301, detecting whether the original image file exists in the storage device by the U-boot of the target upgrading board, if yes, entering the next step, otherwise, circularly executing the step;
step 302, analyzing the file header, obtaining the file identifier, judging whether the file identifier is legal, if yes, entering the next step, otherwise, exiting the upgrading;
step 303, calculating a third CRC check code of the file identifier, the length of each partition mirror image and the offset address, judging whether the third CRC check code is identical to the second CRC check code, if yes, entering the next step, otherwise, exiting the upgrading;
step 304, calculating a fourth CRC check code of the main body mirror image file, judging whether the fourth CRC check code is the same as the first CRC check code, if so, entering the next step, otherwise, exiting the upgrading;
step 305, obtaining the length and offset address of each partition mirror image;
step 306, upgrading the system data area in the partition table according to the order of the partition table.
2. The method of claim 1, wherein the number of original image files in each partition is equal to the number of partitions in the data area in the partition table.
3. The method of claim 2, wherein the first 12 partitions of the partition table are system data partitions, the 13 th partition is an application partition, and the 14 th partition is a user data partition.
4. The method of claim 3, wherein the header is preceded and the body image file is followed.
5. The method of claim 1, wherein the OOB area size is 1/32 of the system data area size.
CN201911358391.3A 2019-12-25 2019-12-25 Method for manufacturing burning mirror image Active CN111158697B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911358391.3A CN111158697B (en) 2019-12-25 2019-12-25 Method for manufacturing burning mirror image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911358391.3A CN111158697B (en) 2019-12-25 2019-12-25 Method for manufacturing burning mirror image

Publications (2)

Publication Number Publication Date
CN111158697A CN111158697A (en) 2020-05-15
CN111158697B true CN111158697B (en) 2023-07-04

Family

ID=70556730

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911358391.3A Active CN111158697B (en) 2019-12-25 2019-12-25 Method for manufacturing burning mirror image

Country Status (1)

Country Link
CN (1) CN111158697B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112486514B (en) * 2020-11-27 2024-01-16 广州视源电子科技股份有限公司 Manufacturing method and device of eMMC burning file and computer equipment
CN113157282A (en) * 2021-03-31 2021-07-23 惠州华阳通用电子有限公司 Method for generating burn image file
CN113821221B (en) * 2021-06-15 2022-09-23 荣耀终端有限公司 Method, apparatus and storage medium for installing operating system
CN113590227B (en) * 2021-08-02 2023-11-28 中国大恒(集团)有限公司北京图像视觉技术分公司 Method and system for loading binary programming format under embedded system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105242941A (en) * 2015-09-14 2016-01-13 广东小天才科技有限公司 Burning method and apparatus
CN109165025A (en) * 2018-08-01 2019-01-08 京信通信系统(中国)有限公司 The offline method for burn-recording of chip, device, system, computer storage medium and equipment

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102270144B (en) * 2010-06-04 2014-12-10 鸿富锦精密工业(深圳)有限公司 Embedded network equipment and method for upgrading firmware by using same
CN102163155A (en) * 2011-03-09 2011-08-24 深圳创维数字技术股份有限公司 Upgrade controlling device and method for upgrading memory device
CN104317622B (en) * 2014-10-30 2018-05-29 深圳市捷顺科技实业股份有限公司 A kind of embedded device burning program processing method and system
CN105590072A (en) * 2015-12-18 2016-05-18 上海华测导航技术股份有限公司 Method for achieving automatic burning of embedded system
CN107783724A (en) * 2016-08-30 2018-03-09 深圳市中兴微电子技术有限公司 A kind of generation method and device of full image file

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105242941A (en) * 2015-09-14 2016-01-13 广东小天才科技有限公司 Burning method and apparatus
CN109165025A (en) * 2018-08-01 2019-01-08 京信通信系统(中国)有限公司 The offline method for burn-recording of chip, device, system, computer storage medium and equipment

Also Published As

Publication number Publication date
CN111158697A (en) 2020-05-15

Similar Documents

Publication Publication Date Title
CN111158697B (en) Method for manufacturing burning mirror image
US7613916B2 (en) Method for burning chips
US9483396B2 (en) Control apparatus, storage device, and storage control method
CN110147240B (en) Cloud storage-based application program installation method, system and storage medium
US20070038802A1 (en) System and method for configuration and management of flash memory
KR20080083474A (en) Flash memory-based memory system
WO2021129551A1 (en) Method and system for testing pcba board, and test device and micro control unit
US20080002469A1 (en) Non-volatile memory
CN109976767B (en) Software burning method and device
CN105159727A (en) Firmware upgrade processing method, apparatus and system
CN111933199B (en) Data read-write method and device based on memory and storage medium
CN105302924A (en) File management method and device
CN106775485B (en) SD card formatting method and system based on mobile terminal
CN113656049B (en) Operating system deployment method and device, electronic equipment and storage medium
KR970003248A (en) Erasing Method of Flash Memory Device
CN107807870B (en) Method and system for testing power-down protection function of storage server mainboard
CN113157282A (en) Method for generating burn image file
CN109639487B (en) Policy configuration method, device, network equipment and storage medium
CN111124435A (en) Memory partition capacity adjusting method and device
US10521157B2 (en) Jump page cache read method in NAND flash memory and NAND flash memory
CN108346453B (en) Flash memory test equipment and method
CN112508524A (en) Electronic approval method, system, device and storage medium
CN113220362A (en) Log record obtaining method and device, computer equipment and storage medium
CN105955851A (en) System file burning method and device applied to mobile terminal
CN101996168B (en) Method and device for formatting flash memory

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