Reprogramming electronic apparatus

Information

  • Patent Application
  • 20030097522
  • Publication Number
    20030097522
  • Date Filed
    September 20, 2002
    22 years ago
  • Date Published
    May 22, 2003
    21 years ago
Abstract
An electronic apparatus programmed with a first code stored in a non-volatile memory during normal operation is reprogrammed by writing into a temporary memory a second code having a portion for reprogramming the non-volatile memory and an instruction portion. At least the reprogramming portion of the second code is executed from the temporary memory to cause the second code to be programmed into the non-volatile memory to replace the first set of code in the non-volatile memory.
Description


FIELD OF INVENTION

[0001] This invention relates to a method of reprogramming electronic apparatus together with related apparatus.



BACKGROUND ART

[0002] It is well known for electronic apparatus, in particular but not exclusively, computer peripherals to contain processing circuitry that operates according to code held within a memory. Examples of such computer peripherals include tape drives, CD ROMs, DVD ROMs/RAMs, MODEMs, etc. So that the code is not lost when power is removed from the apparatus the code needs to be held in some form of non-volatile memory. Generally, the non-volatile memory used is some form of flash memory, in order that the apparatus can be reprogrammed to have new code stored therein. Such reprogramming is performed if errors are found within the previous code, newer faster versions of the code become available, etc.


[0003] A prior art method of reprogramming an electronic apparatus is shown in FIG. 1. The electronic apparatus comprises a Random Access Memory 10 and a flash (i.e., non-volatile) memory 2 from which a first code 4 is executed to control the functionality of the electronic apparatus. As such, a program counter 8 points to a valid address within the flash memory 2. The first code 4 comprises a reprogramming portion 6. During normal operation the flash memory 2 is maintained in a read state so that its contents can not be altered.


[0004] For a variety of reasons, it be necessary to replace the first code within the flash memory 2, in which case the reprogramming portion 6 of the first code 4 is copied, as indicated by arrow 12, to the RAM 10. Execution then switches from the first code 4 held in the flash memory 2 to the reprogramming portion 6 held in the RAM 10, and thus the program counter 14 now points at an address within the RAM 10. Further, once the program counter 14 points at an address in the RAM 10 the flash memory is altered to a write state.


[0005] Next, the reprogramming portion 6 causes a second code 16, which is generally different from the first code, to be programmed into the flash memory. Once the second code has successfully been written into the flash memory 2 the flash memory is returned to the read state and the program counter 8 is once again made to point at an address in the flash memory 2.


[0006] Thus, this prior art method of reprogramming the non-volatile memory 2 simply replaces the first code within the non-volatile memory with the new, second, code. A problem with this approach is that if the second code does not function the apparatus may no longer function as desired, due to problems with the second code. These problems may not be manifested until it is time to reprogram the non-volatile memory if the problems with the second code occur in the reprogramming portion of the second code.


[0007] An aim of the present invention is to reduce, or solve, the problems of the prior art.



SUMMARY OF THE INVENTION

[0008] According to a first aspect of the invention there is provided a method of reprogramming electronic apparatus programmed with a first code held in a non-volatile memory during normal operation of said apparatus comprising:


[0009] i. copying, into a temporary memory, a second code, comprising a reprogramming portion arranged to reprogram said non-volatile memory, and an instruction portion, into a temporary memory


[0010] ii. executing at least said reprogramming portion of said second code from said temporary memory in order to cause said second code to be programmed into said non-volatile memory replacing said first set of code in said non-volatile memory.


[0011] An advantage of this method is that it ensures that the portion of the second code used to program the second code into the non-volatile memory functions correctly. If the portion of the second code does not function, then the non-volatile memory will not be reprogrammed, and thus, the first code residing in the non-volatile memory will not be lost. Since the first code has not been lost, the apparatus will continue to function.


[0012] The non-volatile memory is preferably flash memory, but could be any other form of non-volatile storage. For example the non-volatile memory may be any one or more of the following: EPROM, E2PROM, a disk drive, battery backed RAM, FPGA, or the like.


