Hardware Reference
In-Depth Information
3.6.3 The Bootloader Mode
The on-chip flash memory includes a boot block area from $F000 to $FFFF containing an
S-record bootloader program. The bootloader can be used to erase and reprogram the remainder
of on-chip flash memory or erase the on-chip byte-erasable EEPROM. The bootloader utilizes
the on-chip SCI for communications and does not require any special programming software on
the host computer. The only host software required is a simple terminal program that is capable
of communicating at 9600 to 115,200 baud and supports XON/XOFF handshaking.
The bootloader mode is mainly used to program the D-Bug12 monitor into the flash mem-
ory or download a user's fully debugged code into the D-Bug12 portion of flash memory. The
latter allows the board to be operated in EVB mode or restart user code every time the board is
turned on or reset.
When the user code is programmed into the D-Bug12 portion of flash memory, it wipes out
the D-Bug12 monitor. We can restore it anytime because bootloader is not erased. We cannot
erase the bootloader in bootloader mode. The bootloader can only be erased by a BDM kit via
the BDM port.
Invoking the bootloader causes the prompt shown in Figure 3.20 to be displayed on the host
terminal's screen.
D-Bug12 Bootloader v1.0.0
a) Erase Flash
b) Program Flash
c) Set Baud Rate
d) Erase EEPROM
?
Figure 3.20 Serial bootloader prompt
E RASE F LASH C OMMAND
This command is selected by typing a on the terminal after the ? character in Figure 3.20.
This command causes a bulk erase of all four 64-kB flash memory arrays except for the 4-kB boot
block in the upper 64-kB array where the S-record bootloader resides. After the erase operation
is completed, a verify operation is performed to ensure that all locations were properly erased.
If the erase operation is successful, the bootloader's prompt is redisplayed. If any locations were
found to contain a value other than $FF, an error message is displayed on the screen and the
bootloader's prompt is redisplayed. If the HCS12 MCU will not erase after one or two attempts,
the device may be damaged.
P ROGRAM F LASH C OMMAND
The bootloader uses interrupt-driven, buffered serial I/O in conjunction with XON/XOFF
software handshaking to control the flow of S-record data from the host computer during
the programming process. This allows the bootloader to continue receiving S-record data from
the host computer while the data from the previously received S-record is programmed into the
 
 
Search WWH ::




Custom Search