
Bootloading Sequence
10-5
The Bootloader
10.3 Bootloading Sequence
Here is the general sequence of events in bootloading a source program:
1)
Select the bootloader by resetting the ’C4x while driving the
RESETLOC(1,0) pins low, the on-chip ROM enable pin (ROMEN) high,
and the IIOF0 pin high. The ROMEN pin must be high during bootloader
execution, but it can be changed anytime after bootloading.
2)
The status of external pins IIOF(3–1) indicates where to find the source
program to be loaded (memory or communication port). These options are
listed in Table 10–1. Pins IIOF(3–1) are read as the IIOF flags in the CPU
IIF register. The bootloader takes the following steps to determine the
source program’s location, as is shown in Figure 10–1.
a)
If an IIF(3–1) value of from 110
2
to 001
2
(6 to 1) is found, the source
program is loaded from the corresponding memory address shown in
the top six lines of Table 10–1. See Figure 10–2 for details on boot-
loader memory flow.
b)
The IIF(3–1) value of 000
2
(0) is reserved. You should not use this
mode.
c)
If none of the combinations 000
2
– 110
2
are found, the bootloader
program assumes that loading will be via a communication port, and
it starts checking communication port input channels (in the order port
0 through port 5). If it finds no inputs from a communication port, the
program returns to checking the status of the IIOF(3–1) pins again.
See Figure 10–3 for details on bootloader communication port flow.
3)
When the source program’s data stream is found, the program is loaded
at the address found in the fifth word of the data stream (the format is
shown in Table 10–2), using the bus width specified in the first word (8, 16,
or 32 bits wide). The bootloader cannot load the source program to any
location below 0000 1000h
,
unless the address decode ogic s remapped.
The first five words of the source program specify its loading and execution
criteria. Remaining words are the source program(s) and vector table
pointers as shown in Table 10–2.
4)
An IACK instruction is executed, indicating the completion of the bootload
sequence. This indication can then be used to switch from microcomputer
(ROMEN = 1) to microprocessor mode (ROMEN = 0). You do not need to
reset the ’C4x to change the ROMEN pin. However, ensure that the ’C4x
will not access addresses 0000 0000h to 0000 0FFFh during the change.
5)
The source program is executed (entry point is the first word of the first
loaded program).