[0013] In one embodiment the method comprises reprogramming said non-volatile memory with said reprogramming portion in addition to said instruction portion. An advantage of this arrangement is that said reprogramming portion can be reused at a later time if it desired to reprogram said non-volatile memory once again. This advantage is realized if contents of said temporary memory are lost either through loss of power thereto, or by being refreshed to hold other code.


[0014] In another embodiment the method comprises reprogramming said non-volatile memory with said instruction portion of said second code, and not said reprogramming portion. An advantage of this method is that the storage capacity of the non-volatile memory can be lower, and that consequently the cost of the apparatus can be reduced. Alternatively, the size of the code that can be fitted into non-volatile memory can be increased. It will be appreciated that many forms of code space reduction exist, and this method may be used in addition to many, or all, of these other forms reduction, and provides a further optimisation.


[0015] However, it will appreciated that once the contents of the temporary memory have been refreshed that the reprogramming portion might be lost. However, it may be that every second code that is copied into said temporary memory comprises a reprogramming portion, and in such circumstances it does not matter if the reprogramming portion is lost if the temporary memory is refreshed.


[0016] Preferably, the method arranges for the reprogramming portion to occur after the instruction portion within the second code. An advantage of such an arrangement is that it makes copying of the code from the temporary memory to the flash memory easier; it is simply necessary to start copying at the beginning of the instruction portion and to finish copying before the start of the reprogramming portion.


[0017] Conveniently, the method comprises using a Random Access Memory (RAM) as the temporary memory. Such an arrangement is convenient because RAM is generally provided in the architecture of electronic apparatus to which this method will be applied.


[0018] However, in other embodiments the method comprises using any other form of memory for the temporary memory. Indeed, the temporary memory can also comprise a non-volatile memory, or any of the types of memory mentioned above in relation to the non-volatile memory.


[0019] The method may be suitable for electronic apparatus that is connected to an external device, preferably containing a processor. Examples of possible external devices include any one or more of the following: a television, a Hi/Fi system or component, a satellite/cable television decoder, or the like. The skilled person will appreciate that these are merely examples and that there may be other external devices to which the electronic apparatus may be connected.


[0020] Conveniently the method can be used for electronic apparatus that is connected to an external device comprising a computer. The computer can be any form of computer such as a PC, an Apple™, etc.


[0021] The term “connected” is intended to relate to a data connection between the electronic apparatus, and the external device, and does not necessarily refer to a physical connection. The skilled person will appreciate that there are various wireless protocols that may be used to connect two devices. Examples of such links include any one or more of the following: an IRDA link, a Bluetooth link, a WIFI link, etc.


[0022] Conveniently, the method comprises copying the second code into the temporary memory from a computer to which the electronic apparatus is attached.


[0023] The method is suitable for one or more of the following apparatus: a tape drives, CD ROMs, DVD ROMs/RAMs, MODEMs, video cards, sound cards, motherboards, hard disk drives, digital cameras, mobile phones, network cards, mp3 players, t.v. decoders, etc. The skilled person will appreciate that these devices are mentioned by way of example only and many other electronic apparatus is suitable.


[0024] The electronic apparatus generally is preferably controlled by the code running from the non-volatile memory, and as such a program counter of a processor of the electronic apparatus generally points at an address in the non-volatile memory. The method may comprise switching execution from the non-volatile memory to the temporary memory before the second code is programmed into said non-volatile memory (and thus the program counter is switched to an address in the temporary memory).


[0025] Once execution has been switched to the temporary memory the non-volatile memory may be erased. Alternatively, the first code contained in the first code within the non-volatile memory is overwritten by the second code.


[0026] Once the second code has been programmed into the non-volatile memory, the program counter may be pointed at a predetermined address in the non-volatile memory. The predetermined address is preferably the start address of the second code. Such an arrangement conveniently causes the second code to start executing.


