X[ ]### where [ ] means zero or more spaces, "###" is a numeric value, 0 to 0xFFFF, selecting the block to erase.
Notes:
No distinction is made between uppercase and lowercase.
Only a single numeric value is parsed.
The numeric value may be specified in either decimal or hexadecimal format.
Anything after the first numeric value is ignored.
"Block" means 128 BYTEs, either from 0x__00 to 0x__7F or 0x__80 to 0x__FF.
"Erase" means reset back to 0xFF.
The command is rejected unless logged on in Manager or Administrator mode.
The FLASH memory is the PROGRAM memory. Although a block of PROGRAM memory does not need to first be erased for it to be changed with an iHex command, it is sometimes desirable to reset a block of FLASH or PROGRAM memory.
Usually the code (i.e., PROGRAM memory) for one task, or process, can be reset while other tasks continue to run. In the example below, a portion of the sequencer logic which came with the Operating System is being erased (i.e., reset):
> df+ 0x5D0 - 0x6BF FLASH (program memory) contents: 05D0: E2 01 2C 2D 21 11 D5 DD-EB CD 11 24 70 80 81 80 ..,-!......$p... 05E0: 92 80 EE 28 E9 F0 71 2E-49 01 EF 01 8D 01 E4 FE ...(..q.I....... 05F0: 06 C0 B7 FE 71 2C B6 FE-81 2C B5 FE 91 2C EE 2D ....q,...,...,.- 0600: E7 70 F6 E0 EF 0F F3 E0-F1 1D 09 94 09 C0 09 C0 .p.............. 0610: 1E C0 1E C0 2D C0 3A C0-3A C0 3A C0 D8 01 FE 01 ....-.:.:.:..... 0620: 08 95 B5 FC 89 2D B6 FC-88 2D B7 FC 87 2D EF E6 .....-...-...-.. 0630: E7 DC 78 2E 88 2E 98 2E-86 E0 EF E6 E1 DC 83 95 ..x............. 0640: 80 FF 71 2C 81 FF 81 2C-82 FF 91 2C E7 CF E6 CF ..q,...,...,.... 0650: EF E6 87 2D 81 11 D4 DC-78 2E EF E6 88 2D 81 11 ...-....x....-.. 0660: CF DC 88 2E EF E6 89 2D-81 11 CA DC 98 2E D6 CF .......-........ 0670: 83 E0 EF E6 C5 DC 81 30-31 F0 10 F4 91 2C 01 C0 .......01....,.. 0690: C5 CF FF FF FF FF FF FF-FF FF FF FF FF FF FF FF ................ 06A0: 11 04 E0 E0 AD DC 34 DD-2E 01 97 DF EF 01 23 96 ......4.......#. 06B0: 13 97 80 F0 12 96 69 91-61 93 69 91 61 93 69 91 ......i.a.i.a.i. >X 0x638 ; Rejected because not in any privileged mode >df+ 0x5D0 - 0x6BF FLASH (program memory) contents: 05D0: E2 01 2C 2D 21 11 D5 DD-EB CD 11 24 70 80 81 80 ..,-!......$p... 05E0: 92 80 EE 28 E9 F0 71 2E-49 01 EF 01 8D 01 E4 FE ...(..q.I....... 05F0: 06 C0 B7 FE 71 2C B6 FE-81 2C B5 FE 91 2C EE 2D ....q,...,...,.- 0600: E7 70 F6 E0 EF 0F F3 E0-F1 1D 09 94 09 C0 09 C0 .p.............. 0610: 1E C0 1E C0 2D C0 3A C0-3A C0 3A C0 D8 01 FE 01 ....-.:.:.:..... 0620: 08 95 B5 FC 89 2D B6 FC-88 2D B7 FC 87 2D EF E6 .....-...-...-.. 0630: E7 DC 78 2E 88 2E 98 2E-86 E0 EF E6 E1 DC 83 95 ..x............. 0640: 80 FF 71 2C 81 FF 81 2C-82 FF 91 2C E7 CF E6 CF ..q,...,...,.... 0650: EF E6 87 2D 81 11 D4 DC-78 2E EF E6 88 2D 81 11 ...-....x....-.. 0660: CF DC 88 2E EF E6 89 2D-81 11 CA DC 98 2E D6 CF .......-........ 0670: 83 E0 EF E6 C5 DC 81 30-31 F0 10 F4 91 2C 01 C0 .......01....,.. 0690: C5 CF FF FF FF FF FF FF-FF FF FF FF FF FF FF FF ................ 06A0: 11 04 E0 E0 AD DC 34 DD-2E 01 97 DF EF 01 23 96 ......4.......#. 06B0: 13 97 80 F0 12 96 69 91-61 93 69 91 61 93 69 91 ......i.a.i.a.i. >; Logon with a '$' as the first character on a command line m>X 0x638 ; Reset the block containing 0x638: 0x600 to 0x67F FLASH (program memory) contents: 05D0: E2 01 2C 2D 21 11 D5 DD-EB CD 11 24 70 80 81 80 ..,-!......$p... 05E0: 92 80 EE 28 E9 F0 71 2E-49 01 EF 01 8D 01 E4 FE ...(..q.I....... 05F0: 06 C0 B7 FE 71 2C B6 FE-81 2C B5 FE 91 2C EE 2D ....q,...,...,.- 0600: FF FF FF FF FF FF FF FF-FF FF FF FF FF FF FF FF ................ 0610: FF FF FF FF FF FF FF FF-FF FF FF FF FF FF FF FF ................ 0620: FF FF FF FF FF FF FF FF-FF FF FF FF FF FF FF FF ................ 0630: FF FF FF FF FF FF FF FF-FF FF FF FF FF FF FF FF ................ 0640: FF FF FF FF FF FF FF FF-FF FF FF FF FF FF FF FF ................ 0650: FF FF FF FF FF FF FF FF-FF FF FF FF FF FF FF FF ................ 0660: FF FF FF FF FF FF FF FF-FF FF FF FF FF FF FF FF ................ 0670: FF FF FF FF FF FF FF FF-FF FF FF FF FF FF FF FF ................ 0680: 81 2C 71 2C 02 C0 87 2C-97 2C C8 CF C7 CF C6 CF .,q,...,.,...... 0690: C5 CF FF FF FF FF FF FF-FF FF FF FF FF FF FF FF ................ 06A0: 11 04 E0 E0 AD DC 34 DD-2E 01 97 DF EF 01 23 96 ......4.......#. 06B0: 13 97 80 F0 12 96 69 91-61 93 69 91 61 93 69 91 ......i.a.i.a.i. m>
Details: | |
The address specified is masked (i.e., ANDed) with 0xFF00 to determine the starting address of the block to reset. | |
System FLASH (addresses above 0x39FF and below 0x7000) can only be erased when in Administrator mode. | |
System FLASH (addresses 0x7000 and above) cannot be erased with this System Command. | |
The ATmega ChipErase command from the SPI port, erases ALL of FLASH memory, including MIRTOS. | |
Only a single 128-byte block is erased at a time, unless a command extension has been created to allow a range to be erased. |
See also: | |
The Display memory contents System command, in particular, portions about displaying in iHex and capturing the output in order to be able to restore blocks erased. Also, the iHex memory update System Commands as well as the ICALL_IfValid_EEPROM and ICALL_IfValid_PGM System Functions. |