www.ti.com
SPI_Boot
Yes
No
(0x08AA)
?
Valid
KeyValue
Enable the SPI-A clock
Set the LSPCLK to 4
Enable SPISIMOA,
SPISOMI and SPICLKA
pin functionality and enable
Set up SPI-A for
8-bit character,
Use internal SPI clock,
master mode
Use slowest baud rate (0x7F)
Relinquish SPI-A from reset
(GPIO19)
Set chip enable high
Enable EEPROM
Send read command and
start at EEPROM address
0x0000
Read KeyValue
Return
FLASH_ENTRY_POINT
Read LOSPCP value
Change LOSPCP
Change SPIBRR
Read SPIBRR value
Read and discard 7
reserved words
address
Read EntryPoint
Call CopyData
EntryPoint
Return
pullups on those pins
SPI_Boot Function
The data transfer is done in "burst" mode from the serial SPI EEPROM. The transfer is carried out entirely
in byte mode (SPI at 8 bits/character). A step-by-step description of the sequence follows:
Step 1.
The SPI-A port is initialized
Step 2.
The GPIO19 (SPISTE) pin is used as a chip-select for the serial SPI EEPROM
Step 3.
The SPI-A outputs a read command for the serial SPI EEPROM
Step 4.
The SPI-A sends the serial SPI EEPROM an address 0x0000; that is, the host requires that the
EEPROM must have the downloadable packet starting at address 0x0000 in the EEPROM.
Step 5.
The next word fetched must match the key value for an 8-bit data stream (0x08AA). The least
significant byte of this word is the byte read first and the most significant byte is the next byte
fetched. This is true of all word transfers on the SPI. If the key value does not match, then the
load is aborted and the entry point for the flash (0x3F 7FF6) is returned to the calling routine.
Step 6.
The next 2 bytes fetched can be used to change the value of the low speed peripheral clock
register (LOSPCP) and the SPI baud rate register (SPIBRR). The first byte read is the LOSPCP
value and the 2
nd
byte read is the SPIBRR value. The next 7 words are reserved for future
enhancements. The SPI bootloader reads these 7 words and discards them.
Step 7.
The next 2 words makeup the 32-bit entry point address where execution will continue after the
boot load process is complete. This is typically the entry point for the program being downloaded
through the SPI port.
Step 8.
Multiple blocks of code and data are then copied into memory from the external serial SPI
EEPROM through the SPI port. The blocks of code are organized in the standard data stream
structure presented earlier. This is done until a block size of 0x0000 is encountered. At that point
in time the entry point address is returned to the calling routine that then exits the bootloader and
resumes execution at the address specified.
Figure 2-20. Data Transfer From EEPROM Flow
SPRU722C – November 2004 – Revised October 2006
Bootloader Features
41