Background technology
Flash memory is present very general a kind of data storage medium, usually use as universal serial bus (Universal Serial Bus, USB) interface or other common interface and other electronic installation (as personal computer) are linked up, common flash memory comprises carry-on dish, the SD card, CompactFlash card and SmartMedia card or the like, because flash memory is preserved the reliability of data, security and convenience, at present more and more extensive in the application of electronic product, similarly be mobile phone, digital camera, digital camera and MP3 walkman are all often with the medium of flash memory as data storing.
All contain mostly in the flash memory device on the existing practice microprocessor unit (MicroControl Unit, MCU), and the program of its execution be stored in the ROM (read-only memory) (Read-OnlyMemory, ROM).This practice is fairly simple, but has some shortcomings.At first, because flash memory products is constantly weeded out the old and bring forth the new,, just need continuous ROMPaq to support new flash memory products at the difference of different vendor's different model; Secondly, in order to satisfy client's demand, need constantly to add new function, also need frequent update routine, the existing practice is that program is left in the ROM (read-only memory), and each the renewal just need remodify hardware, and need to test again the time that often needs the several months could volume production, constantly cause the increase of production cost, also cause waste of time.
For satisfying above-mentioned reducing cost and the demand of convenient ROMPaq of proposing.The inventor is based on going in for the study for many years and many practical experience, inquires into special topic through research and design in many ways, satisfies in the present invention to propose a kind of flash memory device and update system thereof, method with as aforementioned expectation one implementation and foundation.
Summary of the invention
Because above-mentioned problem, purpose of the present invention is for providing a kind of flash memory device and update system thereof, renewal and program frisking method, particularly a kind of program is stored in the flashing storage unit, with the flash memory device of convenient refresh routine.
Therefore, for achieving the above object, according to flash memory device of the present invention, it comprises a ROM unit, a flashing storage unit, a control module and a random access memory unit, ROM unit is in order to store one first program code, and flashing storage unit comprises one second program code and a numerical data.And control module is coupled to this ROM unit and this flashing storage unit, is used for controlling the operation of this flash memory device according to this first program code and this second program code.Described random access memory unit is coupled between this flashing storage unit and this control module, be used for keeping in the some of this second program code, wherein, described random access memory unit is divided into a plurality of memory block to store the different running program of second program code.
As mentioned above, because of complying with flash memory device of the present invention and update method and program frisking method, it is divided into two parts with the program of carrying out, some leaves in the ROM unit, and what dispatch from the factory afterwards just need not revise, and some then leaves in the flashing storage unit in addition, can upgrade at any time, this practice can put before not influencing properties of product, effectively promoted the convenience of program updates, and also can shorten the time and the cost of system upgrade.
Further understand and understanding for making technical characterictic of the present invention and the effect that realized had, hereinafter in conjunction with the accompanying drawings to the preferred embodiment explanation as after.
Description of drawings
Fig. 1 shows the program code storage position configuration figure of the flash memory device of one embodiment of the invention;
Fig. 2 shows the synoptic diagram according to the flash memory device of one embodiment of the invention;
Fig. 3 shows the process flow diagram according to the program frisking method of the flash memory device of one embodiment of the invention;
The internal random that Fig. 4 shows one embodiment of the invention stores the synoptic diagram of the interior storage space configuration of internal storage location;
Fig. 5 shows the synoptic diagram according to the update system of the flash memory device of one embodiment of the invention; And
Fig. 6 shows the flow chart of steps of the update method of flash memory device of the present invention.
The reference numeral explanation
10: flash memory device;
11: ROM unit;
111: refresh routine;
112: searching procedure;
12: flashing storage unit;
121: running program;
122: first kind running program;
123: the second generic operation programs;
124: the three generic operation programs;
125: the four generic operation programs;
13: microprocessing unit;
14: cache element;
15: the internal random access memory cell;
151: the first storage blocks;
152: the second storage blocks;
153: the three storage blocks;
16: the flash memory control module;
S31~S36: steps flow chart;
50: main frame;
S61~S66: steps flow chart.
Embodiment
Hereinafter with reference to relevant drawings, flash memory device and update system, renewal and program frisking method according to preferred embodiment of the present invention are described, wherein identical assembly will be illustrated with identical reference marks.Please note, the present invention for convenience of description, in following embodiment mentioned flash memory device be the most general with present use, with universal serial bus (universal serial bus, USB) flash disc that is connected with computer system as transmission interface (Flash disk) is an example, but those skilled in the art should understand, the present invention is not as limit, and other is any with the device of flash memory as storing mode, all has it to be suitable for.
See also Fig. 1, Fig. 1 shows the program code storage position configuration figure according to theflash memory device 10 of one embodiment of the invention, shown person is in order to controlflash memory device 10, the position configuration of program code when storing that its microprocessor unit is performed in Fig. 1.The storage area of thisflash memory device 10 mainly comprises a ROM unit 11 and a flashing storage unit 12, ROM unit 11 is in order to store the base program in the said procedure code, for example a searching procedure 112 and a refresh routine 111, it also can include the Basic Authentication program of universal serial bus.Storage area in the flashing storage unit 12 then is divided into a block and a program area block, this block is in order to the main storage area asflash memory device 10, store general data, this program area block is then in order to storeother running program 121 in the said procedure code, wherein, runningprogram 121 comprises in order to operate the various program codes of thisflash memory device 10, searching procedure 112 comprises the program code in order to the searching procedure block, and 111 of refresh routines comprise in order to upgrade the program code of runningprogram 121.
See also Fig. 2, Fig. 2 shows the synoptic diagram according to theflash memory device 10 of one embodiment of the invention, its comprise a ROM unit 11, a flashing storage unit 12, amicroprocessing unit 13, a cache element (cache) 14, an internal random access memory cell (internal randomaccess memory, IRAM) 15, an and flash memory control module 16.ROM unit 11 is in order to store base programs such as aforesaid searching procedure 112 and refresh routine 111, flashing storage unit 12 is in order to storeother running program 121 and general data, flashmemory control module 16 is in order to the accessing operation of control to flashing storage unit 12,microprocessing unit 13 is when receiving an external command, from ROM unit 11, cache element 14, internal randomaccess memory cell 15, or flashing storage unit 12 is searched and program code of corresponding this outside instruction of execution, to carry out the operation offlash memory device 10.
In order in the middle of the process of searching execution following formula program code, to reduce as far as possible flashing storage unit 12 is carried out accessing operation, with shorten overall operation time of palpus, the buffering the whenflash memory device 10 of present embodiment utilizes cache element 14 and internal randomaccess memory cell 15 as program code read.Wherein, the program code thatmicroprocessor unit 13 is desired to take out in flashing storage unit 12 can take out via cache element 14, therefore can remain with the program code of before being kept in the cache element 14, then ifmicroprocessor unit 13 desires to take out the program code that had before read again in flashing storage unit 12, it can directly read this program code in cache element 14, and need not expend the time of access flash memory unit 12 once more.Can be as for 15 of internal random access memory cells according to information such as the manufacturer of flashing storage unit 12 and models, in flashing storage unit 12, read and program code that temporary expection can often be used in advance, so then whenmicroprocessor unit 13 desires are taken out these common programs codes, can directly in cache element 14, this program code be read, and need not expend time of access internal randomaccess memory cell 15 once more.
See also Fig. 3, show the process flow diagram according to the program frisking method of the flash memory device of one embodiment of the invention, its step is as the back:
Step S31: receive an external command;
Step S32: search the base program whether ROM unit has corresponding this outside instruction, if, then finish to search, if not, execution in step S33 then;
Step S33: search internal random and store the running program whether internal storage location has corresponding this outside instruction, if, then finish to search, if not, execution in step S34 then;
Step S34: search the running program whether cache element has corresponding this outside instruction, if, then finish to search, if not, execution in step S35 then; And
Step S35: search flashing storage unit, find out the running program of corresponding this outside instruction.
Step S36: carry out this program code that is searched.
See also Fig. 4, Fig. 4 shows according to one embodiment of the invention, internal random stores the synoptic diagram of the interior storage space configuration ofinternal storage location 15, wherein, store the size ofinternal storage location 15 and promote the readwrite performance that internal random storesinternal storage location 15 as far as possible in order to reduce internal random as much as possible, so therunning program 121 that will be stored in the flashing storage unit 12 is divided into four classes, and the different blocks that also it is placed in flashing storage unit 12 stores: first kind running program 122 all need be used for all operations of the flashing storage unit of all kinds, and reads and write shared running program; The second generic operation program 123 reads and writes shared running program for the flashing storage unit of a certain particular types; Employed running program when the 3rd generic operation program 124 is the flashing storage unit read operation of a certain particular types; Employed running program when the 4th generic operation program 125 is the flashing storage unit write operation of a certain particular types.Accordingly, also internal random is storedinternal storage location 15 and be divided into three storage blocks, wherein, first stores block 151 deposits first kind running program 122, second stores block 152 deposits the second generic operation program, 123, the three storage blocks, 153 storage the 3rd generic operation program 124 or the 4th generic operation programs 125.
See also Fig. 5, Fig. 5 shows the synoptic diagram according to the update system of the flash memory device of one embodiment of the invention, and it comprises aflash memory device 10 and a main frame 50 (a for example personal computer).Flashmemory device 10 comprisesmicroprocessing unit 13, flashing storage unit 12 and ROM unit 11, and flashing storage unit 12 is in order to store arunning program 121, and ROM unit 11 is in order to store a refresh routine 111.Main frame 50 loads the driver that upgrades usefulness, in order to transmit refresh routine order and new running program to microprocessingunit 13, andmicroprocessing unit 13 is according to refresh routine 111, replace runningprogram 121 originally to write this new running program, wherein, above-mentioned main frame 50 also comprises the manufacturer's parameter that transmits a flashing storage unit 12, a model parameter and an operating parameter are to microprocessingunit 13, makemicroprocessing unit 13 according to manufacturer's parameter, model parameter and operating parameter are with operation flashing storage unit 12, main frame 50 andmicroprocessing unit 13 after new running program writes flashing storage unit 12, the correctness of this running program of verification.
See also Fig. 6, Fig. 6 shows the flow chart of steps of the update method of flash memory device of the present invention, and its step is as back:
Step S61: load the driver that upgrades usefulness;
Step S62: the manufacturer and the model number (ID) that obtain flash memory;
Step S63:, the model and the operating parameter of correspondence is sent to flash memory device according to above-mentioned ID;
Step S64: transmit the refresh routine order to flash memory device; And
Step S65: read corresponding refresh routine according to mentioned order, so that the running program in the flashing storage unit is upgraded;
Step S66: result's correctness is upgraded in checking.
The above only is an illustrative, but not is restricted.Anyly do not break away from spirit of the present invention and category, and, all should be contained in the application's the claim its equivalent modifications of carrying out or change.