[0027] In one embodiment, before step ii. of the method is performed the method comprises checking to determine if the second code is suitable for programming the non-volatile memory. Such an arrangement has the advantage that it ensures the second code is suitable for reprogramming the non-volatile memory before reprogramming of the non-volatile memory starts. If reprogramming were to commence before such a check were made, the first code may be corrupted before it was discovered that the second code was not suitable.


[0028] If the method determines that the second code is not suitable for reprogramming the non-volatile memory, the method continues to use-the first code.


[0029] The method may comprise ascertaining the identity of the components within the electronic apparatus by interrogating them. It will be appreciated that generally integrated circuits contain a register, memory location, or the like that contains the identity of the register memory location, etc., and that it is therefore possible to ascertain the identity by interrogating this register, memory location, etc.


[0030] Preferably, the method comprises comparing the identity obtained by interrogating the components with a list of suitable hardware contained within a portion of the second code. The list of suitable hardware may be held regarding the compatibility of the instruction portion and/or the reprogramming portion. An advantage of such a comparison step is that it enables a determination to be made as to whether, or not, the second code is suitable before reprogramming of the nonvolatile memory is attempted.


[0031] The method may comprise arranging the reprogramming portion such that it contains the necessary code to reprogram a plurality of hardware types. An advantage of such a method is that it is possible to download a single second code to reprogram a variety of different electronic apparatus.


[0032] According to a second aspect of the invention, a computer readable medium stores instructions for causing a processing unit to execute the method of the first aspect of the invention.


[0033] The computer readable medium, although not limited to, can be any one of the following: a floppy disk, a CDROM, a DVD ROM/RAM, a ZIPTN disk, a magneto optical disc, a hard drive, a transmitted signal (including an internet download, file transfer, etc.).


[0034] According to a third aspect of the invention, an electronic apparatus comprises (1) a non-volatile memory generally holding a first code and capable of being reprogrammed, (2) a temporary memory arranged to hold code temporarily, (3) a processor arranged to execute instructions held in either the non-volatile memory, or the temporary memory, and (4) a transmitter/receiver arranged to receive data from a source external of the apparatus. The processor is arranged to (1) cause a second code, comprising at least an instruction and a reprogramming portion, to be downloaded into the temporary memory via the transmitter/receiver, (2) store said second code in said temporary memory, and (3) execute at least said reprogramming portion of said second code residing in said temporary memory to reprogram said flash memory with said second code.


[0035] An advantage of such an apparatus is that it can help to ensure that the portion of the second code that is arranged to cause the processor to reprogram the non-volatile memory functions correctly, before the non-volatile memory is reprogrammed. If the non-volatile memory is reprogrammed before the correct functionality of the second code is ascertained the first code is generally lost, meaning that the instructions then provided by the code residing in the non-volatile memory no longer cause the apparatus to function correctly.


[0036] The non-volatile memory is preferably flash memory, but could be any other form of non-volatile storage. For example the non-volatile memory might be any one or more of the following: EPROM, E2PROM, a disk drive, FPGA, or the like.


[0037] The temporary memory is conveniently RAM, but might be any other suitable form of memory. Indeed, the temporary memory may itself be a non-volatile memory as described above.


[0038] Examples of the apparatus include any one or more or the following: tape drives, CD ROM drives, DVD ROMs/RAMs drives, MODEMs, video cards, sound cards, motherboards, hard disk drives, digital cameras, mobile phones, network cards, mp3 players, t.v. decoders, etc. The skilled person will appreciate that these devices are provided by way of example only and many other electronic apparatus may be suitable.


[0039] In one embodiment the processor is arranged to obtain the second code from a computer readable medium readable by the apparatus. For example, if the apparatus is a tape drive it is preferably arranged to obtain the second code from a tape inserted into the drive. In a further example, if the apparatus is a CD-ROM drive it is preferably arranged to obtain the second code from a CD-ROM inserted into the drive.


[0040] The transmitter/receiver is usually arranged to be connected to a network, such as a Local Area Network (LAN), or the Internet. An advantage of such an arrangement is that the second code is readily obtainable.


