Controlling method, memory controller, and data transmission system

A controlling method of a rewritable non-volatile memory module, and a memory controller and a data transmission system using the same are provided. The controlling method includes following steps. A command is received from a host system. Whether the command is a configuration command is determined according to a command code of the command. A plurality of action information in the configuration command and an execution sequence corresponding to the action information are analyzed. The action information is executed according to the execution sequence. Each action information is configured to request the rewritable non-volatile memory module to execute a predetermined action. Thereby, the functionality of a memory storage device can be dynamically extended.

CROSS-REFERENCE TO RELATED APPLICATION

This application claims the priority benefit of Taiwan application serial no. 102103807, filed on Jan. 31, 2013. The entirety of the above-mentioned patent application is hereby incorporated by reference herein and made a part of this specification.

BACKGROUND

1. Technology Field

The invention generally relates to a controlling method, and more particularly, to a controlling method of a rewritable non-volatile memory module, a memory controller, and a data transmission system.

2. Description of Related Art

Along with the widespread of digital cameras, cell phones, and MP3 players in recently years, the consumers' demand to storage media has increased drastically. Rewritable non-volatile memory (for example, flash memory) is one of the most adaptable storage media to aforementioned portable multimedia devices due to its many characteristics such as data non-volatility, low power consumption, small volume, and non-mechanical structure.

A rewritable non-volatile memory module is usually controlled by a memory controller. The memory controller provides a plurality of commands to a host system, and the host system issues these commands to the memory controller to control the rewritable non-volatile memory module. However, these commands are set up when the memory controller is manufactured. If the manufacturer of the memory controller wants to add a new command to accomplish a specific function, the manufacturer of the memory controller has to re-design the memory controller, which is very tedious and inflexible. Thereby, how to dynamically extend the functionality of a memory controller has become a subject to be resolved in the industry.

SUMMARY OF THE INVENTION

Accordingly, exemplary embodiments of the invention are directed to a controlling method of a rewritable non-volatile memory module, a memory controller, and a data transmission system, in which the functionality of a memory controller can be dynamically extended.

An exemplary embodiment of the invention provides a controlling method of a rewritable non-volatile memory module. The controlling method includes following steps. A first command is received from the host system. Whether the first command is a configuration command is determined according to a first command code of the first command. A plurality of first action information in the configuration command and a first execution sequence corresponding to the first action information are analyzed. The first action information is executed according to the first execution sequence, where each of the first action information is configured to request the rewritable non-volatile memory module to execute a predetermined action.

An exemplary embodiment of the invention provides a data transmission system including a host system and a memory storage device. The memory storage device includes a rewritable non-volatile memory module. The memory storage device receives a first command from the host system and determines whether the first command is a configuration command according to a first command code of the first command. The memory storage device also analyzes a plurality of first action information in the configuration command and a first execution sequence corresponding to the first action information and executes the first action information according to the first execution sequence. Each of the first action information is configured to request the rewritable non-volatile memory module to execute a predetermined action.

An exemplary embodiment of the invention provides a memory controller for controlling a rewritable non-volatile memory module. The rewritable non-volatile memory module includes a plurality of physical erasing units. The memory controller includes a host interface, a memory interface, and a memory management circuit. The host interface is configured to couple to a host system. The memory interface is configured to couple to the rewritable non-volatile memory module. The memory management circuit is coupled to the host interface and the memory interface. The memory management circuit receives a first command from the host system and determines whether the first command is a configuration command according to a first command code of the first command. The memory management circuit also analyzes a plurality of first action information in the configuration command and a first execution sequence corresponding to the first action information and executes the first action information according to the first execution sequence. Each of the first action information is configured to request the rewritable non-volatile memory module to execute a predetermined action.

As described above, in a controlling method of a rewritable non-volatile memory module, a memory controller, and a data transmission system provided by exemplary embodiments of the invention, a host system can send specific action information to a memory storage device through a configuration command, so that the functionality of the memory storage device can be dynamically extended.

