CN101174221A - Electronic system using flash memory to store boot code and boot method - Google Patents
Electronic system using flash memory to store boot code and boot method Download PDFInfo
- Publication number
- CN101174221A CN101174221A CNA2006101433208A CN200610143320A CN101174221A CN 101174221 A CN101174221 A CN 101174221A CN A2006101433208 A CNA2006101433208 A CN A2006101433208A CN 200610143320 A CN200610143320 A CN 200610143320A CN 101174221 A CN101174221 A CN 101174221A
- Authority
- CN
- China
- Prior art keywords
- boot
- electronic system
- flash memory
- code
- boot code
- Prior art date
- Legal status (The legal status 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 status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 23
- 230000004044 response Effects 0.000 claims abstract description 9
- 230000005055 memory storage Effects 0.000 description 7
- 230000008569 process Effects 0.000 description 7
- 230000009183 running Effects 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 238000001514 detection method Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000008676 import Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
Images
Landscapes
- Techniques For Improving Reliability Of Storages (AREA)
- Retry When Errors Occur (AREA)
Abstract
A method for starting up an electronic system by a processor according to a starting code in a NAND Flash memory comprises the following steps. First, a NAND flash memory is provided, which stores at least one or several complete boot codes. Then, the first boot code is copied to the addressed execution memory in response to the hardware reset signal. Then, the processor executes the boot code in the current address execution memory to boot the electronic system. Then, whether the electronic system is successfully started up is judged after delaying a certain period of time. Then, when the electronic system fails to start, the electronic system is reset, and the second start code is copied to the current address execution memory. Then, the processor executes the starting code in the current address execution memory to start the electronic system, if the starting is still failed, the previous operation is repeated until the starting is successful.
Description
Technical field
The present invention is relevant for a kind of electronic system, and particularly relevant for a kind of electronic system with NAND type flash memory (Flash) storage boot code.
Background technology
Traditional electronic system with NAND type flash memory storage boot code is stored a boot code in NAND type flash memory.When the electronic system desire is started shooting, the boot code in the NAND type flash memory is copied to the present location carry out (Execute In Place, XIP) storer, and the boot code that the processor of electronic system is carried out in the execute store of present location is started shooting electronic system.Yet, because NAND type flash memory easily after long repeated use, produces the bad problem of bit loss.So, when the corrupted of the part position of storage boot code, traditional electronic system with NAND type flash memory storage boot code can't be started shooting because of the boot code corrupted.
Summary of the invention
In view of this, purpose of the present invention is exactly that a kind of electronic system and starting-up method thereof with NAND type flash memory (Flash) storage boot code (Boot Code) is being provided.Electronic system of the present invention can be improved the shortcoming that traditional electronic system can't be started shooting because of NAND type flash memory corrupted easily effectively.
According to purpose of the present invention, a kind of electronic system with NAND type flash memory storage boot code is proposed, comprise: (Execute In Place, XIP) storer, processor, NAND type flash memory, NAND type flash memory controller, boot program controller (Sequencer) and timer are carried out in the present location.Processor and present location execute store couple, to carry out the program code in the execute store of present location.NAND type flash memory comprises the first boot code store storage piece and the second boot code store storage piece, and it is respectively in order to storing first boot code and second boot code, and first and second boot code is for equating, and all can be used to do complete boot program.NAND type flash memory controller is in order to the read operation of control NAND type flash memory, and in order to the program code in the NAND type flash memory is copied to the present location execute store.The boot program controller is controlled NAND type flash memory controller in response to the hardware reset signal and is duplicated first boot code to the present location execute store.By this, processor is carried out first boot code in the execute store of present location, and electronic system is started shooting.Timer response postpones one section special time in the hardware reset signal, and detects the success of whether starting shooting of this electronic system after postponing this special time, judges whether to restart the boot program controller then.Wherein, when the electronic system boot failure, boot program controller replacement electronic system and timer, and control NAND type flash memory controller duplicates second boot code to the present location execute store.Processor is carried out second boot code in the execute store of present location, and electronic system is started shooting.
According to another object of the present invention, a kind of starting-up method of electronic system is proposed, processor can be started shooting electronic system according to the boot code in the NAND type flash memory.The starting-up method of electronic system comprises following step.At first, provide NAND type flash memory, wherein have first boot code and second boot code.Then, duplicate first boot code to the present location execute store in response to the hardware reset signal.Then, processor is carried out first boot code in the execute store of present location, and electronic system is started shooting.Then, postpone to judge behind one section special time the electronic system success of whether starting shooting.Then, when the electronic system boot failure, the replacement electronic system, and duplicate second boot code to the present location execute store.Afterwards, processor is carried out second boot code in the execute store of present location, and electronic system is started shooting.
For above-mentioned purpose of the present invention, feature and advantage can be become apparent, a preferred embodiment cited below particularly, and conjunction with figs. are described in detail as follows:
Description of drawings
Fig. 1 represents the calcspar with the electronic system of NAND type flash memory storage boot code according to a preferred embodiment of the present invention.
The process flow diagram of the starting-up method of Fig. 2 presentation graphs 1 electronic system 100.
The main element symbol description
100: electronic system
102:NAND type flash memory
1021-102n, 1161-116m: boot code store storage piece
104: the present location execute store
106:NAND type flash memory controller
108: the boot program controller
110: timer
112: processor
114: open state flag unit
Ad1-Adn: address signal
HR: hardware reset signal
HD: halt signal
Flag: flag signals
202-212: operation steps
Embodiment
Electronic system with NAND type flash memory (Flash) storage boot code (Boot Code) of the present invention is stored at least two group boot code in NAND type flash memory.Electronic system with NAND type flash memory storage boot code of the present invention also has a boot program controller, and during with the first boot code corrupted in two groups of boot code, the control electronic system is started shooting according to another group boot code.
Please refer to Fig. 1, its expression is according to the calcspar with the electronic system of NAND type flash memory storage boot code of a preferred embodiment of the present invention.Electronic system 100 comprises NAND type flash memory 102, present location execution (Execute In Place, XIP) storer 104, NAND type flash memory controller 106, boot program controller 108, timer 110 and processor 112.
NAND type flash memory 102 comprises boot code store storage piece 1021-102n, and it stores the 1st boot code (not shown), the 2nd boot code (not shown) respectively ... and n boot code (not shown).Wherein, n is the natural number greater than 1, and the 1st to the n boot code boot code for equating for example, and it is the boot code that can be used to the complete boot program.NAND type flash memory controller 106 is in order to the read operation of control NAND type flash memory 102, and in order to the program code in the NAND type flash memory 102 is copied to present location execute store 104.Processor 112 couples with present location execute store 104, to carry out the program code in the present location execute store 104.
When processor 112 during according to the 1st boot code boot failure, boot program controller 108 is carried out and is restarted flow process, with replacement electronic system 100 and timer 110, and control NAND type flash memory controller 106 duplicates the 2nd boot code in the boot code store storage piece 1022 to present location execute store 104, and the 2nd boot code that processor 112 is carried out in the present location execute stores 104 comes electronic system 100 is started shooting.And timer 110 also self reset moved and postponed to start again behind this special time the success of whether starting shooting of boot program controller 108 detected electrons systems 100.
When processor 112 according to the 2nd boot code still during boot failure, boot program controller 108 is carried out again and is restarted flow process, with replacement electronic system 100 and timer 110, and control NAND type flash memory controller 106 duplicates the 3rd boot code in the boot code store storage piece 1023 to present location execute store 104, and the 3rd boot code that processor 112 is carried out in the present location execute stores 104 comes this electronic system is started shooting.And timer 110 also self reset moved and postponed to start again behind this special time the success of whether starting shooting of boot program controller 108 detected electrons systems 100.Boot program controller 108 repeats the above-mentioned flow process that restarts, and detects up to boot program controller 108 and stops its operation when processor 112 is started shooting successfully.
So, when the signal level of boot program controller 108 detection flag signals Flag is original levels, expression processor 112 can't be finished the start operation of electronic system 100 according to the boot code in the present location execute store 104, and then the signal level of flag signals Flag can't be set at termination level, that is electronic system 100 boot failures.At this moment, boot program controller 108 is carried out and is restarted flow process, and processor 112 is started shooting to electronic system 100 according to the boot code in the next boot code store storage piece.And when the signal level of boot program controller 108 detection flag signals Flag is termination level, expression processor 112 is finished the start operation of electronic system 100, and the signal level of flag signals Flag is set at termination level, that is electronic system 100 is started shooting successfully.
The NAND type flash memory 102 of present embodiment also comprises program code store storage piece 1161-116m, and it is respectively in order to store a plurality of application codes, and wherein, m is the natural number greater than 1.When boot program controller 108 detects electronic system 100 and starts shooting successfully, control NAND type flash memory controller 106 copies to the application code in the program code store storage piece 1161-116m program code store storage piece wherein in the present location execute store 104, and processor 112 is carried out other application operatings of electronic system 100 according to the application code in the present location execute store 104.
In the present embodiment, the memory capacity size of the boot code store storage piece 1021-102n of NAND type flash memory 102 is for example for equating, boot code store storage piece 1021-102n for example is adjacent boot code store storage piece, and the start address of storage block boot code store storage piece 1021 for example is zero.Boot program controller 108 is OPADD signal Ad1-Adn to NAND type flash memory controller 106 for example, read 1-n boot code among the boot code store storage piece 1021-102n with control NAND type flash memory controller 106, and control NAND type flash memory controller 106 copies to 1-n boot code in the present location execute store 104.Address signal Ad1-Adn is for example corresponding with the start address of boot code store storage piece 1021-102n respectively, and boot program controller 108 for example obtains address signal Ad2-Adn with the method for the address signal difference that adds up according to address signal Ad1.Wherein, this address signal difference for example is the difference of address signal Ad2 and Ad1.
The boot program controller 108 of present embodiment also be used to NAND type flash memory controller 106 duplicate 1-n boot code wherein one during to present location execute store 104, output halt signal HD is to processor 112, to suspend processor 112 operations in this boot code reproduction process.And the boot program controller 108 of present embodiment also in NAND type flash memory controller 106 duplicate 1-n boot code wherein one remove halt signal HD after finishing to the operation of present location execute store 104, but make processor 112 normal runnings, to carry out 1-n boot code coming wherein in the present location execute store 104 to electronic system 100 starts.
Please refer to Fig. 2, the process flow diagram of the starting-up method of its presentation graphs 1 electronic system 100.The starting-up method of present embodiment comprises following step:
At first,, provide NAND type flash memory 102, have boot code store storage piece 1021-102n to store 1-n boot code respectively as step 202.
Then,, duplicate the 1st boot code to present location execute store 104, and suspend the running of processor 112 in response to hardware reset signal HR as step 204.
Then, as step 206, the 1st boot code that processor 112 is carried out in the present location execute store 104 is come electronic system 100 starts.
Then,, postpone to judge behind one section special time electronic system 100 success of whether starting shooting as step 208, if not, execution in step 210.
Then, as step 210, replacement electronic system 210 to be duplicating the 2nd boot code to present location execute store 104, and suspends the running of processor 112.
Afterwards, as step 212, the 2nd boot code that processor 212 is carried out in the present location execute store 104 is come electronic system 100 starts.Then, if electronic system 100 boot failure still, the step of repeating step 208-212 makes processor 112 carry out 3-n boot code to come to electronic system 100 starts, till electronic system 100 is started shooting successfully in regular turn.
Though present embodiment is only to export flag signals Flag to boot program controller 108, so that whether its detected electrons system 100 starts shooting successfully explain for example, yet, flag signals Flag is not limited to directly import boot program controller 108, and also can import timer 110, stop the timing operation of timer 110 when being termination level with signal level in flag signals Flag.Whether boot program controller 108 stops judging electronic system 100 success of whether starting shooting with the timing of timer 110 operation.If the timing of timer 110 operation is stopped by flag signals Flag, expression electronic system 100 is started shooting successfully; If the timing of timer 110 operation is not stopped by flag signals Flag, expression electronic system boot failure.
The electronic system of present embodiment and starting-up method are stored many parts of boot code in NAND type flash memory, and it is next when the boot code corrupted that the boot program controller is set, and start shooting according to following a boot code.So, the electronic system of present embodiment and starting-up method can improve effectively in the NAND type flash memory of conditional electronic system and only have a boot code, and easily when the boot code store storage piece of storage boot code produces corrupted, the problem that can't start shooting.In addition, when the boot code number of storing in the NAND type flash memory of the electronic system of present embodiment was more than enough, the electronic system of present embodiment also had the capable of starting up advantage of assurance.
In sum; though the present invention with preferred embodiment openly as above; right its is not in order to limit the present invention; any those skilled in the art; under the situation that does not break away from the spirit and scope of the present invention; can change and modification, so protection scope of the present invention is as the criterion with the claim institute restricted portion that is proposed.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNA2006101433208A CN101174221A (en) | 2006-11-03 | 2006-11-03 | Electronic system using flash memory to store boot code and boot method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNA2006101433208A CN101174221A (en) | 2006-11-03 | 2006-11-03 | Electronic system using flash memory to store boot code and boot method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN101174221A true CN101174221A (en) | 2008-05-07 |
Family
ID=39422746
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CNA2006101433208A Pending CN101174221A (en) | 2006-11-03 | 2006-11-03 | Electronic system using flash memory to store boot code and boot method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101174221A (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101930374A (en) * | 2009-06-26 | 2010-12-29 | 和硕联合科技股份有限公司 | Peripheral control module, computer system and operation method thereof |
CN101493776B (en) * | 2009-02-18 | 2012-08-22 | 宇龙计算机通信科技(深圳)有限公司 | Mobile terminal and power-on method and system thereof |
CN102722423A (en) * | 2011-03-29 | 2012-10-10 | 比亚迪股份有限公司 | Portable terminal and self-restoration method thereof |
CN102736666A (en) * | 2011-04-12 | 2012-10-17 | 群联电子股份有限公司 | Reference frequency setting method, memory controller and flash memory storage device |
CN104268026A (en) * | 2014-09-15 | 2015-01-07 | 曙光信息产业(北京)有限公司 | Monitoring and management method and device for embedded system |
US9003100B2 (en) | 2011-03-31 | 2015-04-07 | Phison Electronics Corp. | Reference frequency setting method, memory controller, and flash memory storage apparatus |
CN113495848A (en) * | 2020-04-08 | 2021-10-12 | 慧荣科技股份有限公司 | Flash memory device, card opening method of flash memory device and computer readable storage medium |
-
2006
- 2006-11-03 CN CNA2006101433208A patent/CN101174221A/en active Pending
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101493776B (en) * | 2009-02-18 | 2012-08-22 | 宇龙计算机通信科技(深圳)有限公司 | Mobile terminal and power-on method and system thereof |
CN101930374A (en) * | 2009-06-26 | 2010-12-29 | 和硕联合科技股份有限公司 | Peripheral control module, computer system and operation method thereof |
CN101930374B (en) * | 2009-06-26 | 2013-08-21 | 和硕联合科技股份有限公司 | Peripheral control module, computer system and operation method thereof |
CN102722423A (en) * | 2011-03-29 | 2012-10-10 | 比亚迪股份有限公司 | Portable terminal and self-restoration method thereof |
US9003100B2 (en) | 2011-03-31 | 2015-04-07 | Phison Electronics Corp. | Reference frequency setting method, memory controller, and flash memory storage apparatus |
CN102736666A (en) * | 2011-04-12 | 2012-10-17 | 群联电子股份有限公司 | Reference frequency setting method, memory controller and flash memory storage device |
CN102736666B (en) * | 2011-04-12 | 2016-03-30 | 群联电子股份有限公司 | Reference frequency setting method, memory controller and flash storage device |
CN104268026A (en) * | 2014-09-15 | 2015-01-07 | 曙光信息产业(北京)有限公司 | Monitoring and management method and device for embedded system |
CN104268026B (en) * | 2014-09-15 | 2018-06-26 | 曙光信息产业(北京)有限公司 | The method for managing and monitoring and device of embedded system |
CN113495848A (en) * | 2020-04-08 | 2021-10-12 | 慧荣科技股份有限公司 | Flash memory device, card opening method of flash memory device and computer readable storage medium |
CN113495848B (en) * | 2020-04-08 | 2024-07-30 | 慧荣科技股份有限公司 | Flash memory device, card opening method of flash memory device and computer readable storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7870378B2 (en) | Electronic system with NAND flash memory storing boot code and highly reliable boot up method | |
JP5575338B2 (en) | Information processing apparatus, information processing method, and computer program | |
TWI501253B (en) | Handling errors from non-volatile memory during device startup | |
TWI703498B (en) | Memory device and associated boot code loading method of electronic device | |
TWI460657B (en) | Method for updating basic input/output system and method for repairing thereof | |
JP5450336B2 (en) | Saving and restoring register state | |
CN101174221A (en) | Electronic system using flash memory to store boot code and boot method | |
TWI515660B (en) | Firmware variable update method | |
WO2012071945A1 (en) | Method and device for backing up and upgrading bootstrap | |
JP2006526831A (en) | Boot from non-volatile memory | |
TW200847021A (en) | Automatic backup, restore and update BIOS computer system | |
WO2007107060A1 (en) | A method and related device for booting from a non-xip memory | |
CN102135927A (en) | Method and device for system booting based on NAND FLASH | |
CN105653405B (en) | A kind of fault handling method and system of Generic Bootstrap | |
TWI441081B (en) | Method for flashing firmware and booting method and electronic apparatus using the method thereof | |
TWI363297B (en) | Multi-mode memory controller for upgrading firmware in phases and related apparatus,removable memory card,method and computer readable medium | |
CN106775674B (en) | Equipment based on universal boot loader and starting method thereof | |
CN101667128A (en) | Method for Updating and Repairing Basic Input Output System | |
CN110109682A (en) | Electronic Accounting Machine Unit and method | |
CN105138430A (en) | Embedded operating system backup and restoration method and device | |
CN105786545B (en) | Breakpoint recovery method and system based on heterogeneous hybrid memory | |
TWI486874B (en) | Electronic apparatus and booting method | |
JP2007323631A (en) | Cpu runaway determination circuit | |
CN116737279B (en) | Method and device for program running, processor, electronic device and medium | |
CN1239986C (en) | dual basic input output system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C02 | Deemed withdrawal of patent application after publication (patent law 2001) | ||
WD01 | Invention patent application deemed withdrawn after publication |
Open date: 20080507 |