[0041] The transmitter/receiver is usually arranged to be connected to an external device, to transmit to and/or receive said second code from said external device.


[0042] Conveniently, the non-volatile memory is capable of holding both the reprogramming and the instruction portions of the second code. Alternatively, or additionally, the non-volatile memory is preferably capable of holding only the instruction portion of the second code.


[0043] Conveniently, the processor is arranged to interrogate components of the apparatus to ascertain their identity. Further, the processor is preferably arranged to (1) compare the identity obtained from the hardware components with a portion of the second code, and (2) reprogram the non-volatile memory only if the second code is compatible with the apparatus.


[0044] According to a fourth aspect of the invention a system comprises a device, e.g., a computer, containing a processor connected to an apparatus according to the third aspect of the invention.


[0045] The transmitter/receiver of the apparatus can include a connection between the apparatus and the computer. Such an arrangement provides a convenient source of the second code. The skilled person will appreciate that a computer can accept data from a variety of sources. Such sources may comprise any one or more of the following: external media such as floppy disks, CD-ROMS, DVD ROM/RAM, other magneto optical storage media; via remote connections to other computers such as network connections, file transfers, internet connections, etc.


[0046] According to a fifth aspect of the invention, there is provided a method of reprogramming electronic apparatus programmed with a first code held in a non-volatile memory during normal operation of said apparatus with a second code. The method comprises comparing a list of suitable target components contained within a portion of said second code with the components of the electronic apparatus, and reprogramming said non-volatile memory only if the second code is compatible with the components of the electronic apparatus.


[0047] An advantage of this method is that it ensures that the second code used to program the non-volatile memory functions correctly. If a portion of the second code does not function, the non-volatile memory is not reprogrammed, and thus, the first code residing in the non-volatile memory will not be lost by being overridden. Since the first code is not lost, the apparatus will continue to function.


[0048] In one embodiment of this method, none of the second code is executed before it is programmed into the non-volatile memory. However, some embodiments, particularly those described in relation to the first aspect of the invention can execute portions of the second code from a temporary memory before the non-volatile memory is reprogrammed.


[0049] The method preferably comprises providing a non-volatile memory image that contains second code suitable for running on a plurality of different components of the apparatus. In such a case, the method further comprises selecting an appropriate portion of the non-volatile memory image to reprogram the non-volatile memory.


[0050] According to a sixth aspect of the invention, an electronic apparatus performs the method of the fifth aspect of the invention.


[0051] The above and still further objects, features and advantages of the present invention will become apparent upon consideration of the following detailed descriptions of several specific embodiments thereof, especially when taken in conjunction with the accompanying drawings.







BRIEF DESCRIPTION OF THE DRAWING

[0052]
FIG. 1, as described, includes illustrations of a prior art method;


[0053]
FIG. 2 is an illustration of a preferred embodiment of an apparatus suitable for performing the invention;


[0054]
FIG. 3 includes illustrations of a preferred first embodiment of the invention;


[0055]
FIG. 4 includes illustrations of a preferred second embodiment of a method of the invention;


[0056]
FIG. 5 is a flow chart outlining the method of FIG. 3;


[0057]
FIG. 6 is a flow chart outlining the method of FIG. 4; and


[0058]
FIG. 7 includes illustrations of a preferred related method of reprogramming an electronic apparatus, in accordance with the invention.







DETAILED DESCRIPTION OF FIGS. 2-7

[0059]
FIG. 2 is a block diagram of a typical electronic apparatus 200 to which the invention can be applied. In this embodiment the electronic apparatus is a tape drive arranged to receive a tape 202, which is read from and written to by a read/write head 204. A read/write block contains dedicated circuitry for the tape drive.


[0060] The electronic apparatus further comprises a processor 208, a non-volatile flash memory 2, a volatile Random Access Memory 10, and a transmitter/receiver (i.e., transceiver) 214. The processor 208, the flash memory 2, the transmitter/receiver 214, the RAM 10, and the read/write block 202 communicate with one another via a bus 216.