These and other exemplary embodiments, features, aspects, and advantages of the invention will be described and become more apparent from the detailed description of exemplary embodiments when read in conjunction with accompanying drawings.

DESCRIPTION OF THE EMBODIMENTS

Generally speaking, a memory storage device (also referred to as a memory storage system) includes a rewritable non-volatile memory module and a controller (also referred to as a control circuit). A memory storage device is usually used with a host system so that the host system can write data into or read data from the memory storage device.

FIG. 1Aillustrates a host system and a memory storage device according to an exemplary embodiment.

Referring toFIG. 1A, the host system1000includes a computer1100and an input/output (I/O) device1106. The computer1100includes a microprocessor1102, a random access memory (RAM)1104, a system bus1108, and a data transmission interface1110. An operating system (OS)1103and an application program1105are loaded into the RAM1104and run by the microprocessor1102. The I/O device1106includes a mouse1202, a keyboard1204, a display1206, and a printer1208, as shown inFIG. 1B. However, the I/O device1106is not limited to the devices illustrated inFIG. 1Band may further include other devices.

In the present embodiment, a memory storage device100is coupled to other components of the host system1000through the data transmission interface1110. Data can be written into or read from the memory storage device100through the operations of the microprocessor1102, the RAM1104, and the I/O device1106. The memory storage device100is a rewritable non-volatile memory storage device, such as the flash drive1212, the memory card1214, or the solid state drive (SSD)1216illustrated inFIG. 1B.

Generally speaking, the host system1000can be substantially any system that works with the memory storage device100to store data. Even though the host system1000is described as a computer system in the present exemplary embodiment, in another exemplary embodiment of the invention, the host system1000may also be a digital camera, a video camera, a communication device, an audio player, or a video player. For example, if the host system is a digital camera (video camera)1310, the rewritable non-volatile memory storage device is then a secure digital (SD) card1312, a multi media card (MMC) card1314, a memory stick (MS)1316, a compact flash (CF) card1318, or an embedded storage device1320(as shown inFIG. 1C) used by the digital camera (video camera)1310. The embedded storage device1320includes an embedded MMC (eMMC). It should be mentioned that an eMMC is directly coupled to the motherboard of a host system.

FIG. 2is a schematic block diagram of the memory storage device inFIG. 1A.

Referring toFIG. 2, the memory storage device100includes a connector102, a memory controller104, and a rewritable non-volatile memory module106.

In the present exemplary embodiment, the connector102complies with the universal serial bus (USB) standard. However, the invention is not limited thereto, and the connector102may also comply with the serial advanced technology attachment (SATA) standard, the parallel advanced technology attachment (PATA) standard, the Institute of Electrical and Electronic Engineers (IEEE) 1394 standard, the peripheral component interconnect (PCI) express standard, the SD interface standard, the ultra high speed-I (UHS-I) interface standard, the ultra high speed-II (UHS-II) interface standard, the MS interface standard, the MMC interface standard, the eMMC interface standard, the universal flash storage (UFS) interface standard, the CF interface standard, the integrated device electronics (IDE) standard, or any other suitable standard.

The memory controller104executes a plurality of logic gates or commands implemented in a hardware form or a firmware form and performs data writing, reading, and erasing operations on the rewritable non-volatile memory module106according to commands issued by the host system1000.

The rewritable non-volatile memory module106is coupled to the memory controller104and configured to store data written by the host system1000. The rewritable non-volatile memory module106has physical erasing units304(0)-304(R). The physical erasing units304(0)-304(R) may belong to a same memory die or different memory dies. Each physical erasing unit has a plurality of physical programming units. The physical programming units belonging to the same physical erasing unit can be individually written but have to be erased all together. Each physical erasing unit may be composed of 128 physical programming units. However, the invention is not limited thereto, and each physical erasing unit may also be composed of 64, 256, or any other number of physical programming units.

