Patent ID: 9213597
Filing Date: 2015-12-15
Classification: G06F

Abstract:
1. A method for programming data, adapted to a memory storage device coupled to a host system, wherein the memory storage device comprises an error checking and correcting (ECC) circuit and a rewritable non-volatile memory chip, and the rewritable non-volatile memory chip comprises a plurality of physical pages, wherein the rewritable non-volatile memory chip comprises a data area, a system area and a spare area, wherein a physical block storing user data is regarded as logically belonging to the data area, wherein a physical block logically belonging to the spare area is used for substituting the physical block logically belonging to the data area, wherein a physical block logically belonging to the system area is used for storing system data for managing the physical block logically belonging to the data area or the spare area, the method for programming data comprising: determining whether write data to be written into the rewritable non-volatile memory chip belongs to a specific type; generating at least one first type ECC code with a first length by the ECC circuit according to the write data when the write data belongs to the specific type; and generating at least one second type ECC code with a second length by the ECC circuit according to the write data when the write data does not belong to the specific type, wherein the first length is longer than the second length, wherein the step of determining whether the write data belongs to the specific type comprises: determining the write data belongs to the specific type if the write data is not from the host system, the write data is data other than user data, or the write data is to be written into the system area of the rewritable non-volatile memory chip.