[0061] As will be appreciated, the purpose of the tape drive is to read data from and write data to the tape 202. This is achieved by the processor 208 operating a first code stored in the non-volatile flash memory 2. The processor 208 includes a program counter, which refers to an address in memory from which the next instruction will be executed. Thus, if the program counter points to an address in the flash memory the next instruction will be from the flash memory, whereas if the program counter is changed to point at an address in the RAM 10 execution of the code will switch to the code contained in the RAM 10.


[0062] The flash memory 2 has two states of operation, viz. a read mode in which code can be executed from the flash memory 2, and a write mode in which the flash memory can be reprogrammed. When the flash memory is being reprogrammed it cannot be read and therefore code cannot be executed therefrom.


[0063] The transmitter/receiver 214 communicates with a computer 215 to send data read from the tape 202 and to receive data to be written to the tape 202. Further, the tape drive 200 can receive new flash memory images containing second code suitable to reprogram the flash memory 2.


[0064]
FIGS. 3 and 5 are illustrations of a method processor 208 performs to reprogram the flash memory 2 according to a first aspect of the invention. As described above program counter 300 in processor 208 is pointing at an address within the flash memory 2, and thus a first code 302, containing both an instruction portion and a reprogramming portion 304, is being executed. The flash memory is appropriately in a read state allowing execution of the first code 302.


[0065] A first step in the reprogramming method is to download a new flash memory image, or second code, of the code with which it is desired to reprogram the flash memory 2, into the RAM 10 (shown in FIG. 3b, and step 500 in FIG. 5). The memory image containing the second code also contains a reprogramming portion 308.


[0066] As shown in FIG. 3c the next step of the method is to copy the reprogramming portion 308 from the memory image into the RAM 10 to form a copy of the portion 310, to allow it to be executed therefrom (step 502 in FIG. 5).


[0067] Next, the flash memory is switched to a write state to enable it to be reprogrammed, and the program counter 300 in the processor 208 is altered to point to the address corresponding to the start of the copy of the reprogramming portion 310. (Shown in FIG. 3d, and as step 504 in FIG. 5).


[0068] Before reprogramming commences the suitability of the reprogramming portion for the electronic apparatus is checked. The reprogramming portion of processor 208 interrogates the hardware to ascertain the identity of the components. The reprogramming portion of processor 208 compares the resulting component identity with a signal indicative of a portion of the new flash memory image that has just been downloaded and that contains a list of suitable hardware (step 506 in FIG. 5). If processor 208 determines there is a match between the hardware and the components listed in the new flash memory image, execution of code within the RAM 10 continues. If there is no match, processor 208 reverts to execution of the code maintained within the flash memory (step 508 in FIG. 5).


[0069] Thus, the reprogramming portion 310 of the program of processor 208 copies the memory image containing the instruction portion and the reprogramming portion of the second code into to the flash memory 2, as shown in FIG. 3e and step 510 in FIG. 5. It will be appreciated that the copy of the reprogramming portion 210 being used to reprogram the flash memory 2 has been taken from the new image. Therefore, for the contents of the flash memory 2 to be altered, the reprogramming portion 308 of the second code 306 must be capable of running on the electronic apparatus. As described in relation to FIG. 1, previously the code used to reprogram the flash memory 2 was taken from the code held in the flash memory 2.


[0070] Therefore, if for any reason the reprogramming portion 6 of the new, second code 16 did not function it was not possible to perform further upgrades on the code held in the flash memory 2. Such a problem typically occurred if the flash memory were upgraded with code intended to be used on different electronic apparatus, or a different version of the electronic apparatus.


[0071] Once the reprogramming of the flash memory 2 is complete the flash memory 2 is returned to a read state, and the program counter 300 is caused to point at the appropriate first address within the flash memory 2 (FIG. 3f and step 512 in FIG. 5).


