CN111061520A - Method for loading and running embedded software with high reliability - Google Patents
Method for loading and running embedded software with high reliability Download PDFInfo
- Publication number
- CN111061520A CN111061520A CN201911170195.3A CN201911170195A CN111061520A CN 111061520 A CN111061520 A CN 111061520A CN 201911170195 A CN201911170195 A CN 201911170195A CN 111061520 A CN111061520 A CN 111061520A
- Authority
- CN
- China
- Prior art keywords
- data
- software
- reliability information
- software data
- bit
- 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.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/08—Error detection or correction by redundancy in data representation, e.g. by using checking codes
- G06F11/10—Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/74—Reverse engineering; Extracting design information from source code
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Quality & Reliability (AREA)
- Techniques For Improving Reliability Of Storages (AREA)
- Detection And Correction Of Errors (AREA)
Abstract
The invention discloses a method for loading and running embedded software with high reliability, and belongs to the technical field of embedded software development. The method comprises the steps of preprocessing original embedded software, redundantly writing NAND FLASH software data and high-reliability information, reading and correcting the software data, and the like. The method has extremely strong error correction capability, and can correctly and reliably load and run the embedded software under the occurrence probability of NAND FLASH bad blocks in the current technical level. Meanwhile, the method has the characteristics of simple algorithm and flexible realization, the majority decision decoding algorithm and the HASH algorithm used by the method are simple and effective to realize, and the error correction algorithm can be realized by using NAND FLASH controller-integrated algorithm or completely using software.
Description
Technical Field
The invention relates to the technical field of embedded software development, in particular to a method for loading and running embedded software with high reliability.
Background
The embedded device is widely applied to various civil, industrial, aviation and military devices. The software for the embedded device is typically stored within the NOR FLASH NAND FLASH. After the equipment is powered on, the embedded software is loaded into the internal RAM and DDR for operation. NOR FLASH is higher than NAND FLASH in reliability, but has NAND FLASH great advantages in capacity, read-write speed, volume, price, etc. Therefore, NAND FLASH is currently widely used.
NAND FLASH, there is a bad block problem, and some bits may flip over, causing errors in the stored data. For audio and video data and the like, the normal use of the data is not influenced by the inversion of a few bits. However, for the embedded software code for execution, the code execution may be wrong, the device may not operate normally, or the device may execute wrong operations, which may cause accidents. The traditional NAND FLASH software loading usually adopts a mode of storing a plurality of software backups and loading in sequence, the error correction capability is not strong, and loading failure is easily caused when a plurality of bad blocks are caused in a complex application environment.
Disclosure of Invention
In view of this, the present invention provides a method for loading and running embedded software with high reliability, which preprocesses the original embedded software, and adopts redundant storage, before the software is loaded, detects the software data, and corrects the possible errors, thereby improving the reliability of the embedded software stored in NAND FLASH, and improving the success rate of loading the software.
In order to achieve the purpose, the invention adopts the technical scheme that:
a method for loading and running embedded software with high reliability comprises the steps of preprocessing original embedded software, redundantly writing NAND FLASH software data and high-reliability information, reading and correcting high-reliability information, and reading and correcting software data;
the original embedded software preprocessing specifically comprises the following steps:
(101) carrying out zero filling and segmentation on byte data of original embedded software;
(102) generating an error correcting code of each segment of data, and adding the error correcting code to the tail of the corresponding data segment;
(103) connecting the sections of data added with the error correcting codes into integrated software data;
the software data and high reliability information redundancy writing NAND FLASH specifically includes the following steps:
(201) generating high-reliability information, wherein the high-reliability information comprises loading parameter information of embedded software;
(202) selecting NAND FLASH N blocks, selecting M pages from each block, and storing the high-reliability information into the N × M pages respectively, wherein N is more than or equal to 1, M is more than or equal to 1, and N × M is more than or equal to 3; meanwhile, the software data is repeatedly written into NAND FLASH other blocks for P times, wherein P is more than or equal to 3;
the high-reliability information reading and error correction specifically comprises the following steps:
(301) extracting N x M parts of high reliability information from NAND FLASH;
(302) if M is more than or equal to 3, carrying out majority decision decoding on the high-reliability information positioned in the same block bit by bit to obtain N decoded high-reliability information, and then executing the step (303); otherwise, executing step (304);
(303) if N is more than or equal to 3, carrying out majority decision decoding on the N decoded high-reliability information bit by bit again to obtain final decoded high-reliability information; otherwise, randomly selecting a piece of decoded high-reliability information as final decoded high-reliability information;
(304) carrying out majority decision decoding on the N × M pieces of high-reliability information bit by bit to obtain final decoded high-reliability information;
the software data reading and error correction specifically comprises the following steps:
(401) reading P parts of software data, correcting the software data one by one, and if the correction is successful, executing the step (403) by taking the part of software data as correct data; if all the software data fail to correct errors, executing step (402);
(402) carrying out majority decision decoding on the P parts of software data bit by bit to obtain decoded software data, and executing the step (403) by taking the software data as correct data;
(403) and deleting the error correcting codes in the correct data and zero padding at the tail to obtain original software data, and loading the software according to the loading parameter information in the high-reliability information.
In addition, the invention also provides a method for loading and running the embedded software with high reliability, which comprises the steps of preprocessing the original embedded software, redundantly writing NAND FLASH the software data and the high-reliability information, reading and correcting the high-reliability information and reading and correcting the software data;
the original embedded software preprocessing specifically comprises the following steps:
(101) carrying out zero filling and segmentation on byte data of original embedded software;
(102) generating an error correcting code of each segment of data, and adding the error correcting code to the tail of the corresponding data segment;
(103) connecting the sections of data added with the error correcting codes into integrated software data;
the software data and high reliability information redundancy writing NAND FLASH specifically includes the following steps:
(201) performing hash operation on the software data to obtain hash data of the software data;
(202) generating high-reliability information, wherein the high-reliability information comprises the hash data and loading parameter information of the embedded software;
(203) selecting NAND FLASH N blocks, selecting M pages from each block, and storing the high-reliability information into the N × M pages respectively, wherein N is more than or equal to 1, M is more than or equal to 1, and N × M is more than or equal to 3; meanwhile, the software data is repeatedly written into NAND FLASH other blocks for P times, wherein P is more than or equal to 3;
the high-reliability information reading and error correction specifically comprises the following steps:
(301) extracting N x M parts of high reliability information from NAND FLASH;
(302) if M is more than or equal to 3, carrying out majority decision decoding on the high-reliability information positioned in the same block bit by bit to obtain N decoded high-reliability information, and then executing the step (303); otherwise, executing step (304);
(303) if N is more than or equal to 3, carrying out majority decision decoding on the N decoded high-reliability information bit by bit again to obtain final decoded high-reliability information; otherwise, randomly selecting a piece of decoded high-reliability information as final decoded high-reliability information;
(304) carrying out majority decision decoding on the N × M pieces of high-reliability information bit by bit to obtain final decoded high-reliability information;
the software data reading and error correction specifically comprises the following steps:
(401) reading P parts of software data, verifying the hash data of the software data one by one, and if the hash data are consistent, taking the part of software data as correct data, and executing the step (404); if all the software data fail to be verified, executing step (402);
(402) correcting the software data in shares, verifying the hash data after correcting the error, and if the hash data is consistent, executing the step (404) by taking the software data as correct data; if all the software data fail to be verified after error correction, executing step (403);
(403) carrying out majority judgment decoding on the P parts of software data bit by bit to obtain decoded software data, verifying hash data of the decoded software data, if the hash data passes the verification, taking the decoded software data as correct data, and executing the step (404), otherwise, prompting that the software loading fails;
(404) and deleting the error correcting codes in the correct data and zero padding at the tail to obtain original software data, and loading the software according to the loading parameter information in the high-reliability information.
The invention adopts the technical scheme and has the beneficial effects that:
1. the invention preprocesses the original embedded software and adds the error correction information, so that the software data can be corrected before loading, and the loading success rate is improved.
2. The invention stores the data of the software and the loading information of the software separately, and adopts a redundant storage mode, thereby improving the safety and recoverability of the data and improving the reliability of the embedded software stored in NAND FLASH.
3. According to the invention, a series of detection and recovery processing are carried out on the software data before the software is loaded, so that software data errors caused by bad blocks can be avoided as much as possible, and the reliability of software data storage and the loading success rate are further improved.
In a word, the method has extremely strong error correction capability, and can correctly and reliably load and run embedded software under the NAND FLASH bad block occurrence probability in the current technical level. Meanwhile, the method has the characteristics of simple algorithm and flexible realization, the majority decision decoding algorithm and the HASH algorithm used by the method are simple and effective to realize, and an error correction algorithm (such as a common BCH algorithm) can be realized by using an algorithm integrated in an NAND FLASH controller or completely realized by using software.
Drawings
FIG. 1 is a block diagram of SW _ WITH _ PADDING in an embodiment of the present invention;
FIG. 2 is a schematic diagram illustrating the generation of SW _ WITH _ ECC according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of HIREL _ INFO generation in an embodiment of the present invention;
FIG. 4 is a schematic diagram of HIREL _ INFO storage in an embodiment of the present invention;
FIG. 5 is a diagram illustrating SW _ WITH _ ECC storage according to an embodiment of the present invention;
FIG. 6 is a schematic diagram illustrating the generation of HIREL _ INFO _ ROW in the embodiment of the present invention;
fig. 7 is an overall flow chart of a method of an embodiment of the invention.
Detailed Description
The invention is further described with reference to the following figures and detailed description.
A method for loading and running embedded software with high reliability comprises the steps of preprocessing original embedded software, redundantly writing NAND FLASH software data and high-reliability information, reading and correcting high-reliability information, and reading and correcting software data;
the original embedded software preprocessing specifically comprises the following steps:
(101) carrying out zero filling and segmentation on byte data of original embedded software;
(102) generating an error correcting code of each segment of data, and adding the error correcting code to the tail of the corresponding data segment;
(103) connecting the sections of data added with the error correcting codes into integrated software data;
the software data and high reliability information redundancy writing NAND FLASH specifically includes the following steps:
(201) generating high-reliability information, wherein the high-reliability information comprises loading parameter information of embedded software;
(202) selecting NAND FLASH N blocks, selecting M pages from each block, and storing the high-reliability information into the N × M pages respectively, wherein N is more than or equal to 1, M is more than or equal to 1, and N × M is more than or equal to 3; meanwhile, the software data is repeatedly written into NAND FLASH other blocks for P times, wherein P is more than or equal to 3;
the high-reliability information reading and error correction specifically comprises the following steps:
(301) extracting N x M parts of high reliability information from NAND FLASH;
(302) if M is more than or equal to 3, carrying out majority decision decoding on the high-reliability information positioned in the same block bit by bit to obtain N decoded high-reliability information, and then executing the step (303); otherwise, executing step (304);
(303) if N is more than or equal to 3, carrying out majority decision decoding on the N decoded high-reliability information bit by bit again to obtain final decoded high-reliability information; otherwise, randomly selecting a piece of decoded high-reliability information as final decoded high-reliability information;
(304) carrying out majority decision decoding on the N × M pieces of high-reliability information bit by bit to obtain final decoded high-reliability information;
the software data reading and error correction specifically comprises the following steps:
(401) reading P parts of software data, correcting the software data one by one, and if the correction is successful, executing the step (403) by taking the part of software data as correct data; if all the software data fail to correct errors, executing step (402);
(402) carrying out majority decision decoding on the P parts of software data bit by bit to obtain decoded software data, and executing the step (403) by taking the software data as correct data;
(403) and deleting the error correcting codes in the correct data and zero padding at the tail to obtain original software data, and loading the software according to the loading parameter information in the high-reliability information.
In addition, a hash algorithm can be introduced to further improve the reliability of the software. Specifically, the method comprises the steps of preprocessing original embedded software, redundantly writing NAND FLASH software data and high-reliability information, reading and correcting high-reliability information, and reading and correcting software data;
the original embedded software preprocessing specifically comprises the following steps:
(101) carrying out zero filling and segmentation on byte data of original embedded software;
(102) generating an error correcting code of each segment of data, and adding the error correcting code to the tail of the corresponding data segment;
(103) connecting the sections of data added with the error correcting codes into integrated software data;
the software data and high reliability information redundancy writing NAND FLASH specifically includes the following steps:
(201) performing hash operation on the software data to obtain hash data of the software data;
(202) generating high-reliability information, wherein the high-reliability information comprises the hash data and loading parameter information of the embedded software;
(203) selecting NAND FLASH N blocks, selecting M pages from each block, and storing the high-reliability information into the N × M pages respectively, wherein N is more than or equal to 1, M is more than or equal to 1, and N × M is more than or equal to 3; meanwhile, the software data is repeatedly written into NAND FLASH other blocks for P times, wherein P is more than or equal to 3;
the high-reliability information reading and error correction specifically comprises the following steps:
(301) extracting N x M parts of high reliability information from NAND FLASH;
(302) if M is more than or equal to 3, carrying out majority decision decoding on the high-reliability information positioned in the same block bit by bit to obtain N decoded high-reliability information, and then executing the step (303); otherwise, executing step (304);
(303) if N is more than or equal to 3, carrying out majority decision decoding on the N decoded high-reliability information bit by bit again to obtain final decoded high-reliability information; otherwise, randomly selecting a piece of decoded high-reliability information as final decoded high-reliability information;
(304) carrying out majority decision decoding on the N × M pieces of high-reliability information bit by bit to obtain final decoded high-reliability information;
the software data reading and error correction specifically comprises the following steps:
(401) reading P parts of software data, verifying the hash data of the software data one by one, and if the hash data are consistent, taking the part of software data as correct data, and executing the step (404); if all the software data fail to be verified, executing step (402);
(402) correcting the software data in shares, verifying the hash data after correcting the error, and if the hash data is consistent, executing the step (404) by taking the software data as correct data; if all the software data fail to be verified after error correction, executing step (403);
(403) carrying out majority judgment decoding on the P parts of software data bit by bit to obtain decoded software data, verifying hash data of the decoded software data, if the hash data passes the verification, taking the decoded software data as correct data, and executing the step (404), otherwise, prompting that the software loading fails;
(404) and deleting the error correcting codes in the correct data and zero padding at the tail to obtain original software data, and loading the software according to the loading parameter information in the high-reliability information.
A more specific example is as follows:
as shown in fig. 7, a method for loading and running embedded software with high reliability mainly includes the following steps:
(1) a preprocessing method of embedded software;
(2) storage of embedded software in NAND FLASH;
(3) a high-reliability data information loading method for embedded software;
(4) the embedded software code carries the method.
Wherein, the step (1) comprises the following steps:
(1.1) byte data of the embedded software is referred to as SW. SW is zero-padded at the end to make its length an integer multiple of a specific length sect _ len. The byte data obtained by zero PADDING the SW end is called SW _ WITH _ PADDING.
(1.2) the SW _ WITH _ PADDING is segmented according to the length of SECT _ len, and each segment is called SW _ SECT _ i. The data segmentation is schematically shown in fig. 1.
(1.3) each SW _ SECT _ i uses BCH codes to carry out error correction coding, and the generated error correction data is called SW _ SECT _ BCH _ i.
(1.4) SW _ SECT _ i and SW _ SECT _ BCH _ i are connected together and called SW _ SECT _ WITH _ ECC _ i.
(1.5) all SW _ SECT _ WITH _ ECC _ i are connected together, called SW _ WITH _ ECC. The schematic diagram is shown in fig. 2.
(1.6) carrying out HASH (HASH) operation on the SW _ WITH _ ECC, and obtaining HASH data which is called SW _ HASH.
(1.7) combining the software length information, the storage address in NAND FLASH, the address of the software to be loaded into RAM/DDR, the entry point of the software execution and other parameter information to form an embedded software information data block called SW _ INFO.
(1.8) the SW _ INFO and SW _ HASH data are concatenated together, called high reliability information HIREL _ INFO. The schematic diagram is shown in fig. 3.
The step (2) specifically comprises the following steps:
(2.1) selecting NAND FLASH N BLOCKs (BLOCK) in a specific pattern, selecting M PAGEs (PAGE) from each BLOCK, writing one HIREL _ INFO data in each PAGE, and co-writing M beta N HIREL _ INFO. The schematic diagram is shown in fig. 4.
(2.2) selecting NAND FLASH blocks and writing SW _ WITH _ ECC in sequence according to a specific mode. Within these blocks, SW _ WITH _ ECC is sequentially written repeatedly P times. The schematic diagram is shown in fig. 5.
Aspect (3) specifically includes the steps of:
(3.1) while the embedded system is running, selecting NAND FLASH N blocks in a particular pattern, reading a block of HIREL _ INFO data from each of a particular number M of pages of each block, and co-reading the M beta N blocks of HIREL _ INFO data.
(3.2) for M HIREL _ INFO data in each NAND FLASH blocks, the bits corresponding to the bits are taken out, and 1 bit is obtained according to the mode of majority decision decoding (majority decoding). All bits are together forming a data block hierl _ INFO _ ROW _ i. The operation schematic diagram is shown in fig. 5.
And (3.3) operating the M HIREL _ INFO data in all the N NAND FLASH blocks according to the step 2 to obtain N HIREL _ INFO _ ROW _ i data blocks.
And (3.4) taking out the bits corresponding to the bits of the N HIREL _ INFO _ ROW _ i data blocks, and obtaining 1 bit according to a majority decision decoding mode. All bits together form a HIREL _ INFO _ DEC.
(3.5) HIREL _ INFO _ DEC is HIREL _ INFO data that is not corrected for bit flip errors that may occur.
The step (4) specifically comprises the following steps:
(4.1) reading P SW _ WITH _ ECC's from NAND FLASH blocks according to the parameter information of HIREL _ INFO _ DEC and according to the specific mode.
(4.2) performing a HASH operation on each SW _ WITH _ ECC in sequence, and comparing the result WITH SW _ HASH in HIREL _ INFO _ DEC. If the data is the same, the SW _ WITH _ ECC is error-free, and the data is selected as the input of the code loading operation step, which is called SW _ WITH _ ECC _ CORRECT. Otherwise, the HASH comparison operation is performed on the next SW _ width _ ECC.
(4.3) if the HASH comparison of all SW _ WITH _ ECCs is different, performing BCH decoding operation on each SW _ WITH _ ECC in sequence to correct possible errors. After the BCH decoding operation is executed, the HASH operation is carried out on the obtained data again, and the obtained data is compared WITH SW _ HASH in HIREL _ INFO _ DEC, if the obtained data is the same as the SW _ HASH, the decoded data is set as SW _ WITH _ ECC _ CORRECT. Otherwise, the BCH decoding error correction operation and HASH comparison operation are performed on the next SW _ WITH _ ECC.
(4.4) if the HASH value of all SW _ WITH _ ECCs is still different from the SW _ HASH value in the HIREL _ INFO _ DEC after BCH decoding error correction operation, taking out the bits of the corresponding bit bits of all SW _ WITH _ ECCs, and decoding according to majority decision to obtain 1 bit. All decoded bits are together called SW _ WITH _ ECC _ MD _ DEC. The HASH operation is performed on SW _ width _ ECC _ MD _ DEC and compared WITH SW _ HASH within hierl _ INFO _ DEC. If the data is the same, SW _ WITH _ ECC _ MD _ DEC is set to SW _ WITH _ ECC _ CORRECT. Otherwise, the NAND FLASH bad block condition is judged to be too serious, the software cannot be recovered, and the software loading fails.
(4.5) taking out all SW _ SECT _ WITH _ ECC _ i from SW _ WITH _ ECC _ CORRECT, removing SW _ SECT _ BCH _ i, combining all the obtained SW _ WITH _ SECT _ i together, and removing zero bytes filled at the tail according to parameter information of HIREL _ INFO _ DEC to obtain SW. SW is loaded to the designated position of RAM/DDR according to the parameter information of HIREL _ INFO _ DEC, and the execution is started from the designated code entry.
It should be noted that the above description of the embodiments is only used to help understand the method of the present invention and its core idea. For those skilled in the art, variations can be made in the specific embodiments and applications without departing from the spirit of the invention. Accordingly, the subject matter of this specification should not be construed as limiting the invention.
Claims (2)
1. A method for loading and running embedded software with high reliability is characterized by comprising the steps of preprocessing original embedded software, redundantly writing NAND FLASH software data and high-reliability information, reading and correcting high-reliability information, and reading and correcting software data;
the original embedded software preprocessing specifically comprises the following steps:
(101) carrying out zero filling and segmentation on byte data of original embedded software;
(102) generating an error correcting code of each segment of data, and adding the error correcting code to the tail of the corresponding data segment;
(103) connecting the sections of data added with the error correcting codes into integrated software data;
the software data and high reliability information redundancy writing NAND FLASH specifically includes the following steps:
(201) generating high-reliability information, wherein the high-reliability information comprises loading parameter information of embedded software;
(202) selecting NAND FLASH N blocks, selecting M pages from each block, and storing the high-reliability information into the N × M pages respectively, wherein N is more than or equal to 1, M is more than or equal to 1, and N × M is more than or equal to 3; meanwhile, the software data is repeatedly written into NAND FLASH other blocks for P times, wherein P is more than or equal to 3;
the high-reliability information reading and error correction specifically comprises the following steps:
(301) extracting N x M parts of high reliability information from NAND FLASH;
(302) if M is more than or equal to 3, carrying out majority decision decoding on the high-reliability information positioned in the same block bit by bit to obtain N decoded high-reliability information, and then executing the step (303); otherwise, executing step (304);
(303) if N is more than or equal to 3, carrying out majority decision decoding on the N decoded high-reliability information bit by bit again to obtain final decoded high-reliability information; otherwise, randomly selecting a piece of decoded high-reliability information as final decoded high-reliability information;
(304) carrying out majority decision decoding on the N × M pieces of high-reliability information bit by bit to obtain final decoded high-reliability information;
the software data reading and error correction specifically comprises the following steps:
(401) reading P parts of software data, correcting the software data one by one, and if the correction is successful, executing the step (403) by taking the part of software data as correct data; if all the software data fail to correct errors, executing step (402);
(402) carrying out majority decision decoding on the P parts of software data bit by bit to obtain decoded software data, and executing the step (403) by taking the software data as correct data;
(403) and deleting the error correcting codes in the correct data and zero padding at the tail to obtain original software data, and loading the software according to the loading parameter information in the high-reliability information.
2. A method for loading and running embedded software with high reliability is characterized by comprising the steps of preprocessing original embedded software, redundantly writing NAND FLASH software data and high-reliability information, reading and correcting high-reliability information, and reading and correcting software data;
the original embedded software preprocessing specifically comprises the following steps:
(101) carrying out zero filling and segmentation on byte data of original embedded software;
(102) generating an error correcting code of each segment of data, and adding the error correcting code to the tail of the corresponding data segment;
(103) connecting the sections of data added with the error correcting codes into integrated software data;
the software data and high reliability information redundancy writing NAND FLASH specifically includes the following steps:
(201) performing hash operation on the software data to obtain hash data of the software data;
(202) generating high-reliability information, wherein the high-reliability information comprises the hash data and loading parameter information of the embedded software;
(203) selecting NAND FLASH N blocks, selecting M pages from each block, and storing the high-reliability information into the N × M pages respectively, wherein N is more than or equal to 1, M is more than or equal to 1, and N × M is more than or equal to 3; meanwhile, the software data is repeatedly written into NAND FLASH other blocks for P times, wherein P is more than or equal to 3;
the high-reliability information reading and error correction specifically comprises the following steps:
(301) extracting N x M parts of high reliability information from NAND FLASH;
(302) if M is more than or equal to 3, carrying out majority decision decoding on the high-reliability information positioned in the same block bit by bit to obtain N decoded high-reliability information, and then executing the step (303); otherwise, executing step (304);
(303) if N is more than or equal to 3, carrying out majority decision decoding on the N decoded high-reliability information bit by bit again to obtain final decoded high-reliability information; otherwise, randomly selecting a piece of decoded high-reliability information as final decoded high-reliability information;
(304) carrying out majority decision decoding on the N × M pieces of high-reliability information bit by bit to obtain final decoded high-reliability information;
the software data reading and error correction specifically comprises the following steps:
(401) reading P parts of software data, verifying the hash data of the software data one by one, and if the hash data are consistent, taking the part of software data as correct data, and executing the step (404); if all the software data fail to be verified, executing step (402);
(402) correcting the software data in shares, verifying the hash data after correcting the error, and if the hash data is consistent, executing the step (404) by taking the software data as correct data; if all the software data fail to be verified after error correction, executing step (403);
(403) carrying out majority judgment decoding on the P parts of software data bit by bit to obtain decoded software data, verifying hash data of the decoded software data, if the hash data passes the verification, taking the decoded software data as correct data, and executing the step (404), otherwise, prompting that the software loading fails;
(404) and deleting the error correcting codes in the correct data and zero padding at the tail to obtain original software data, and loading the software according to the loading parameter information in the high-reliability information.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911170195.3A CN111061520B (en) | 2019-11-26 | 2019-11-26 | Method for loading and running embedded software with high reliability |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911170195.3A CN111061520B (en) | 2019-11-26 | 2019-11-26 | Method for loading and running embedded software with high reliability |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111061520A true CN111061520A (en) | 2020-04-24 |
CN111061520B CN111061520B (en) | 2022-12-09 |
Family
ID=70298252
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911170195.3A Active CN111061520B (en) | 2019-11-26 | 2019-11-26 | Method for loading and running embedded software with high reliability |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111061520B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107145336A (en) * | 2017-05-12 | 2017-09-08 | 郑州云海信息技术有限公司 | Embedded System Code storage and startup method based on NAND FLASH |
CN108958963A (en) * | 2018-06-01 | 2018-12-07 | 杭州电子科技大学 | A kind of NAND FLASH error control method based on LDPC and cyclic redundancy check code |
-
2019
- 2019-11-26 CN CN201911170195.3A patent/CN111061520B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107145336A (en) * | 2017-05-12 | 2017-09-08 | 郑州云海信息技术有限公司 | Embedded System Code storage and startup method based on NAND FLASH |
CN108958963A (en) * | 2018-06-01 | 2018-12-07 | 杭州电子科技大学 | A kind of NAND FLASH error control method based on LDPC and cyclic redundancy check code |
Non-Patent Citations (2)
Title |
---|
焦新泉等: "基于Nand Flash的BCH校验方法设计与实现", 《电测与仪表》 * |
王钊等: "一种星载嵌入式软件容错启动系统设计", 《电子设计工程》 * |
Also Published As
Publication number | Publication date |
---|---|
CN111061520B (en) | 2022-12-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8527840B2 (en) | System and method for restoring damaged data programmed on a flash device | |
CN106856103B (en) | Turbo product code for NAND flash memory | |
KR100645058B1 (en) | Memory managing technique capable of improving data reliability | |
CN102024501A (en) | Memory system and control method for the same | |
CN110768751B (en) | Decoding method and circuit, memory controller, storage device and controller | |
CN112000512B (en) | Data restoration method and related device | |
US9548761B2 (en) | Coding and decoding of error correcting codes | |
CN101281788A (en) | Flash memory system as well as control method thereof | |
US8341496B2 (en) | Redundant data in storage medium | |
WO2008045292A2 (en) | Error correction decoding methods and apparatus | |
WO2016122515A1 (en) | Erasure multi-checksum error correction code | |
CN112052117B (en) | Satellite-borne system software protection method based on redundant API interface | |
US20180122494A1 (en) | Raid decoding architecture with reduced bandwidth | |
CN105095011B (en) | Data processing method, memorizer control circuit unit and memory storage apparatus | |
CN113168882B (en) | Encoding method, decoding method and storage controller | |
JP2020046823A (en) | Memory system | |
CN111061520B (en) | Method for loading and running embedded software with high reliability | |
US20170161141A1 (en) | Method and apparatus for correcting data in multiple ecc blocks of raid memory | |
CN115904798A (en) | Error correction and detection method and system of memory and controller | |
CN108572882B (en) | Data storage method and storage device | |
CN113517896B (en) | Encoding/decoding method, apparatus and system for phase modulation type holographic memory system | |
CN112000509B (en) | Erasure code encoding method, system and device based on vector instruction | |
CN110896309A (en) | Decoding method, device, decoder and computer storage medium for Turbo product code | |
CN112527548B (en) | Flash memory controller, storage device and reading method | |
CN108170554B (en) | NAND data coding method and device |
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 |