To be specific, physical erasing unit is the smallest unit for erasing data. Namely, each physical erasing unit contains the least number of memory cells that are erased all together. Physical programming unit is the smallest unit for programming data. Namely, physical programming unit is the smallest unit for writing data. Each physical programming unit usually includes a data bit area and a redundant bit area. The data bit area includes a plurality of physical access addresses for storing user data, and the redundant bit area is used for storing system data (for example, control information and error checking and correcting codes (ECCs)). In the present exemplary embodiment, the data bit area of each physical programming unit includes 4 physical access addresses, and the size of each physical access address is 512 bytes (B). However, the size and number of the physical access addresses are not limited in the invention, and in other exemplary embodiments, a data bit area may also include 8, 16, or any other greater or smaller number of physical access addresses. The physical erasing units may be physical blocks, and the physical programming units may be physical pages or physical sectors.

In the present exemplary embodiment, the rewritable non-volatile memory module106is a multi level cell (MLC) NAND flash memory module (i.e., each memory cell stores at least two bit data). However, the invention is not limited thereto, and the rewritable non-volatile memory module106may also be a single level cell (SLC) NAND flash memory module, a trinary level cell (TLC) NAND flash memory module, any other flash memory module, or any memory module with the same characteristics.

FIG. 3is a schematic block diagram of a memory controller according to an exemplary embodiment.

Referring toFIG. 3, the memory controller104includes a memory management circuit202, a host interface204, and a memory interface206.

The memory management circuit202controls the overall operation of the memory controller104. To be specific, the memory management circuit202has a plurality of commands, and when the memory storage device100is in operation, the commands are executed to perform various data writing, data reading, and data erasing operations. Below, the operation of the memory management circuit202will be described, and the operation of the memory controller104can be referred to the description related to the operation of the memory management circuit202therefore will not be described.

In the present exemplary embodiment, the commands of the memory management circuit202are implemented in a firmware form. For example, the memory management circuit202has a microprocessor unit (not shown) and a read-only memory (ROM, not shown), and the commands are burnt into the ROM. When the memory storage device100is in operation, the commands are executed by the microprocessor unit to carry out data writing, data reading, and data erasing operations.

In another exemplary embodiment of the invention, the commands of the memory management circuit202may also be stored in a specific area of the rewritable non-volatile memory module106(for example, a system area exclusively used for storing system data in a memory module) as program codes. In addition, the memory management circuit202has a microprocessor unit (not shown), a ROM (not shown), and a RAM (not shown). In particular, the ROM has a driving code segment. When the memory controller104is enabled, the microprocessor unit first executes the driving code segment to load the commands from the rewritable non-volatile memory module106into the RAM of the memory management circuit202. Thereafter, the microprocessor unit runs the commands to perform various data writing, reading, and erasing operations.

The host interface204is coupled to the memory management circuit202and configured to receive and identify commands and data from the host system1000. Namely, commands and data transmitted by the host system1000are transmitted to the memory management circuit202through the host interface204. In the present exemplary embodiment, the host interface204complies with the USB standard. However, the invention is not limited thereto, and the host interface204may also comply with the PATA standard, the IEEE 1394 standard, the PCI express standard, the SATA standard, the UHS-I interface standard, the UHS-II interface standard, the MS standard, the MMC standard, the eMMC interface standard, the UFS interface standard, the CF standard, the IDE standard, or any other suitable data transmission standard.

The memory interface206is coupled to the memory management circuit202and configured to access the rewritable non-volatile memory module106. Namely, data to be written into the rewritable non-volatile memory module106is converted by the memory interface206into a format acceptable to the rewritable non-volatile memory module106.

In an exemplary embodiment of the invention, the memory controller104further includes a buffer memory252, a power management circuit254, and an ECC circuit256.

The buffer memory252is coupled to the memory management circuit202and configured to temporarily store data and commands from the host system1000or data from the rewritable non-volatile memory module106.

The power management circuit254is coupled to the memory management circuit202and configured to control the power supply of the memory storage device100.