[0072] As a further example there now follows a description of a portion of pseudo code to provide the method of the embodiment described in relation to FIGS. 3 and 5. The following assumptions are made—the electronic apparatus utilises a flash memory and has the capability to reprogram the flash memory without the use of external equipment and has the capability to execute processor instructions from a temporary memory. Thus, whilst the flash memory device is being reprogrammed the processor instructions are supplied by the temporary memory. For convenience it is assumed that the temporary memory is a static random access memory (SRAM).
1Executing_in_flash;Firmware_image_successfully_downloaded;Follow_pointer_in_downloaded_image_to_reprogramming_code;Enter_image's_reprogramming_code_-_RAM_execution;Read_MFG_id_and_Device_code_of_flash_part;if (mfg_id_and_device_code_are_supported) {execute_reprogramming_commands_for_the_flash_type;}else{return; /*returns execution back to flash,and the unchanged code that residesthere*/}


[0073]
FIGS. 4 and 6 are illustrations of a method processor 208 performs to reprogram the flash memory 2 according to a second aspect of the invention. Processor 208 includes a program counter 400 that points to an address within the flash memory 2, allowing the processor 208 to execute a first code 402 contained therein (FIG. 4a).


[0074] A first step in the method is to download a new flash memory image 404 into the RAM 10 (FIG. 4b and step 600FIG. 6). The new flash memory image 404 comprises an instruction portion 406 together with a reprogramming portion 408. Therefore, in this embodiment the new flash memory image 404 is structured in such a way that the instruction portion 406 is separable from the reprogramming portion 408.


[0075] As can be seen in FIG. 4c and step 602 in FIG. 6 the next step in the method causes the program counter 400 to point at an address with the RAM 10, and the flash is changed from the READ state into a WRITE state in readiness for reprogramming.


[0076] Before reprogramming commences, processor 208 determines the suitability of the reprogramming portion of the processor for the electronic apparatus (step 604 in FIG. 6). The reprogramming portion interrogates the hardware to ascertain the identity of the components. The reprogramming portion of processor 208 compares the resulting signals indicative of the identity of the components with a portion of the new flash memory image 406 that has just been downloaded. If there is a match between the hardware and the components listed in the new flash memory image, execution of code within the RAM 10 continues. If there is no match, execution reverts to code maintained within the flash memory (step 606 in FIG. 6).


[0077] As shown in FIG. 4d and step 608 in FIG. 6, once processor 208 has confirmed compatibility the reprogramming portion 408 reprograms the flash memory 2 with the instruction portion of the second code 406, and the processor causes an image of the instruction portion of the second code 406 to be stored in the RAM 10. Unlike the embodiment shown in FIG. 3, and because the new flash memory image is structured so that the reprogramming portion 408 is separable from the instruction portion of the second code 406, it is not necessary to copy the reprogramming portion to the flash memory 2.


[0078] As shown in FIG. 4e and step 610 in FIG. 6, once reprogramming has been performed the program counter 400 is returned so it points at an address within the flash memory 2, to begin such execution of the second code newly programmed into the flash memory. Further, the flash memory 2 is returned to the read state, and the new flash memory image is deleted from the RAM 10.


[0079] An advantage of this method is that the reprogramming portion 408 is never copied into the flash memory 2 so that the size of the flash memory can be smaller, or the address space available for the second code 406 can be increased.


[0080] As a further example there now follows a description of a portion of pseudo code to provide the method of the embodiment described in relation to FIGS. 4 and 6. The following assumptions are made—the electronic apparatus (1) utilises a flash memory and has the capability to reprogram the flash memory without the use of external equipment and (2) has the capability to execute processor instructions from a temporary memory. Thus, whilst the flash memory device is being reprogrammed the processor instructions are supplied by the temporary memory.


