TWI436367B - Method for operating non-volatile flash memory with write protection mechanism - Google Patents

Method for operating non-volatile flash memory with write protection mechanism Download PDF

Info

Publication number
TWI436367B
TWI436367B TW99110195A TW99110195A TWI436367B TW I436367 B TWI436367 B TW I436367B TW 99110195 A TW99110195 A TW 99110195A TW 99110195 A TW99110195 A TW 99110195A TW I436367 B TWI436367 B TW I436367B
Authority
TW
Taiwan
Prior art keywords
flash memory
instruction
protection information
state
protection
Prior art date
Application number
TW99110195A
Other languages
Chinese (zh)
Other versions
TW201135740A (en
Inventor
Tsungpao Nien
Mingte Chou
Jianhui Xie
Original Assignee
Chingis Technology Corp
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 Chingis Technology Corp filed Critical Chingis Technology Corp
Priority to TW99110195A priority Critical patent/TWI436367B/en
Publication of TW201135740A publication Critical patent/TW201135740A/en
Application granted granted Critical
Publication of TWI436367B publication Critical patent/TWI436367B/en

Links

Landscapes

  • Storage Device Security (AREA)

Description

具有寫入保護機制之非揮發性快閃記憶體運作方法Non-volatile flash memory operating method with write protection mechanism

本揭示內容是有關於一種非揮發性快閃記憶體運作方法,且特別是有關於一種具有寫入保護機制之非揮發性快閃記憶體運作方法。The present disclosure relates to a method of operating a non-volatile flash memory, and more particularly to a method of operating a non-volatile flash memory having a write protection mechanism.

非揮發性快閃記憶體的寫入保護技術,如序列週邊介面(Serial peripheral interface;SPI),可以使非揮發性快閃記憶體受到保護,以避免在微控制單元未正常運作時產生非法或是不當的指令,對非揮發性快閃記憶體內的資料進行更動。Non-volatile flash memory write protection techniques, such as Serial Peripheral Interface (SPI), protect non-volatile flash memory from being illegal when the micro-control unit is not functioning properly or It is an improper instruction to change the data in non-volatile flash memory.

現有的寫入保護技術常利用具有較少位元數的保護資訊來表示受到保護的記憶體區塊/磁區。然而,用以對保護資訊進行更改的指令通常具有簡單的結構,如00000001b。因此,當電腦系統的電源不穩或是突然斷電時,可能會使保護資訊遭受到不必要的更動。舉例來說,當系統電路板的電源降低到特定的準位以下,微控制單元可能無法正常運作而產生異常的指令。如果此異常指令恰好與變更保護資訊的指令相符,則本來受到寫入保護的記憶體陣列將可能因此而變得可被允許寫入。在此情況下,如果不當的資料被寫入這些記憶體陣列中,系統可能因為這些資料被改動而無法開機或是遭受到更嚴重的錯誤。Existing write protection techniques often utilize protection information with fewer bits to represent protected memory blocks/magnetic regions. However, the instructions used to make changes to the protection information usually have a simple structure, such as 00000001b. Therefore, when the power supply of the computer system is unstable or suddenly powered off, the protection information may be subjected to unnecessary changes. For example, when the power of the system board drops below a certain level, the micro control unit may not function properly and generate an abnormal command. If this exception instruction coincides with the instruction to change the protection information, the memory array that would otherwise be protected by writes may thus become allowed to be written. In this case, if improper data is written to these memory arrays, the system may not be able to boot or suffer more serious errors because the data is altered.

因此,如何設計一個新的具有寫入保護機制之非揮發性快閃記憶體運作方法,以避免上述的缺失發生,乃為此一業界亟待解決的問題。Therefore, how to design a new non-volatile flash memory operation method with write protection mechanism to avoid the above-mentioned missing occurs is an urgent problem to be solved in the industry.

因此,本揭示內容之一態樣是在提供一種具有寫入保護機制之非揮發性快閃記憶體之運作方法,運作方法包含下列步驟:發送指令;判斷指令為防護資訊變更指令或快閃記憶體資料變更指令;當指令為防護資訊變更指令時,判斷防護資訊變更指令是否與具有一特定組合順序之複數更動指令相符,其中唯有當防護資訊變更指令與具有特定組合順序之更動指令相符時,允許防護資訊根據防護資訊變更指令進行變更;當指令為快閃記憶體資料變更指令時,判斷狀態暫存器保護資訊是否顯示一記憶體區塊/磁區(block/sector)位於寫入保護狀態,及判斷防護資訊是否顯示記憶體區塊/磁區位於寫入保護狀態,其中唯有當狀態暫存器保護資訊顯示記憶體區塊/磁區不位於寫入保護狀態且防護資訊顯示記憶體區塊/磁區不位於寫入保護狀態時,允許記憶體區塊/磁區根據快閃記憶體資料變更指令進行變更。Therefore, one aspect of the present disclosure is to provide a method for operating a non-volatile flash memory having a write protection mechanism, the method comprising the steps of: sending an instruction; determining that the instruction is a protection information change instruction or a flash memory The body data change instruction; when the instruction is a protection information change instruction, it is determined whether the protection information change instruction is consistent with a plurality of change instructions having a specific combination order, wherein only when the protection information change instruction matches the change order having a specific combination order The protection information is allowed to be changed according to the protection information change instruction; when the instruction is the flash memory data change instruction, it is determined whether the status register protection information indicates that a memory block/sector is located in the write protection. Status, and determine whether the protection information indicates that the memory block/magnetic area is in the write protection state, and only when the status register protection information shows that the memory block/magnetic area is not in the write protection state and the protection information display memory When the body block/magnetic area is not in the write protection state, the memory block/magnetic area is allowed to be fast. The flash memory data change command is changed.

依據本揭示內容一實施例,其中防護資訊儲存於迷你陣列(mini-array)中。According to an embodiment of the present disclosure, the protection information is stored in a mini-array.

依據本揭示內容另一實施例,具有特定組合順序之等更動指令包含複數程式指令、位址指令以及設定指令。其中位址指令對應非揮發性快閃記憶體之區塊,設定指令包含複數防護位元,各顯示非揮發性快閃記憶體之磁區是否位於寫入保護狀態。In accordance with another embodiment of the present disclosure, an alternation instruction having a particular combination order includes a plurality of program instructions, an address instruction, and a set instruction. The address command corresponds to the non-volatile flash memory block, and the setting command includes a plurality of guard bits, and each of the magnetic regions of the non-volatile flash memory is in a write protection state.

依據本揭示內容又一實施例,其中具有特定組合順序之更動指令包含複數抹除指令。In accordance with yet another embodiment of the present disclosure, a change instruction having a particular combination order includes a plurality of erase instructions.

依據本揭示內容再一實施例,其中快閃記憶體資料變更指令為快閃記憶體程式化(program)指令。According to still another embodiment of the present disclosure, the flash memory data change instruction is a flash memory program instruction.

依據本揭示內容更具有之一實施例,其中快閃記憶體資料變更指令為快閃記憶體抹除指令。According to the disclosure, there is an embodiment in which the flash memory data change instruction is a flash memory erase command.

依據本揭示內容另一實施例,其中非揮發性快閃記憶體包含程式碼區域以及參數設定區域,其中快閃記憶體資料變更指令對程式碼區域之內容進行變更。According to another embodiment of the present disclosure, the non-volatile flash memory includes a code area and a parameter setting area, wherein the flash memory data change instruction changes the content of the code area.

依據本揭示內容又一實施例,其中狀態暫存器保護資訊為三位元資訊,以顯示非揮發性快閃記憶體位於寫入保護狀態之記憶體區塊/磁區。According to still another embodiment of the present disclosure, the state register protection information is three-bit information to display the memory block/magnetic area of the non-volatile flash memory in the write protection state.

依據本揭示內容再一實施例,於發送指令之步驟前,更包含:使晶片致能(chip enable)訊號由抑能狀態轉為致能狀態。According to still another embodiment of the present disclosure, before the step of sending the command, the method further includes: turning the chip enable signal from an inhibited state to an enabled state.

依據本揭示內容更具有之一實施例,其中指令由微控制單元(micro control unit;MCU)發送。There is further an embodiment in accordance with the present disclosure in which the instructions are transmitted by a micro control unit (MCU).

應用本揭示內容之優點係在於藉由防護資訊,使更動防護資訊必需藉由複雜的防護資訊變更指令才能進行,以避免其受到電源不穩所產生的不當指令竄改,並且使快閃記憶體中的資料需要在防護資訊與狀態暫存器保護資訊均顯示其不位於寫入保護狀態時才能更動,具有雙重保護之機制,而輕易地達到上述之目的。The advantage of applying the disclosure is that the protection information must be protected by a complex protection information change instruction to prevent tampering with improper instructions caused by power instability, and to make the flash memory in the flash memory. The data needs to be changed when both the protection information and the status register protection information indicate that it is not in the write protection state, and the double protection mechanism can easily achieve the above purpose.

請參照第1圖,為本揭示內容之一實施例中,電子裝置系統1之示意圖。電子裝置系統1於不同之實施例中可為液晶顯示控制器(LCD scalar)、數位相機模組、行動通訊裝置或是個人電腦周邊設備。電子裝置系統1包含微控制單元10、非揮發性快閃記憶體12、狀態暫存器14及迷你陣列16。Please refer to FIG. 1 , which is a schematic diagram of an electronic device system 1 according to an embodiment of the disclosure. In various embodiments, the electronic device system 1 can be a liquid crystal display controller (LCD scalar), a digital camera module, a mobile communication device, or a personal computer peripheral device. The electronic device system 1 includes a micro control unit 10, a non-volatile flash memory 12, a status register 14 and a mini array 16.

微控制單元10可以產生指令,以在允許寫入的情形下,對非揮發性快閃記憶體12、狀態暫存器14及迷你陣列16內的資料進行更動。非揮發性快閃記憶體12於一實施例中包含包含程式碼區域以及參數設定區域(未繪示)。參數設定區域用以儲存複數個可以由使用者經常設定調整的參數。而程式碼區域則儲存複數個程式碼,其中這些程式碼是用來執行特定的功能,並且不允許使用者輕易地對這些程式碼進行更動。舉例來說,在液晶顯示模組中,使用者可以設定及調整儲存在參數設定區域內的參數,如亮度、彩度及顯示畫面的尺寸等等。另一方面,液晶顯示模組的程式碼區域可能儲存有使液晶顯示模組可以運作的程式碼。如果程式碼被不當地更動了,液晶顯示模組可能將因此而無法正常運作。所以,非揮發性快閃記憶體12中的程式碼區域需要一個寫入保護的機制,以避免程式碼區域中的程式碼被輕易地更改。Microcontrol unit 10 can generate instructions to modify the data in non-volatile flash memory 12, state register 14 and mini-array 16 in the event that writes are allowed. In one embodiment, the non-volatile flash memory 12 includes a code region and a parameter setting region (not shown). The parameter setting area is used to store a plurality of parameters that can be adjusted by the user frequently. The code area stores a plurality of codes, wherein the codes are used to perform specific functions, and the user is not allowed to easily change the codes. For example, in the liquid crystal display module, the user can set and adjust parameters stored in the parameter setting area, such as brightness, chroma, and size of the display screen. On the other hand, the code area of the liquid crystal display module may store a code for enabling the liquid crystal display module to operate. If the code is improperly changed, the LCD module may not work properly. Therefore, the code area in the non-volatile flash memory 12 requires a write protection mechanism to prevent the code in the code area from being easily changed.

請參照第2圖。第2圖為本揭示內容之一實施例中,具有寫入保護機制之非揮發性快閃記憶體之運作方法。此運作方法可應用於如第1圖所繪示之電子裝置系統1中。運作方法包含下列步驟(應瞭解到,在本實施方式中所提及的步驟,除特別敘明其順序者外,均可依實際需要調整其前後順序,甚至可同時或部分同時執行)。Please refer to Figure 2. 2 is a method of operating a non-volatile flash memory with a write protection mechanism in an embodiment of the present disclosure. This method of operation can be applied to the electronic device system 1 as shown in FIG. The operation method includes the following steps (it should be understood that the steps mentioned in the present embodiment can be adjusted according to actual needs, and can be performed simultaneously or partially simultaneously, unless otherwise specified.

於步驟201,微控制單元10發送一指令,且此指令將被判斷為一防護資訊變更指令或一快閃記憶體資料變更指令。當此指令為防護資訊變更指令11時,步驟202被執行以判斷此指令為防護資訊變更指令11。防護資訊變更指令11是用以更動迷你陣列16中所儲存的防護資訊160。In step 201, the micro control unit 10 sends an instruction, and the instruction is determined to be a protection information change instruction or a flash memory data change instruction. When the instruction is the protection information change instruction 11, step 202 is executed to determine that the instruction is the protection information change instruction 11. The protection information change command 11 is used to change the protection information 160 stored in the mini array 16.

於步驟203,判斷防護資訊變更指令11是否與具有一特定組合順序之複數個更動指令相符。於一實施例中,防護資訊變更指令11可用以對迷你陣列16中所儲存的防護資訊160進行程式化。請參照第3圖。第3圖為本揭示內容一實施例中,一特定組合順序之複數個更動指令的示意圖。如第3圖所示,CE代表晶片致能訊號,SCK代表序列資料時脈(serial data clock)訊號,而SI則代表序列資料輸入訊號。當晶片致能訊號CE變為高態時,將無法對晶片進行任何動作。而相反地,當晶片致能訊號CE變為低態時,由序列資料輸入訊號SI傳送的指令將可以對晶片進行更動。In step 203, it is determined whether the protection information change instruction 11 matches a plurality of change instructions having a specific combination order. In one embodiment, the protection information change command 11 can be used to program the protection information 160 stored in the mini array 16. Please refer to Figure 3. FIG. 3 is a schematic diagram of a plurality of modifiers in a specific combination sequence in an embodiment of the disclosure. As shown in Figure 3, CE represents the chip enable signal, SCK represents the serial data clock signal, and SI represents the sequence data input signal. When the wafer enable signal CE goes high, no action can be taken on the wafer. Conversely, when the chip enable signal CE goes low, the instructions transmitted by the sequence data input signal SI will be able to change the wafer.

如第3圖所繪示,此具有特定組合順序之複數個更動指令包含複數個程式指令、一位址指令以及至少一設定指令。程式指令於本實施例中為55h、AAh、A0h、55h及23h,而位址指令則為A23-A0。然而,在程式指令傳送期間,於程式指令中第一個55h至最後一個55h間的各指令後面所接續的位址指令指令,實質上是未知(unknown),唯有接續在23h後的位址指令才包含真正的位址資訊。位址顯示的是非揮發性快閃記憶體12的區塊(block)位址,而第3圖中繪示為D7-D0的設定指令則顯示非揮發性快閃記憶體12中要進行程式化的磁區(sector)。於一實施例中,設定指令包含8個保護位元,各表示一對應的磁區是否位在寫入保護狀態之下。舉例來說,0可設定對應的磁區以使磁區受到保護,而1可設定對應的磁區以使磁區允許被寫入。As shown in FIG. 3, the plurality of modifier commands having a specific combination order includes a plurality of program instructions, an address instruction, and at least one setting instruction. The program instructions are 55h, AAh, A0h, 55h, and 23h in this embodiment, and the address instruction is A23-A0. However, during the transfer of the program instruction, the address instruction instruction following the instruction between the first 55h and the last 55h of the program instruction is essentially unknown, and only the address after 23h is continued. The instructions contain real address information. The address shows the block address of the non-volatile flash memory 12, and the setting command shown in FIG. 3 as D7-D0 shows that the non-volatile flash memory 12 is to be stylized. The sector. In one embodiment, the set command includes eight guard bits, each indicating whether a corresponding magnetic region is in a write protected state. For example, 0 can set the corresponding magnetic region to protect the magnetic region, and 1 can set the corresponding magnetic region to allow the magnetic region to be written.

請參照表1。表1為設定指令之一範例。Please refer to Table 1. Table 1 shows an example of setting instructions.

如表1所示,位址顯示的是非揮發性快閃記憶體12的區塊(block)位址,而設定指令的各位元D7-D0則對應各區塊中的各磁區(sector)。舉例來說,如果位址指令為001h且設定指令為11101111,則具有001h的位址的區塊中的第五個磁區是位於保護狀態。於一實施例中,如果像第3圖所示,兩個設定指令被發送,則後者所對應的區塊之位址,為前者所對應的區塊之位址加一。換句話說,如果前一個設定指令對應的區塊位址為001h,則後一個設定指令所要設定的磁區,是屬於位址為002h的區塊。As shown in Table 1, the address shows the block address of the non-volatile flash memory 12, and the bits D7-D0 of the set command correspond to the respective sectors in each block. For example, if the address instruction is 001h and the set instruction is 11101111, the fifth magnetic zone in the block having the address of 001h is in the protected state. In an embodiment, if two setting commands are transmitted as shown in FIG. 3, the address of the block corresponding to the latter is one plus the address of the block corresponding to the former. In other words, if the block address corresponding to the previous setting command is 001h, the magnetic zone to be set by the latter setting command belongs to the block whose address is 002h.

需注意的是,上述之實施方式僅為一個範例,實質上,程式指令的數目、這些指令的順序可以為本領域熟知此技藝者輕易地更動。並且,上述的防護資訊160亦可儲存於其他的儲存模組之中。It should be noted that the above embodiments are merely an example. In essence, the number of program instructions and the order of these instructions can be easily changed by those skilled in the art. Moreover, the protection information 160 described above may also be stored in other storage modules.

於另一實施例中,防護資訊變更指令11可用以抹除位於迷你陣列16中的防護資訊160。在此情形下,此具有特定組合順序之複數個更動指令包含複數個抹除指令,如第4圖所繪示。抹除指令可包含如55h、AAh、80h、AAh及2Bh這樣的順序的指令,並如同前述的程式指令,經由序列資料輸入訊號SI傳送。然而,由於抹除指令是用以抹除在防護資訊160所有的資料,因此在抹除過程中不需要傳送實際的位址指令。In another embodiment, the protection information change command 11 can be used to erase the protection information 160 located in the mini array 16. In this case, the plurality of modifiers having a particular combination order includes a plurality of erase instructions, as depicted in FIG. The erase command may include instructions in the order of 55h, AAh, 80h, AAh, and 2Bh, and is transmitted via the sequence data input signal SI as the program instructions described above. However, since the erase command is used to erase all the data in the protection information 160, it is not necessary to transmit the actual address instruction during the erasing process.

請再次參照第1圖以及第2圖。接著,唯有當防護資訊變更指令11與具有特定組合順序之更動指令相符時,步驟204才被執行,以允許防護資訊160根據防護資訊變更指令11進行變更,不論是程式化或抹除的變更。因此,上述複雜的變更程序,將可以防止防護資訊160被由於系統電源不穩或是不足而不當產生的指令輕易地更動。Please refer to Figure 1 and Figure 2 again. Then, only when the protection information change instruction 11 matches the change order having the specific combination order, the step 204 is executed to allow the protection information 160 to be changed according to the protection information change instruction 11, whether it is a stylized or erased change. . Therefore, the above complicated change procedure can prevent the protection information 160 from being easily changed by an instruction that is improperly generated due to unstable or insufficient power of the system.

另一方面,當指令為快閃記憶體資料變更指令13時,步驟205被執行以判斷此指令為快閃記憶體資料變更指令13。接著於步驟206,判斷狀態暫存器保護資訊140是否顯示非揮發性快閃記憶體12之記憶體區塊/磁區位於寫入保護狀態,及判斷防護資訊160是否顯示此記憶體區塊/磁區位於寫入保護狀態。On the other hand, when the instruction is the flash memory data change instruction 13, step 205 is executed to determine that the instruction is the flash memory data change instruction 13. Next, in step 206, it is determined whether the state register protection information 140 indicates that the memory block/magnetic area of the non-volatile flash memory 12 is in the write protection state, and whether the protection information 160 displays the memory block/ The magnetic zone is in the write protection state.

狀態暫存器保護資訊140儲存於狀態暫存器14中。於一實施例中,狀態暫存器保護資訊140為三位元資訊,各保護位元顯示非揮發性快閃記憶體12之一區塊範圍是否位於寫入保護狀態。舉例來說,011可表示非揮發性快閃記憶體12的區塊4-7位於寫入保護狀態,而000則表示非有任何非揮發性快閃記憶體12中的區塊位於寫入保護狀態。然而,可用以更動狀態暫存器保護資訊140內容的指令與防護資訊160相較下簡單許多。如果僅使用狀態暫存器保護資訊140,則不當的指令容易更動狀態暫存器保護資訊140,而使電子裝置系統1可能因而無法正常運作。Status register protection information 140 is stored in status register 14. In one embodiment, the state register protection information 140 is three-bit information, and each protection bit indicates whether a block range of the non-volatile flash memory 12 is in a write protection state. For example, 011 may indicate that blocks 4-7 of non-volatile flash memory 12 are in a write protected state, while 000 indicates that blocks in any non-volatile flash memory 12 are in write protection. status. However, the instructions available to change the contents of the state protector information 140 are much simpler than the protection information 160. If only the state register protection information 140 is used, the improper instructions tend to change the state register protection information 140, which may cause the electronic device system 1 to malfunction.

因此,於步驟207,唯有當狀態暫存器保護資訊140及防護資訊160均顯示記憶體區塊/磁區不位於寫入保護狀態時,允許此記憶體區塊/磁區根據快閃記憶體資料變更指令13進行變更,不論是抹除或程式化。Therefore, in step 207, only when the state register protection information 140 and the protection information 160 indicate that the memory block/magnetic area is not in the write protection state, the memory block/magnetic area is allowed to be based on the flash memory. The volume data change command 13 is changed, whether it is erased or programmed.

實質上,在非揮發性快閃記憶體12的抹除或程式化過程中,晶片致能訊號CE必需要由抑能狀態(待機模式)轉換至致能狀態。請參照第5圖。第5圖為本揭示內容之一實施例中,非揮發性快閃記憶體12的抹除/程式化過程之另一流程圖(應瞭解到,在本實施方式中所提及的步驟,除特別敘明其順序者外,均可依實際需要調整其前後順序,甚至可同時或部分同時執行)。In essence, during the erasing or programming of the non-volatile flash memory 12, the chip enable signal CE must be switched from the inhibit state (standby mode) to the enable state. Please refer to Figure 5. FIG. 5 is another flow chart of the erasing/staging process of the non-volatile flash memory 12 in one embodiment of the disclosure (it should be understood that the steps mentioned in the embodiment include In particular, the sequence can be adjusted according to actual needs, and can even be executed simultaneously or partially.

於步驟501,晶片致能訊號CE位於抑能狀態,於本實施例中為高態。於步驟502,晶片致能訊號CE轉換至致能狀態,於本實施例中為相反於高態之低態。於步驟503,發送抹除/程式化指令,並傳送位址及資料。接著於步驟504,晶片致能訊號CE轉回抑能狀態。於步驟505,判斷狀態暫存器保護資訊140是否顯示非揮發性快閃記憶體12之記憶體區塊/磁區位於寫入保護狀態。當狀態暫存器保護資訊140顯示非揮發性快閃記憶體12之記憶體區塊/磁區位於寫入保護狀態,抹除/程式化指令將無法對非揮發性快閃記憶體12進行更動。當狀態暫存器保護資訊140顯示非揮發性快閃記憶體12之記憶體區塊/磁區不位於寫入保護狀態,步驟506被執行以判斷防護資訊160是否顯示此記憶體區塊/磁區位於寫入保護狀態。當防護資訊160顯示非揮發性快閃記憶體12之記憶體區塊/磁區位於寫入保護狀態,抹除/程式化指令將無法對非揮發性快閃記憶體12進行更動。當防護資訊160顯示非揮發性快閃記憶體12之記憶體區塊/磁區不位於寫入保護狀態,則步驟507被執行以啟始抹除/程式化。In step 501, the wafer enable signal CE is in an inhibit state, which is a high state in this embodiment. In step 502, the wafer enable signal CE is switched to an enabled state, which in this embodiment is a low state opposite to the high state. In step 503, an erase/stylization instruction is sent and the address and data are transmitted. Next, in step 504, the wafer enable signal CE is switched back to the suppression state. In step 505, it is determined whether the state register protection information 140 indicates that the memory block/magnetic area of the non-volatile flash memory 12 is in the write protection state. When the state register protection information 140 indicates that the memory block/magnetic area of the non-volatile flash memory 12 is in the write protection state, the erase/program command will not be able to change the non-volatile flash memory 12. . When the state register protection information 140 indicates that the memory block/magnetic area of the non-volatile flash memory 12 is not in the write protection state, step 506 is executed to determine whether the protection information 160 displays the memory block/magnetic The zone is in the write protection state. When the protection information 160 indicates that the memory block/magnetic area of the non-volatile flash memory 12 is in the write protection state, the erase/stylize command will not be able to change the non-volatile flash memory 12. When the protection information 160 indicates that the memory block/magnetic area of the non-volatile flash memory 12 is not in the write protection state, then step 507 is executed to initiate erasing/staging.

藉由上述由狀態暫存器保護資訊140以及更難以更動的防護資訊160共同提供的寫入保護機制,非揮發性快閃記憶體12中的程式碼將可避免受到不當指令輕易更動的影響。With the write protection mechanism provided by the state register protection information 140 and the more difficult protection information 160, the code in the non-volatile flash memory 12 can be prevented from being easily affected by improper instructions.

雖然本揭示內容已以實施方式揭露如上,然其並非用以限定本揭示內容,任何熟習此技藝者,在不脫離本揭示內容之精神和範圍內,當可作各種之更動與潤飾,因此本揭示內容之保護範圍當視後附之申請專利範圍所界定者為準。The present disclosure has been disclosed in the above embodiments, but it is not intended to limit the disclosure, and any person skilled in the art can make various changes and refinements without departing from the spirit and scope of the disclosure. The scope of protection of the disclosure is subject to the definition of the scope of the patent application.

1...電子裝置系統1. . . Electronic device system

10...微控制單元10. . . Micro control unit

11...防護資訊變更指令11. . . Protection information change order

12...非揮發性快閃記憶體12. . . Non-volatile flash memory

13...快閃記憶體資料變更指令13. . . Flash memory data change instruction

14...狀態暫存器14. . . Status register

140...狀態暫存器保護資訊140. . . Status register protection information

16...迷你陣列16. . . Mini array

160...防護資訊160. . . Protection information

201-207...步驟201-207. . . step

501-507...步驟501-507. . . step

為讓本揭示內容之上述和其他目的、特徵、優點與實施例能更明顯易懂,所附圖式之說明如下:The above and other objects, features, advantages and embodiments of the present disclosure will become more apparent and understood.

第1圖為本揭示內容之一實施例中,電子裝置系統之示意圖;1 is a schematic diagram of an electronic device system in an embodiment of the disclosure;

第2圖為本揭示內容之一實施例中,具有寫入保護機制之非揮發性快閃記憶體之運作方法;2 is a method for operating a non-volatile flash memory having a write protection mechanism in an embodiment of the present disclosure;

第3圖為本揭示內容一實施例中,一特定組合順序之複數個更動指令的示意圖;3 is a schematic diagram of a plurality of modifiers in a specific combination sequence in an embodiment of the disclosure;

第4圖為本揭示內容另一實施例中,一特定組合順序之複數個更動指令的示意圖;以及4 is a schematic diagram of a plurality of modifiers in a specific combination sequence in another embodiment of the disclosure;

第5圖為本揭示內容之一實施例中,非揮發性快閃記憶體的抹除/程式化過程之另一流程圖。FIG. 5 is another flow chart of the erasing/staging process of the non-volatile flash memory in an embodiment of the present disclosure.

1...電子裝置系統1. . . Electronic device system

10...微控制單元10. . . Micro control unit

11...防護資訊變更指令11. . . Protection information change order

12...非揮發性快閃記憶體12. . . Non-volatile flash memory

13...快閃記憶體資料變更指令13. . . Flash memory data change instruction

14...狀態暫存器14. . . Status register

140...狀態暫存器保護資訊140. . . Status register protection information

16...迷你陣列16. . . Mini array

160...防護資訊160. . . Protection information

Claims (11)

一種具有寫入保護機制之一非揮發性快閃記憶體之運作方法,該運作方法包含下列步驟:發送一指令;判斷該指令為一防護資訊變更指令或一快閃記憶體資料變更指令;當該指令為該防護資訊變更指令時,判斷該防護資訊變更指令是否與具有一特定組合順序之複數個更動指令相符,其中唯有當該防護資訊變更指令與具有該特定組合順序之該等更動指令相符時,允許一防護資訊根據該防護資訊變更指令進行變更;當該指令為該快閃記憶體資料變更指令時,判斷一狀態暫存器保護資訊是否顯示該非揮發性快閃記憶體之一記憶體區塊/磁區位於一寫入保護狀態,及判斷該防護資訊是否顯示該非揮發性快閃記憶體之該記憶體區塊/磁區位於該寫入保護狀態,其中唯有當該狀態暫存器保護資訊顯示該記憶體區塊/磁區不位於該寫入保護狀態且該防護資訊顯示該記憶體區塊/磁區不位於該寫入保護狀態時,允許該記憶體區塊/磁區根據該快閃記憶體資料變更指令進行變更。A method for operating a non-volatile flash memory having a write protection mechanism, the method includes the steps of: sending an instruction; determining that the instruction is a protection information change instruction or a flash memory data change instruction; When the instruction is the protection information change instruction, determining whether the protection information change instruction is consistent with a plurality of change instructions having a specific combination order, wherein only the protection information change instruction and the change instruction having the specific combination order When matching, a protection information is allowed to be changed according to the protection information change instruction; when the instruction is the flash memory data change instruction, determining whether a status register protection information displays one of the non-volatile flash memories The body block/magnetic area is in a write protection state, and determining whether the protection information indicates that the memory block/magnetic area of the non-volatile flash memory is in the write protection state, wherein only the state is temporarily The memory protection information indicates that the memory block/magnetic area is not in the write protection state and the protection information displays the record When the body block / region is not located in the magnetic write protection state, allowing the blocks of memory / magnetic domain is changed according to the change command flash memory data. 如請求項1所述之運作方法,其中該防護資訊係儲存於一迷你陣列中。The method of operation of claim 1, wherein the protection information is stored in a mini array. 如請求項1所述之運作方法,其中具有該特定組合順序之該等更動指令包含複數程式指令、一位址指令以及至少一設定指令。The method of operation of claim 1, wherein the modifiers having the particular combination order comprise a plurality of program instructions, an address instruction, and at least one setting instruction. 如請求項3所述之運作方法,其中該位址指令對應該非揮發性快閃記憶體之一區塊,該設定指令包含複數防護位元,各顯示該非揮發性快閃記憶體之一磁區是否位於該寫入保護狀態。The method of claim 3, wherein the address instruction corresponds to a block of non-volatile flash memory, the setting command includes a plurality of guard bits, each of which displays one of the non-volatile flash memories Whether the zone is in the write protection state. 如請求項1所述之運作方法,其中具有該特定組合順序之該等更動指令包含複數抹除指令。The method of operation of claim 1, wherein the modifiers having the particular combination order comprise a plurality of erase instructions. 如請求項1所述之運作方法,其中該快閃記憶體資料變更指令為一快閃記憶體程式化指令。The method of claim 1, wherein the flash memory data change instruction is a flash memory programized instruction. 如請求項1所述之運作方法,其中該快閃記憶體資料變更指令為一快閃記憶體抹除指令。The method of claim 1, wherein the flash memory data change instruction is a flash memory erase command. 如請求項1所述之運作方法,其中該非揮發性快閃記憶體包含一程式碼區域以及一參數設定區域,其中該快閃記憶體資料變更指令係對該程式碼區域之內容進行變更。The method of claim 1, wherein the non-volatile flash memory comprises a code area and a parameter setting area, wherein the flash memory data change command changes the content of the code area. 如請求項1所述之運作方法,其中該狀態暫存器保護資訊為一三位元資訊,以顯示該非揮發性快閃記憶體位於該寫入保護狀態之該記憶體區塊/磁區。The method of claim 1, wherein the state register protection information is a three-bit information to display the memory block/magnetic area of the non-volatile flash memory in the write protection state. 如請求項1所述之運作方法,於發送該指令之步驟前,更包含:使一晶片致能訊號由一抑能狀態轉為一致能狀態。The method of claim 1, wherein before the step of sending the instruction, the method further comprises: changing a chip enable signal from an inhibited state to a consistent state. 如請求項1所述之運作方法,其中該指令係由一微控制單元發送。The method of operation of claim 1, wherein the instruction is sent by a micro control unit.
TW99110195A 2010-04-01 2010-04-01 Method for operating non-volatile flash memory with write protection mechanism TWI436367B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW99110195A TWI436367B (en) 2010-04-01 2010-04-01 Method for operating non-volatile flash memory with write protection mechanism

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW99110195A TWI436367B (en) 2010-04-01 2010-04-01 Method for operating non-volatile flash memory with write protection mechanism

Publications (2)

Publication Number Publication Date
TW201135740A TW201135740A (en) 2011-10-16
TWI436367B true TWI436367B (en) 2014-05-01

Family

ID=46752023

Family Applications (1)

Application Number Title Priority Date Filing Date
TW99110195A TWI436367B (en) 2010-04-01 2010-04-01 Method for operating non-volatile flash memory with write protection mechanism

Country Status (1)

Country Link
TW (1) TWI436367B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI768738B (en) 2021-03-02 2022-06-21 群聯電子股份有限公司 Memory control method, memory storage device and memory control circuit unit
CN112835536B (en) * 2021-03-10 2023-08-29 群联电子股份有限公司 Memory control method, memory storage device and memory control circuit unit

Also Published As

Publication number Publication date
TW201135740A (en) 2011-10-16

Similar Documents

Publication Publication Date Title
US9280460B2 (en) Data writing method, memory control circuit unit and memory storage apparatus
US9058296B2 (en) Data processing method, memory storage device and memory control circuit unit
JP4324810B2 (en) Protection method for microcomputers, electronic devices and flash memory
US20090089484A1 (en) Data protection method for power failure and controller using the same
US20150134887A1 (en) Data writing method, memory control circuit unit and memory storage apparatus
US7903474B2 (en) Redundant purge for flash storage device
JP2008198310A (en) Method for repairing bit error and information processing system
US9424177B2 (en) Clock switching method, memory controller and memory storage apparatus
WO2016180093A1 (en) Read/write control circuit and method for flash chip, and amoled application circuit
US9619380B2 (en) Data writing method, memory control circuit unit and memory storage apparatus
JP2006243780A (en) Memory controller, flash memory system and control method of flash memory
US20150278088A1 (en) Memory control apparatus, information processing apparatus and control method thereof, and storage medium
TWI486765B (en) Memory management method, memory controller and memory storage device using the same
US9971682B2 (en) Wear-leveling system and method for reducing stress on memory device using erase counters
CN104793891A (en) Data write-in method, memorizer control circuit unit and memorizer storage device
TWI644210B (en) Memory management method, memory control circuit unit and memory storage apparatus
TW201447578A (en) Data storage apparatus and management method thereof
JP2010086009A (en) Storage device and memory control method
TWI436367B (en) Method for operating non-volatile flash memory with write protection mechanism
JP2008225672A (en) Semiconductor memory device
WO2017047272A1 (en) Semiconductor storage device and data erasure method in semiconductor storage device
JP2009223435A (en) Data storage method and device, and program
US20110246704A1 (en) Method for operating non-volatile flash memory with write protection mechanism
CN107229413B (en) Memory management method, memory control circuit unit and memory storage device
TWI747270B (en) Method for performing configuration management, and associated data storage device and controller thereof