The ECC circuit256is coupled to the memory management circuit202and configured to perform an ECC procedure to ensure data accuracy. To be specific, when the memory management circuit202receives a write command from the host system1000, the ECC circuit256generates a corresponding ECC code for the data corresponding to the write command, and the memory management circuit202writes the data corresponding to the write command and the corresponding ECC code into the rewritable non-volatile memory module106. Subsequently, when the memory management circuit202reads the data from the rewritable non-volatile memory module106, it also reads the ECC code corresponding to the data, and the ECC circuit256performs the ECC procedure on the data according to the ECC code.

FIG. 4is a diagram illustrating an example of how a rewritable non-volatile memory module is managed according to an exemplary embodiment.

It should be understood that while describing the operations performed on the physical erasing units of the rewritable non-volatile memory module106, the terms like “select”, “group”, and “associate” refer to logical operations performed on the physical erasing units. Namely, the actual positions of the physical erasing units in the rewritable non-volatile memory module106are not changed and the operations are logically performed on the physical erasing units of the rewritable non-volatile memory module106.

Referring toFIG. 4, the memory controller104logically groups the physical erasing units304(0)-304(R) of the rewritable non-volatile memory module106into a plurality of areas, such as a data area402and a hidden area404. The physical erasing units in the data area402are used for storing data from the host system1000. Usually, the OS1103of the host system1000can access the physical erasing units in the data area402but cannot access the physical erasing units in the hidden area404. The physical erasing units in the hidden area404are used for storing data from the application program1105or data generated during the operation of the memory controller104. It should be noted that the grouping of the physical erasing units304(0)-304(R) is not limited to aforementioned areas in the invention, and the memory management circuit202may further group the physical erasing units304(0)-304(R) into a system area, a spare area, a replacement area, or other areas. In short, physical erasing units logically belonging to the system area are used for recording system data, such as the manufacturer and model number of the memory chip, the number of physical erasing units in the memory chip, and the number of physical programming units in each physical erasing unit. Physical erasing units logically belonging to the replacement area are replacement physical erasing units. For example, when the rewritable non-volatile memory module is just manufactured, 4% of its physical erasing units are reserved for replacement purpose. Namely, when a physical erasing unit outside the replacement area is damaged, a physical erasing unit is selected from the replacement area for substituting the damaged physical erasing unit. In an exemplary embodiment, the system area and the hidden area404can be combined. However, the invention is not limited thereto.

In the present exemplary embodiment, the memory management circuit202configures logical addresses410(0)-410(D) to access data in the physical erasing units in the data area402. For example, when the memory storage device100is formatted by the OS1103through a file system (for example, FAT32), the logical addresses410(0)-410(D) are respectively mapped to the physical erasing units304(0)-304(A) in the data area402. The memory management circuit202establishes a logical address-physical erasing unit mapping table to record the mapping relationship between the logical addresses and the physical erasing units. In the present exemplary embodiment, the size of each of the logical addresses410(0)-410(D) is the same as that of each of the physical erasing units304(0)-304(A) (i.e., the logical addresses may also be referred to as logical block addresses (LBA)). However, the invention is not limited thereto, and in other exemplary embodiments, each of the logical addresses410(0)-410(D) may also have the size of a physical programming unit or any other size.

The memory management circuit202provides a plurality of commands of the rewritable non-volatile memory module106to the host system1000, so that the OS1103can access data in the data area402through these commands. The application program1105may also issue these commands through the OS1103to execute some special operations. These command may include read commands, write commands, commands for setting user passwords, commands for setting some physical erasing units as read-only commands, or any other command. However, the contents of these commands are not limited in the invention. Particularly, the memory management circuit202further provides a plurality of action information to the host system1000, and the application program1105can accomplish specific functions according to the action information. To be specific, each action information is used to request the rewritable non-volatile memory module106to execute a predetermined action. A predetermined action may request the rewritable non-volatile memory module106to read a data, write a data, or erase a physical erasing unit. However, the contents of these predetermined actions are not limited in the invention. When the commands provided by the memory management circuit202cannot accomplish a specific function, the application program1105selects at least one action information and determines an execution sequence of the action information. The application program1105sends the selected action information and the execution sequence to the memory management circuit202through a configuration command. The memory management circuit202accomplishes the specific function according to the configuration command.