[0081] For convenience it is assumed that the temporary memory is a static random access memory (SRAM). Further, it is assumed that the new flash memory image has been downloaded and is resident in the temporary memory so that the reprogramming portions are the last functions in the image and that the ability to find the position of the reprogramming portion in the new flash memory image is resident in the executing code:
2Executing in flash;Firmware_image_successfully_downloaded;Follow_pointer_in_downloaded_image_to_reproramming_code;Enter_image's_reprogramming_code_-RAM_execution;Read_MFG_id_and_device_code_of_flash_part;if (mfg_id_and_device_code_are_supported) {/*using the reprogramming commands for theflash type*/Extract_address_of_start_of_reprogramming_functions_from_image;Copy_image_to_flash(from_start_of_image_to_start_of_reprogramming_functions);Return_to_flash_execution_using_new_image;}else{return; /*returns execution back to flash,and the unchanged code that residesthere* /}


[0082]
FIG. 7 includes illustrations of a further method that the reprogramming portion of the program of processor 208 performs to reprogram the flash memory 2. Initially a program counter 700 of processor 208 points to an address within the flash memory 2. The address causes processor 208 to execute a first code 702 contained in the processor (FIG. 7a).


[0083] A first step in the method is to copy a reprogramming portion 708 into the RAM 10. The reprogramming portion 708 will be used to reprogram the flash memory 2 with a second code. This is shown in FIG. 7b.


[0084] Next, execution of the code switches from the code contained in the flash memory 2 to that contained in the RAM 10 and therefore, the program counter 700 now points at an address within the RAM 10. Further, the flash memory is switched into a reprogramming mode so it is ready to receive a new code (FIG. 7c).


[0085] However, before the code executing from the RAM 10 starts to reprogram the flash memory 2, processor 208 determines whether the code that is to be used to reprogram the flash is compatible with the components of the electronic apparatus.


[0086] The code executing on the RAM 10 has access to a new flash memory image from which a second code used to reprogram the flash memory is obtained. When the flash memory image is created, a list of components that the image is capable of reprogramming is contained within the image. Therefore, to ascertain whether or not the new flash memory image is compatible with the components of the electronic apparatus, the processor 208 interrogates the components to determine their identity. Once the identity of the components has been obtained the reprogramming portion of the program of processor 208 compares signals indicative of the identity of the components with the list of components within the flash memory image.


[0087] Once processor 208 has ascertained that the new flash memory image is suitable, the code running on the RAM 10 proceeds to reprogram the flash memory 10 with the second code 706 contained in the flash memory image (FIG. 7d).


[0088] Finally, when the flash memory has been reprogrammed the program counter 700 is caused to point at an address for the flash memory, and the flash memory is returned to a read state so that it cannot be altered.


[0089] As a further example there now follows a description of a portion of pseudo code to provide the method of the embodiment described in relation to FIGS. 7. The following assumptions are made—the electronic apparatus utilises a flash memory and has the capability to reprogram the flash memory without the use of external equipment and has the capability to execute processor instructions from a temporary memory. Thus, whilst the flash memory device is being reprogrammed the processor instructions are supplied by the temporary memory. For convenience it is assumed that the temporary memory is a static random access memory (SRAM).
3Executing_in_flash;Firmware_image_successfully_downloaded;Enter_reprogramming_mode_-_RAM_execution;Read_MFG_id_and_device_code_of_flash_part;Follow_pointer_in_downloading_image_to_supported_flash_list;for (i=0;i<length_of_supported_flash_list;i++) {A=falseB=falseA=compare_mfg_id_ofpart_vs_element_in_list;B=comare_device_code_of_part_vs_element_in_list;if (A && B) {i=length_of_supproted_flash_list;}}reprogram_image;


[0090] Thus, it will be seen that the loop contained in this pseudo code selects an appropriate second code from within the flash memory image (non-volatile memory image).


