Electronic devices often have internal storage of important information that can be modified and saved during normal operations. For the purpose of description in this invention, this storage shall be termed “Non-Volatile Memory” or “NVM”. Within the NVM is an embedded file system (EFS). In certain situations, NVM integrity can be at risk. For example, if power to the device is removed during a write operation, the EFS could be corrupted or compromised. This invention describes a method to protect an electronic device's EFS within the NVM in the case of power being unexpectedly removed. In many portable electronic devices, size and cost are critical factors, so a large battery backup on the device would not be acceptable.
What is needed is a system that can reconstruct or replicate the EFS in the event that the NVM becomes corrupted.
One embodiment discloses a method of correcting corrupted data in an embedded file system (EFS) within a non-volatile memory (NVM) system that further includes a replicated file system (RFS). If EFS initialization is successful, a memory comparison between EFS memory sectors and corresponding RFS memory sectors is performed. If a mismatch between one or more memory sectors is determined then the RFS memory sectors that are out of sync with their corresponding EFS memory sectors are identified, erased and rewritten.
If EFS initialization is unsuccessful, a memory comparison between RFS memory sectors and corresponding EFS memory sectors is performed. If a mismatch between one or more memory sectors is determined then the EFS memory sectors that are corrupted are identified, erased and rewritten.
In another embodiment, the method above can be implemented on a computer readable medium storing a computer program product containing computer program code for performing the steps of the method.
In still another embodiment, a non-volatile memory (NVM) system capable of correcting corrupted data comprises an embedded file system (EFS) that further includes an application programming interface (API), one or more operating system processes, a flash driver and a replication layer. The replication layer manages both an EFS partition and an RFS partition wherein the RFS partition is a mirror image to the EFS partition system. When memory sectors of either the EFS partition or the RFS partition become out of synchronization with one another they can be resynchronized using the non-corrupted memory sectors of the non-corrupted partition.
The NVM system can be included within a wireless communication device.
The corrupted data can be the result of a sudden loss of power during a write operation and can be corrected during the next power up cycle of the NVM system.
The corrupted data can also be the result of a runtime error occurring during a read operation and can be corrected on the fly without having to power recycle the wireless communication device.
Non-volatile memory (NVM) corruption is a problem in wireless communication devices. NVM corruption is more prevalent in wireless communication devices that experience random power loss. Examples include wireless communication devices that are included or embedded in automobiles or transportation containers to name just a couple of applications. Following NVM corruption, a wireless communication device may no longer operate. Even if it still does operate, it does so with corrupted data that can include critical calibration data. For instance, if power to the wireless communication device is removed during a write operation, the memory can become corrupted.
In larger more stationary computer devices, a solution to this problem involves maintaining a second independent file system to back up the primary file system. This is more feasible in larger devices and systems since the type of memory is typically not flash memory and physical space and power consumption issues are not significant hurdles. In a wireless communication device, however, the memory used is typically flash memory and the modules that encompass these wireless communication devices are significantly constrained with respect to both physical space and power. Thus, applying an independent file system to back up the primary embedded file system within the NVM is not a practical solution to the problem described above since two independent file systems would create significant resource conflicts when competing for access to the same flash memory device.
The present disclosure describes a system and method for restoring the wireless communication device's NVM data following an event that causes corruption of NVM data. This solution is somewhat less complicated than an independent back up system since only the corrupted data is restored. A complete rebuild of the NVM storage system is not required.
For wireless communication devices data is typically stored on a flash memory device using an embedded file system (EFS). The system and method described herein duplicates all write operations to the primary EFS to a secondary memory location that is referred to as the replicated file system (RFS).
There are a couple of different scenarios in which the EFS can be reconstructed following a corrupting event. One scenario, described with reference to
When the wireless communication device is powered up following a loss of power, a check is made to determine whether EFS initialization was successful 301. If successful 302 then the EFS memory is compared to the RFS memory 303. If that comparison yields a match 304 then the power up synchronization process ends 305. If the EFS memory comparison to the RFS memory 303 yields a mismatch 306 then the non-synced RFS memory sector(s) are identified 307, erased 308 and rewritten 309. The power up synchronization process then ends 305.
If the EFS initialization was unsuccessful 310 then an RFS to EFS memory comparison is performed 311. If that comparison yields a match 312 then the power up synchronization process ends 305. If the RFS to EFS memory comparison 311 yields a mismatch 313 then the corrupted EFS memory sector(s) are identified 314, erased 315 and rewritten 316. The power up synchronization process then ends 305.
A non-synced RFS memory sector is one that is not synchronized with a corresponding EFS memory sector. Non-synchronization can occur, for instance, due to a loss of power during a write operation to flash memory in which the write operation to the EFS completed but the replicated write to the RFS did not complete. Non-synchronization can also occur, for instance, due to a loss of power during an EFS sector erasure in which the EFS erasure completed but the replicated RFS erasure did not complete.
If an EFS read error occurs a synchronization check between the RFS and EFS can be initiated and the corrupted sector(s) will be corrected on the fly without the need to reboot the system. Upon detection 402 of a read error, an RFS to EFS memory comparison 404 is initiated. Any corrupted EFS memory sector(s) are identified 406, erased 408 and rewritten 410. The EFS is then re-initialized 412 ending the read error correction process 414.
As will be appreciated by one of skill in the art, the present invention may be embodied as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment (including firmware, resident software, micro-code, etc.) or an embodiment combining software and hardware aspects that may all generally be referred to herein as a “circuit,” “module” or “system.” Furthermore, the present invention may take the form of a computer program product on a computer-usable storage medium having computer-usable program code embodied in the medium.
Any suitable computer readable medium may be utilized. The computer-usable or computer-readable medium may be, for example but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, device, or propagation medium. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a transmission media such as those supporting the Internet or an intranet, or a magnetic storage device. Note that the computer-usable or computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via, for instance, optical scanning of the paper or other medium, then compiled, interpreted, or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory. In the context of this document, a computer-usable or computer-readable medium may be any medium that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
Computer program code for carrying out operations of the present invention may be written in an object oriented programming language such as Java, Smalltalk, C++ or the like. However, the computer program code for carrying out operations of the present invention may also be written in conventional procedural programming languages, such as the “C” programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer through a local area network (LAN) or a wide area network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet Service Provider).
The present invention is described below with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
Any prompts associated with the present invention may be presented and responded to via a graphical user interface (GUI) presented on the display of the mobile communications device or the like. Prompts may also be audible, vibrating, etc.
The flowcharts and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used herein, the singular forms “a”, “an” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms “comprises” and/or “comprising,” when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
Although specific embodiments have been illustrated and described herein, those of ordinary skill in the art appreciate that any arrangement which is calculated to achieve the same purpose may be substituted for the specific embodiments shown and that the invention has other applications in other environments. This application is intended to cover any adaptations or variations of the present invention. The following claims are in no way intended to limit the scope of the invention to the specific embodiments described herein.