FIG. 5is a diagram illustrating how a configuration command is sent according to an exemplary embodiment.

Referring toFIG. 5, the data transmission system500includes the host system1000and the memory storage device100. The memory management circuit202provides action information502(0)-502(E) and commands504(0)-504(F) for the rewritable non-volatile memory module106to the host system1000. Each of the commands504(0)-504(F) includes a command code, and the command code indicates the type of the command (for example, a write command or a read command). When the memory management circuit202receives a first command from the host system1000, it determines whether the first command is a configuration command according to the command code (also referred to as a first command code) of the first command. If the first command is a configuration command, the memory management circuit202analyzes the configuration command to obtain a plurality of action information and an execution sequence of the action information. For example, the configuration command sent by the application program1105includes action information502(1) and502(E) (also referred to as a first action information). After receiving the configuration command, the memory management circuit202analyzes the configuration command to obtain the execution sequence (also referred to as a first execution sequence) of the action information502(1) and502(E). The memory management circuit202executes the action information502(1) and502(E) according to the first execution sequence. If an execution result is generated by executing the action information502(1) and502(E), the memory management circuit202sends the execution result back to the host system1000.

In an exemplary embodiment, the application program1105sends a plurality of configuration commands to the memory management circuit202, and these configuration commands may include different action information or different execution sequences. For example, the memory management circuit202receives a second command from the host system1000. The command code of the second command is the same as the command code of the first command (i.e., the second command is also a configuration command). The second command includes a plurality of second action information. In an exemplary embodiment, the second action information is the same as the first action information in the first command, but the execution sequence (also referred to as a second execution sequence) corresponding to the second action information is different from the execution sequence of the first action information. In another exemplary embodiment, the execution sequence corresponding to the second action information is the same as the execution sequence corresponding to the first action information, but one of the second action information is different from any first action information. In other words, the application program1105can select any action information and determine any execution sequence. It should be noted that the execution sequence can be the arranged sequence of the action information, where the arranged sequence of the action information may be provided as a code segment in the configuration command or as a sort command independent to the configuration command.

In an exemplary embodiment, after receiving the first command, the memory management circuit202establishes a new command according to the action information502(1) and502(E) and the execution sequence thereof. The new command includes at least the action information502(1) and502(E), and the new command is different from the commands504(0)-504(F). The memory management circuit202stores the new command into the rewritable non-volatile memory module106. For example, the memory management circuit202stores the new command into a physical erasing unit in the hidden area404(as shown inFIG. 4). When the application program1105requires the function corresponding to the new command, the application program1105sends an execution command to the memory management circuit202to instruct the memory management circuit202to execute the new command. After receiving the execution command, the memory management circuit202executes the new command. Thus, the new command can be repeatedly executed.

FIG. 6is a flowchart of a controlling method of a rewritable non-volatile memory module according to an exemplary embodiment.

Referring toFIG. 6, in step S602, a first command is received from a host system. In step S604, whether the first command is a configuration command is determined according to a command code of the first command. If it is determined in step S604that the first command is a configuration command, the action information in the configuration command and an execution sequence of the action information are analyzed (step S606), and the action information in the configuration command is executed according to the execution sequence (step S608). If it is determined in step S604that the first command is not a configuration command, the first command is executed (step S610). Various steps illustrated inFIG. 6have been explained in detail above therefore will not be further described herein.

As described, in a controlling method, a memory controller, and a data transmission system provided by exemplary embodiments of the invention, a plurality of action information is sent to a memory storage device through a configuration command, so that the memory storage device can execute the action information according to a specific execution sequence to accomplish a specific function. Thereby, the functionality of the memory storage device is dynamically extended.

The previously described exemplary embodiments of the present invention have the advantages aforementioned, wherein the advantages aforementioned not required in all versions of the invention.