Claims
  • 1. A method of reprogramming electronic apparatus programmed with a first code held in a non-volatile memory during normal operation of said apparatus comprising a. writing into a temporary memory a second code having a reprogramming portion arranged to reprogram said non-volatile memory b. executing at least said reprogramming portion of said second code from said temporary memory in order to (i) cause said second code to be programmed into said non-volatile memory and (ii) thereby replace said first set of code in said non-volatile memory.
  • 2. A method according to claim 1 further comprising writing an instruction portion of the second code into the temporary memory.
  • 3. A method according to claim 2 comprising reprogramming said non-volatile memory with said reprogramming portion in addition to said instruction portion of said second code.
  • 4. A method according to claim 2 comprising reprogramming said non-volatile memory with said instruction portion of said second code.
  • 5. A method according to claim 4 further including refreshing the contents of the temporary memory to cause the reprogramming portion to be lost.
  • 6. A method according to claim 2 wherein the reprogramming portion occurs after the instruction portion within the second code.
  • 7. A method according to claim 1 wherein the writing step includes copying the second code into the temporary memory from an external device to which the electronic apparatus is connected.
  • 8. A method according to claim 1 wherein the method further comprises switching execution from the non-volatile memory to the temporary memory before the second code is programmed into said non-volatile memory.
  • 9. A method according to claim 8 further including erasing the non-volatile memory in response to execution having been switched to the temporary memory being erased.
  • 10. A method according to claim 8 further including overwriting the first code within the non-volatile memory by the second code in response to execution having been switched to the temporary memory.
  • 11. A method according to claim 8 further comprising switching execution back to the non-volatile memory in response to the non-volatile memory having been programmed with at least a portion of the second code.
  • 12. A method according to claim 1 further comprising determining if the second code is suitable for programming the non-volatile memory before step b is performed.
  • 13. A method according to claim 12 further comprising continuing to use the first code if the second code is determined as not being suitable for reprogramming the non-volatile memory.
  • 14. A method according to claim 12 further comprising ascertaining the identity of the components within the electronic apparatus by interrogating them.
  • 15. A method according to claim 14 further comprising comparing the identity obtained by interrogating the components with a list of suitable hardware contained within a portion of the second code.
  • 16. A method according to claim 1 further comprising arranging the reprogramming portion such that it contains the necessary code to reprogram a plurality of hardware types.
  • 17. A computer readable medium having stored therein instructions for causing a processing unit to execute the method of claim 1.
  • 18. An electronic apparatus comprising a non-volatile, reprogrammable memory holding a first code, a temporary memory arranged to hold code temporarily, a processor arranged to execute instructions held in either the non-volatile memory or the temporary memory, and a receiver arranged to receive data from a source external of the apparatus, the processor being arranged to (a) download a second code having at least a reprogramming portion into the temporary memory via the receiver, (b) store said second code in said temporary memory, and (c) execute at least said reprogramming portion of said second code residing in said temporary memory to reprogram said flash memory with said second code.
  • 19. An apparatus according to claim 18 wherein the processor is arranged to obtain the second code from a computer readable medium readable by the apparatus.
  • 20. An apparatus according to claim 18 wherein the receiver is arranged to be connected to a network.
  • 21. An apparatus according to claim 18 wherein the second code includes an instruction, the processor being arranged to perform (a), (b) and (c) with respect to the instruction.
  • 22. An apparatus according to claim 18 wherein the non-volatile memory is capable of holding both the reprogramming and the instruction portions of the second code.
  • 23. An apparatus according to claim 21 wherein the non-volatile memory is capable of holding only the instruction portion of the second code.
  • 24. An apparatus according to claim 18 wherein the processor is arranged to interrogate components of the apparatus to ascertain their identity.
  • 25. An apparatus according to claim 24 wherein the processor is arranged to compare the identity obtained from the hardware components with a portion of the second code.
  • 26. An apparatus according to claim 25 wherein the processor is further arranged to reprogram the non-volatile memory only if the second code is compatible with the apparatus.
  • 27. A system comprising a computer connected to the apparatus of claim 18.
  • 28. A system according to claim 27 wherein the receiver includes a connection between the apparatus of claim 18 and the computer of claim 27.
Priority Claims (1)
Number Date Country Kind
0122901.2 Sep 2001 GB