TMS320x2834x Delfino Boot ROM Reference Guide
TMS320x2834x Delfino Boot ROM Reference Guide
Reference Guide
List of Figures
1 Memory Map of On-Chip ROM ............................................................................................................................. 9
2 Vector Table Map ............................................................................................................................................... 12
3 Bootloader Flow Diagram ................................................................................................................................... 15
4 Boot ROM Stack................................................................................................................................................. 17
5 Boot ROM Function Overview ............................................................................................................................ 18
6 Flow Diagram of Jump to M0 SARAM................................................................................................................ 19
7 Flow Diagram of Jump to XINTF x16 ................................................................................................................. 19
8 Bootloader Basic Transfer Procedure ................................................................................................................ 25
9 Overview of InitBoot Assembly Function ............................................................................................................ 26
10 Overview of the SelectBootMode Function ........................................................................................................ 27
11 Overview of CopyData Function ......................................................................................................................... 28
12 Overview of SCI Bootloader Operation .............................................................................................................. 30
13 Overview of SCI_Boot Function ......................................................................................................................... 31
14 Overview of SCI_GetWordData Function ........................................................................................................... 32
15 Overview of Parallel GPIO bootloader Operation ............................................................................................... 32
16 Parallel GPIO Boot Loader Handshake Protocol................................................................................................ 34
17 Parallel GPIO Mode Overview ........................................................................................................................... 35
18 Parallel GPIO Mode - Host Transfer Flow .......................................................................................................... 36
19 16-Bit Parallel GetWord Function ....................................................................................................................... 37
20 8-Bit Parallel GetWord Function ......................................................................................................................... 38
21 Overview of the Parallel XINTF Boot Loader Operation ..................................................................................... 39
22 XINTF_Parallel Boot Loader Handshake Protocol ............................................................................................. 41
23 XINTF Parallel Mode Overview .......................................................................................................................... 42
24 XINTF Parallel Mode - Host Transfer Flow ........................................................................................................ 43
25 16-Bit Parallel GetWord Function ....................................................................................................................... 44
26 8-Bit Parallel GetWord Function ......................................................................................................................... 45
27 SPI Loader ......................................................................................................................................................... 46
28 Data Transfer From EEPROM Flow ................................................................................................................... 48
29 Overview of SPIA_GetWordData Function ......................................................................................................... 48
30 EEPROM Device at Address 0x50 ..................................................................................................................... 49
31 Overview of I2C_Boot Function .......................................................................................................................... 50
32 Random Read .................................................................................................................................................... 51
33 Sequential Read ................................................................................................................................................. 52
34 Overview of eCAN-A bootloader Operation........................................................................................................ 52
35 ExitBoot Procedure Flow .................................................................................................................................... 54
List of Tables
1 Vector Locations ................................................................................................................................................. 13
2 Configuration for Device Modes ......................................................................................................................... 15
3 Boot Mode Selection .......................................................................................................................................... 17
4 General Structure Of Source Program Data Stream In 16-Bit Mode.................................................................. 21
5 LSB/MSB Loading Sequence in 8-Bit Data Stream............................................................................................ 23
6 Pins Used by the McBSP Loader ....................................................................................................................... 29
7 Bit-Rate Values for Different XCLKIN Values ..................................................................................................... 29
8 McBSP 16-Bit Data Stream ................................................................................................................................ 29
9 Parallel GPIO Boot 16-Bit Data Stream ............................................................................................................. 33
10 Parallel GPIO Boot 8-Bit Data Stream ............................................................................................................... 33
11 XINTF Parallel Boot 16-Bit Data Stream ............................................................................................................ 40
12 XINTF Parallel Boot 8-Bit Data Stream .............................................................................................................. 41
13 SPI 8-Bit Data Stream ........................................................................................................................................ 46
14 I2C 8-Bit Data Stream ........................................................................................................................................ 51
15 Bit-Rate Values for Different XCLKIN Values ..................................................................................................... 52
16 eCAN 8-Bit Data Stream .................................................................................................................................... 53
17 CPU Register Restored Values .......................................................................................................................... 55
18 Boot Loader Options .......................................................................................................................................... 56
19 Bootloader Revision and Checksum Information ............................................................................................... 59
20 Bootloader Revision Per Device ......................................................................................................................... 59
21 Additions, Deletions, and Changes .................................................................................................................... 60
This reference guide is applicable for the code and data stored in the on-chip boot ROM on the
TMS320C2834x Delfino™ processors. This includes all devices within this family.
The boot ROM is factory programmed with boot-loading software. Boot-mode signals ( general purpose
I/Os) are used to tell the bootloader software which mode to use on power up. The boot ROM also
contains standard math tables, such as SIN/COS waveforms, for use in IQ math related algorithms found
in the C28x™ IQMath Library - A Virtual Floating Point Engine (literature number SPRC087). Floating-
point tables for SIN/COS are also included for use with the Texas Instruments™ C28x FPU Fast RTS
Library (SPRC664).
This guide describes the purpose and features of the bootloader. It also describes other contents of the
device on-chip boot ROM and identifies where all of the information is located within that memory. Project
collateral discussed in this reference guide can be downloaded from http://www.ti.com/lit/zip/SPRUFN5.
Notational Conventions
This document uses the following conventions.
• Hexadecimal numbers are shown with the suffix h or with a leading 0x. For example, the following
number is 40 hexadecimal (decimal 64): 40h or 0x40.
• Registers in this document are shown in figures and described in tables.
– Each register figure shows a rectangle divided into fields that represent the fields of the register.
Each field is labeled with its bit name, its beginning and ending bit numbers above, and its
read/write properties below. A legend explains the notation used for the properties.
– Reserved bits in a register figure designate a bit that is used for future device expansion.
SPRUFN1 — TMS320x2834x Delfino System Control and Interrupts Reference Guide. This document
describes the various interrupts and system control features of the x2834x microcontroller (MCUs).
SPRUFN4 — TMS320x2834x Delfino External Interface (XINTF) Reference Guide. This document
describes the XINTF, which is a nonmultiplexed asynchronous bus, as it is used on the x2834x
device.
SPRUFN5 — TMS320x2834x Delfino Boot ROM Reference Guide. This document describes the
purpose and features of the bootloader (factory-programmed boot-loading software) and provides
examples of code. It also describes other contents of the device on-chip boot ROM and identifies
where all of the information is located within that memory.
SPRUG80 — TMS320x2834x Delfino Multichannel Buffered Serial Port (McBSP) Reference Guide.
This document describes the McBSP available on the x2834x devices. The McBSPs allow direct
interface between a microcontroller (MCU) and other devices in a system.
SPRUG78 — TMS320x2834x Delfino Direct Memory Access (DMA) Reference Guide. This document
describes the DMA on the x2834x microcontroller (MCUs).
SPRUFZ6 — TMS320x2834x Delfino Enhanced Pulse Width Modulator (ePWM) Module Reference
Guide. This document describes the main areas of the enhanced pulse width modulator that
include digital motor control, switch mode power supply control, UPS (uninterruptible power
supplies), and other forms of power conversion.
SPRUG77 — TMS320x2834x Delfino High-Resolution Pulse Width Modulator (HRPWM) Reference
Guide. This document describes the operation of the high-resolution extension to the pulse width
modulator (HRPWM).
SPRUG79 — TMS320x2834x Delfino Enhanced Capture (eCAP) Module Reference Guide. This
document describes the enhanced capture module. It includes the module description and
registers.
SPRUG74 — TMS320x2834x Delfino Enhanced Quadrature Encoder Pulse (eQEP) Module
Reference Guide. This document describes the eQEP module, which is used for interfacing with a
linear or rotary incremental encoder to get position, direction, and speed information from a rotating
machine in high performance motion and position control systems. It includes the module
description and registers.
SPRUEU4 — TMS320x2834x Delfino Enhanced Controller Area Network (eCAN) Reference Guide.
This document describes the eCAN that uses established protocol to communicate serially with
other controllers in electrically noisy environments.
SPRUG75 — TMS320x2834x Delfino Serial Communication Interface (SCI) Reference Guide. This
document describes the SCI, which is a two-wire asynchronous serial port, commonly known as a
UART. The SCI modules support digital communications between the CPU and other asynchronous
peripherals that use the standard non-return-to-zero (NRZ) format.
SPRUG73 — TMS320x2834x Delfino Serial Peripheral Interface (SPI) Reference Guide. This
document describes the SPI - a high-speed synchronous serial input/output (I/O) port - that allows a
serial bit stream of programmed length (one to sixteen bits) to be shifted into and out of the device
at a programmed bit-transfer rate.
SPRUG76 — TMS320x2834x Delfino Inter-Integrated Circuit (I2C) Reference Guide. This document
describes the features and operation of the inter-integrated circuit (I2C) module.
Tools Guides—
SPRU513 — TMS320C28x Assembly Language Tools v5.0.0 User's Guide. This document describes
the assembly language tools (assembler and other tools used to develop assembly language code),
assembler directives, macros, common object file format, and symbolic debugging directives for the
TMS320C28x device.
SPRU514 — TMS320C28x Optimizing C/C++ Compiler v5.0.0 User's Guide. This document describes
the TMS320C28x™ C/C++ compiler. This compiler accepts ANSI standard C/C++ source code and
produces TMS320 DSP assembly language source code for the TMS320C28x device.
SPRU608 — TMS320C28x Instruction Set Simulator Technical Overview. This document describes
the simulator, available within the Code Composer Studio for TMS320C2000 IDE, that simulates
the instruction set of the C28x™ core.
SPRU625 — TMS320C28x DSP/BIOS 5.32 Application Programming Interface (API) Reference
Guide. This document describes development using DSP/BIOS.
Application Reports—
SPRAB26 — TMS320x2833x/2823x to TMS320x2834x Delfino Migration Overview. This application
report describes differences between the Texas Instruments TMS320x2833x/2823x and the
TMS320x2834x devices to assist in application migration.
Delfino, TMS320C28x, C28x, 28x, 27x, C2xLP are trademarks of Texas Instruments.
3F EBDC
3F F9EE
Reserved
3F FFB9
ROM version
ROM checksum
3F FFC0
Reset vector
CPU vector table
3F FFFF
MEMORY
{
PAGE 0 :
...
FPUTABLES : origin = 0x3FEBDC, length = 0x0006A0
...
}
SECTIONS
{
...
FPUmathTables : > FPUTABLES, PAGE = 0, TYPE = NOLOAD
...
}
The fixed-point math tables included in the boot ROM are used by the Texas Instruments™ C28x™
IQMath Library - A Virtual Floating Point Engine (SPRC087). The 28x IQmath Library is a collection of
highly optimized and high precision mathematical functions for C/C++ programmers to seamlessly port a
floating-point algorithm into fixed-point code on TMS320C28x devices.
These routines are typically used in computational-intensive real-time applications where optimal
execution speed and high accuracy is critical. By using these routines you can achieve execution speeds
that are considerably faster than equivalent code written in standard ANSI C language. In addition, by
providing ready-to-use high precision functions, the TI IQmath Library can shorten significantly your DSP
application development time.
IQmath library accesses the tables through the IQmathTables and the IQmathTablesRam linker sections.
The IQmathTables section is completely included in the boot ROM. From the IQmathTablesRam section
only the IQexp table is included and the remainder must be loaded into the device if used. If you do not
wish to load a copy of these tables already included in the ROM into the device, use the boot ROM
memory addresses and label the sections as “NOLOAD” as shown in Example 2 . This facilitates
referencing the look-up tables without actually loading the section to the target.
MEMORY
{
PAGE 0 :
...
IQTABLES : origin = 0x3FE000, length = 0x000b50
IQTABLES2 : origin = 0x3FEB50, length = 0x00008c
...
}
SECTIONS
{
...
IQmathTables : load = IQTABLES, type = NOLOAD, PAGE = 0
IQmathTables2 > IQTABLES2, type = NOLOAD, PAGE = 0
{
IQmath.lib<IQNexpTable.obj> (IQmathTablesRam)
}
IQmathTablesRam : load = DRAML1, PAGE = 1
...
}
Bootloader
functions
Reset fetched from here when
0x3F FFC0 VMAP=1
Reset vector
64 x 16 CPU vector table Other vectors fetched from here when
0x3F FFFF VMAP=1, ENPIE=0
A The VMAP bit is located in Status Register 1 (ST1). VMAP is always 1 on reset. It can be changed after reset by
software, however the normal operating mode will be to leave VMAP = 1.
B The ENPIE bit is located in the PIECTRL register. The default state of this bit at reset is 0, which disables the
Peripheral Interrupt Expansion block (PIE).
The only vector that will normally be handled from the internal boot ROM memory is the reset vector
located at 0x3F FFC0. The reset vector is factory programmed to point to the InitBoot function stored in
the boot ROM. This function starts the boot load process. A series of checking operations is performed on
General-Purpose I/O (GPIO I/O) pins to determine which boot mode to use. This boot mode selection is
described in Section 2.9 of this document.
The remaining vectors in the boot ROM are not used during normal operation. After the boot process is
complete, you should initialize the Peripheral Interrupt Expansion (PIE) vector table and enable the PIE
block. From that point on, all vectors, except reset, will be fetched from the PIE module and not the CPU
vector table shown in Table 1.
For TI silicon debug and test purposes the vectors located in the boot ROM memory point to locations in
the M0 SARAM block as described in Table 1. During silicon debug, you can program the specified
locations in M0 with branch instructions to catch any vectors fetched from boot ROM. This is not required
for normal device operation.
2 Bootloader Features
This section describes in detail the boot mode selection process, as well as the specifics of the bootloader
operation.
Reset
(power-on reset or warm reset)
Silicon sets the following:
PIE disabled (ENPIE−0)
VMAP=1
OBJMODE=0
AMODE=0
MOM1MAP=1
Boot ROM
Reset vector fetched from boot ROM
address 0x3F FFC0
Jump to InitBoot function to start
boot process
SelectBootMode function
PLLSTS[DIVSEL] = 2
Boot determined by the state of I/O pins
The reset vector in boot ROM redirects program execution to the InitBoot function. After performing device
initialization the bootloader will check the state of GPIO pins to determine which boot mode you want to
execute. Options include: jump to SARAM, jump to XINTF, or call one of the on-chip boot loading routines.
After the selection process and if the required boot loading is complete, the processor will continue
execution at an entry point determined by the boot mode selected. If a bootloader was called, then the
input stream loaded by the peripheral determines this entry address. This data stream is described in
Section 2.10. If, instead, you choose to boot directly to XINTF or SARAM, the entry address is predefined
for each of these memory blocks.
The following sections discuss in detail the different boot modes available and the process used for
loading data code into the device.
NOTE: The PLL multiplier (PLLSTS) and divider (PLLSTS[DIVSEL]) are not affected by a reset
from the debugger. Therefore, a boot that is initialized from a reset from Code Composer
Studio™ may be at a different speed than booting by pulling the external reset line (XRS)
low.
NOTE: The reset value of PLLSTS[DIVSEL] is 0. This configures the device for SYSCLKOUT =
CLKIN/8. The boot ROM will change this to SYSCLKOUT = CLKIN/2 or CLKIN/1 to improve
performance of the loaders. PLLSTS[DIVSEL] is left in this state when the boot ROM exits
and it is up to the application to change it before configuring the PLLCR register.
NOTE: The eCAN Timing 1 loader leaves PLLSTS[DIVSEL] in the CLKIN/1 state when the boot
ROM exits. This is not a valid configuration if the PLL is used. Thus the application must
change it before configuring the PLLCR register.
0x004E
Boot ROM loaders on older C28x devices had the stack in M1 memory. This is a change for this boot loader.
NOTE: If code or data is bootloaded into the address range address range 0x0002 - 0x004E there
is no error checking to prevent it from corrupting the boot ROM stack.
(1)
MODE GPIO87/XA15 GPIO86/XA14 GPIO85/XA13 GPIO84/XA12 MODE
(2)
F 1 1 1 1 Secure Boot
E 1 1 1 0 SCI-A boot
D 1 1 0 1 SPI-A boot
C 1 1 0 0 I2C-A boot Timing 1
B 1 0 1 1 eCAN-A boot Timing 1
A 1 0 1 0 McBSP-A boot
9 1 0 0 1 Jump to XINTF x16
(1)
All four GPIO pins have an internal pullup.
(2)
This mode is available on secure devices only. Refer to the data manual or contact support@ti.com for more information.
Figure 5 shows an overview of the boot process. Each step is described in greater detail in following
sections.
Reset
InitBoot
Call
SelectBootMode
Call
Read the state Read
of I/O pins to Call Yes boot loader,
determine what EntryPoint
Boot Loader SCI, SPI, and load
boot mode is I2C, eCAN, or
desired ? data/code
parallel I/O
No
EntryPoint determined
directly from state of
I/O pins
Call
ExitBoot
Begin execution
at EntryPoint
SelectBootMode
Select jump Jump to Execution
Reset InitBoot ExitBoot continues
to M0 SARAM 0x00 0000
SelectBootMode Execute
Jump to
Reset InitBoot Select XINTF x16 ExitBoot Code
0x10 0000
Configure Zone6
The following boot modes call a boot load routine that loads a data stream from the peripheral into
memory:
• Standard serial boot mode (SCI-A)
In this mode, the boot ROM will load code to be executed into on-chip memory via the SCI-A port.
• SPI EEPROM or Flash boot mode (SPI-A)
In this mode, the boot ROM will load code and data into on-chip memory from an external SPI
EEPROM or SPI flash via the SPI-A port.
• I2C-A boot mode (I2C-A)
In this mode, the boot ROM will load code and data into on-chip memory from an external serial
EEPROM or flash at address 0x50 on the I2C-A bus. The EEPROM must adhere to conventional I2C
EEPROM protocol with a 16-bit base address architecture. To accommodate different input clock
frequencies, there are two timing options for the I2C loader. Each timing option is evoked by selecting
In 8-bit mode, the least significant byte (LSB) of the word is sent first followed by the most significant byte
(MSB). For 32-bit values, such as a destination address, the most significant word (MSW) is loaded first,
followed by the least significant word (LSW). The bootloaders take this into account when loading an 8-bit
data stream.
After load has completed the following memory values will have been initialized as follows:
Location Value
0x3F9010 0x0001
0x3F9011 0x0002
0x3F9012 0x0003
0x3F9013 0x0004
0x3F9014 0x0005
0x3F8000 0x7700
0x3F8001 0x7625
PC Begins execution at 0x3F8000
Yes
Yes
8-bit
Read EntryPoint address DataSize
Yes
R=0 Return
? EntryPoint
No
Read BlockAddress
Transfer R words of
data from source to
destination
8-bit and 16-bit transfers are not valid for all boot modes. If only one mode is valid, then this decision tree is skipped
and the key value is only checked for correctness. See the info specific to a particular bootloader for any limitations.
In 8-bit mode, the LSB of the 16-bit word is read first followed by the MSB.
Init Boot
Initialize device
OBJMODE=1
AMODE = 0 Dummy read of
Call Call
MOM1MAP=1 CSM password SelectBootMode ExitBoot
DP = 0 locations
OVM = 0
SPM= 0
SP = 0x400
NOTE: The SelectBootMode routine disables the watchdog before calling the SCI, I2C , eCAN, SPI
, McBSP, or parallel bootloaders. The bootloaders do not service the watchdog and assume
that it is disabled. Before exiting, the SelectBootMode routine will re-enable the watchdog
and reset its timer.
If a bootloader is not going to be called, then the watchdog is left untouched.
When selecting a boot mode, the pins should be pulled high or low through a weak pulldown or weak
pull-up such that the device can drive them to a new state when required.
SelectBootMode
No
Yes Loop to
Check Mode? No
mode 3
No Yes
McBSP Boot? Call McBSP_Boot
mode A
Yes Return
M0 Boot?
M0_ENTRY_POINT No
modes 4, 1
EntryAddr: 0x0000
No Yes
I2C Boot? Call I2C_Boot
mode C, 2
No Yes
eCAN Boot? Call eCAN_Boot
mode B, 7
Call
WatchDogDisable
No
A Yes
Parallel I/O? Call Parallel_Boot
mode 6
No
CopyData
Call peripheral-specific
GetWordData to read
BlockHeader.BlockSize
BlockSize= Yes
0x0000 Return
?
No
Call GetLongData
to read
BlockHeader.DestAddr
Transfer
BlockHeader.BlockSize
words of data from
port to memory
starting at DestAddr
The bit rates achieved for different XCLKIN values as shown in Table 7. The SYSCLKOUT values shown
are for the default PLLCR of 0 and PLLSTS[DIVSEL] set to 2.
The host should transmit MSB first and LSB next. For example, to transmit the word 0x10AA to the
device, transmit 10 first, followed by AA. The program flow of the McBSP bootloader is identical to the SCI
bootloader, with the exception that 16-bit data is used. The data sequence for the McBSP bootloader
follows the 16-bit data stream and is shown in Table 8
SCIRXDA
Host
DSP (Data and program
SCITXDA source)
SCI_Boot
Valid No
Setup SCI-A for KeyValue Enable Watchdog
1 stop, 8-bit character, (0x08AA) and force reset
no parity, use internal ?
SC clock, no loopback,
disable Rx/Tx interrupts
Yes
No Autobaud
lock
?
Return
Yes EntryPoint
Data No
SCIA_GetWordData Received
?
Yes
Read LSB
Yes
Read MSB
Echoback MSB
to host Return MSB:LSB
The 28x device first signals the host that it is ready to begin data transfer by pulling the GPIO26 pin low.
The host load then initiates the data transfer by pulling the GPIO27 pin low. The complete protocol is
shown in the diagram below:
Host control
GPIO27
DSP control
GPIO26
1. The 28x device indicates it is ready to start receiving data by pulling the GPIO26 pin low.
2. The bootloader waits until the host puts data on GPIO [15:0]. The host signals to the 28x device that
data is ready by pulling the GPIO27 pin low.
3. The 28x device reads the data and signals the host that the read is complete by pulling GPIO26 high.
4. The bootloader waits until the host acknowledges the 28x by pulling GPIO27 high.
5. The 28x device again indicates it is ready for more data by pulling the GPIO26 pin low.
This process is repeated for each data value to be sent.
Figure 17 shows an overview of the Parallel GPIO bootloader flow.
Parallel_Boot
Valid
No KeyValue
Enable Watchdog
and force reset (0x08AA or
0x10AA)
?
Return
Yes EntryPoint
Figure 18 shows the transfer flow from the host side. The operating speed of the CPU and host are not
critical in this mode as the host will wait for the 28x and the 28x will in turn wait for the host. In this manner
the protocol will work with both a host running faster and a host running slower than the 28x.
Start transfer
No DSP ready
(GPIO26=0)
?
Yes
Signal that data
is ready Acknowledge DSP
(GPIO27=0) (GPIO27=1)
More Yes
data
?
No
End transfer
Figure 19 and Figure 20 show the flow used to read a single word of data from the parallel port. The
loader uses the method shown in Figure 8 to read the key value and to determine if the incoming data
stream width is 8-bit or 16-bit. A different GetWordData function is used by the parallel loader depending
on the data size of the incoming data stream.
• 16-bit data stream
For an 16-bit data stream, the function Parallel_GetWordData16bit is used. This function reads all
16-bits at a time. The flow of this function is shown in Figure 19.
• 8-bit data stream
The 8-bit routine, shown in Figure 20, discards the upper 8 bits of the first read from the port and treats
the lower 8 bits as the least significant byte (LSB) of the word to be fetched. The routine will then
perform a second read to fetch the most significant byte (MSB). It then combines the MSB and LSB
into a single 16-bit value to be passed back to the calling routine.
Parallel_GetWordData16bit
Data
ready No
(GPIO27 = 0)
?
Yes
Host
ack No
(GPIO27 = 1)
?
Yes
Return WordData
Parallel_GetWordData A
8 bit
Data Data
ready No ready No
(GPIO27 = 0) (GPIO27 = 0)
? ?
Yes Yes
Host
ack No
(GPIO27 = 1) Host
? ack No
(GPIO27 = 1)
?
Yes
Yes
WordData = MSB:LSB
A Return WordData
NOTE: This mode loads a stream of data into the SARAM of the device using XINTF resources. If
you instead want to configure and jump to the XINTF then use the "Jump to XINTF x16" boot
mode.
The DSP communicates with the external host device by polling/driving the GPIO13 and GPIO12 lines.
The handshake protocol shown below must be used to successfully transfer each word via the first
address location within XINTF zone 6. This protocol is very robust and allows for a slower or faster host to
communicate with the DSP.
If the 8-bit mode is selected, two consecutive 8-bit words are read to form a single 16-bit word. The most
significant byte (MSB) is read first followed by the least significant byte (LSB). In this case, data is read
from the lower eight lines of XD[7:0] ignoring the higher byte.
To begin the transfer, the DSP will use the default XINTF timing for zone 6. This is the maximum wait
states, slowest XINTF timing available. That is:
1. XTIMCLK = ½ SYSCLKOUT
2. XCLKOUT = 1/4 XTIMCLK
3. XRDLEAD = XWRLEAD = 3
4. XRDACTIVE = XWRACTIVE = 7
5. XRDTRAIL = XWRACTIVE = 3
6. XSIZE = 3 for 16-bit wide
7. X2TIMING = 1. Timing values are 2:1.
8. USEREADY = 1, READYMODE = 1 (XREADY sampled asynchronous mode)
The first 7 words of the data stream are read at this slow timing. Words 2 – 7 include configuration
information that will be used to adjust the PLLCR/PLLSTS and XINTF XTIMING6. The rest of the data
stream is read using the new configuration.
The 16-bit data stream is shown in Table 11 and the 8-bit data stream is shown in Table 12.
Host control
GPIO13
DSP control
GPIO12
1. The 28x device indicates it is ready to start receiving data by pulling the GPIO12 pin low.
2. The bootloader waits until the host puts data on XD[15:0]. The host signals to the 28x device that data
is ready by pulling the GPIO13 pin low.
3. The 28x device reads the data and signals the host that the read is complete by pulling GPIO12 high.
4. The bootloader waits until the host acknowledges the 28x by pulling GPIO13 high.
5. The 28x device again indicates it is ready for more data by pulling the GPIO12 pin low.
This process is repeated for each data value to be sent.
Figure 17 shows an overview of the XINTF Parallel bootloader flow.
XINTF_Parallel_Boot
Read EntryPoint
address
Valid
Enable Watchdog No KeyValue
and force reset (0x08AA or Call
0x10AA) CopyData
?
Yes
Return EntryPoint
Figure 18 shows the transfer flow from the host side. The operating speed of the CPU and host are not
critical in this mode as the host will wait for the 28x and the 28x will in turn wait for the host. In this manner
the protocol will work with both a host running faster and a host running slower then the 28x device.
Start transfer
No DSP ready
(GPIO12=0)
?
Yes
Signal that data
is ready Acknowledge DSP
(GPIO13 = 0) (GPIO13 = 1)
More Yes
data
?
No
End transfer
Figure 19 and Figure 20 show the flow used to read a single word of data from the parallel port. The
loader uses the method shown in Figure 8 to read the key value and to determine if the incoming data
stream width is 8-bit or 16-bit. A different GetWordData function is used by the parallel loader depending
on the data size of the incoming data stream.
• 16-bit data stream
For an 16-bit data stream, the function XINTF_Parallel_GetWordData16bit is used. This function reads
all 16-bits at a time. The flow of this function is shown in Figure 19.
• 8-bit data stream
For an 8-bit data stream, the function XINTF_Parallel_GetWordData8bit is used. The 8-bit routine,
shown in Figure 20, discards the upper 8 bits of the first read from the port and treats the lower 8 bits
as the least significant byte (LSB) of the word to be fetched. The routine will then perform a second
read to fetch the most significant byte (MSB). It then combines the MSB and LSB into a single 16-bit
value to be passed back to the calling routine.
XINTF_Parallel_GetWordData
16 bit
Data
ready No
(GPIO13 = 0)
?
Yes
Host
ack No
(GPIO13 = 1)
?
Yes
Return WordData
XINTF_Parallel_GetWordData A
8 bit
Data Data
ready No ready No
(GPIO13 = 0) (GPIO12 = 0)
? ?
Yes Yes
Host
ack No
(GPIO13 = 1) Host
? ack No
(GPIO12 = 1)
?
Yes
Yes
WordData = MSB:LSB
A Return WordData
Serial SPI
SPISIMOA EEPROM
DIN
28x SPISOMIA
DOUT
SPICLKA
CLK
SPIESTEA
CS
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 or flash
Step 3. The SPI-A outputs a read command for the serial SPI EEPROM or flash
Step 4. The SPI-A sends the serial SPI EEPROM an address 0x0000; that is, the host requires that
the EEPROM or flash must have the downloadable packet starting at address 0x0000 in the
EEPROM or flash. The loader is compatible with both 16-bit addresses and 24-bit addresses.
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 boot loader will enable the watchdog and force a device reset through
software.
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 second 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.
SPI_Boot
Enable EEPROM
Send read command and Read and discard 7
start at EEPROM address reserved words
0x0000
Yes
Read LSB
Yes
Read MSB
Return MSB:LSB
SDAA
28x
Master SCLA
I2C
SDA EEPROM
I2C_Boot
Read EntryPoint
address
Call CopyData
Return
EntryPoint
There are two timing options for the I2C-A bootloader as shown in Table 3. Depending on the input clock
to the system, choose the appropriate loader. The timing differences are:
• I2C TIMING1 loader (boot mode C)
When using TIMING1, the input frequency to the device must be between 28 MHz and 48 MHz. In this
case, the bootloader will set the I2CPSC prescale value to 1 so that the I2C clock will be divided down
from SYSCLKOUT to create a 7 MHz to 12 MHz system clock.
• I2C TIMING2 loader (boot mode 2)
When using TIMING2, the input frequency to the device must be between 14 MHz and 24 MHz. In this
case the bootloader will set the I2CPSC prescale value to 0 so that the I2C clock is between 7 MHz to
12 MHz system clock.
The bit-period prescalers (I2CCLKH and I2CCLKL) are configured by the bootloader to run the I2C at a 50
percent duty cycle at 100-kHz bit rate (standard I2C mode) when the system clock is 12 MHz. These
registers can be modified after receiving the first few bytes from the EEPROM. This allows the
communication to be increased up to a 400-kHz bit rate (fast I2C mode) during the remaining data reads.
Arbitration, bus busy, and slave signals are not checked. Therefore, no other master is allowed to control
the bus during this initialization phase. If the application requires another master during I2C boot mode,
that master must be configured to hold off sending any I2C messages until the application software
signals that it is past the bootloader portion of initialization.
The nonacknowledgment bit is checked only during the first message sent to initialize the EEPROM base
address. This is to make sure that an EEPROM is present at address 0x50 before continuing. If an
EEPROM is not present, code will enable the watchdog and force a device reset through software. The
nonacknowledgment bit is not checked during the address phase of the data read messages (I2C_Get
Word). If a non acknowledgment is received during the data read messages, the I2C bus will hang.
Table 14 shows the 8-bit data stream used by the I2C.
The I2C EEPROM protocol required by the I2C bootloader is shown in Figure 32 and Figure 33. The first
communication, which sets the EEPROM address pointer to 0x0000 and reads the KeyValue (0x08AA)
from it, is shown in Figure 32. All subsequent reads are shown in Figure 33 and are read two bytes at a
time.
NO ACK
START
WRITE
READ
STOP
MSB
MSB
ACK
ACK
ACK
ACK
ACK
LSB
LSB
SDA LINE 1 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 1 0 1 0 0 0 0 10
NO ACK
START
READ
STOP
ACK
ACK
SDA LINE
101000010
28x
CAN bus
CAN
host
28x
There are two timing options for the eCAN bootloader as shown in Table 3 Depending on the input clock
to the system, choose the appropriate loader. Table 15 shows what the bit rate will be depending on the
input clock.
The SYSCLKOUT values shown are the reset values with the default PLL setting. The BRP is hard coded
to 1 for both timing 1 and timing 2 modes. The bit-time values are hard coded to 15 for timing 1 mode and
10 for timing 2 mode respectively.
Mailbox 1 is programmed with a standard MSGID of 0x1 for boot-loader communication. The CAN host
should transmit only 2 bytes at a time, LSB first and MSB next. For example, to transmit the word 0x08AA
to the device, transmit AA first, followed by 08. The program flow of the CAN bootloader is identical to the
SCI bootloader. The data sequence for the CAN bootloader is shown in Table 16:
Reset
InitBoot
Call
SelectBootMode
Call Yes
BootLoader Call Boot Loader
?
No
Call ExitBoot
Cleanup CPU
registers to default
value after reset*
Deallocate stack
(SP=0x400)
Branch to EntryPoint
Begin execution
at EntryPoint
See the TMS320C28x Assembly Language Tools User's Guide (SPRU513) and the TMS320C28x
Optimizing C/C++ Compiler User's Guide (SPRU514) for more information on the compiling and linking
process.
Table 18 summarizes the hex conversion utility options available for the bootloader. See the TMS320C28x
Assembly Language Tools User's Guide (SPRU513) for a detailed description of the hex2000 operations
used to generate a boot table. Updates will be made to support the I2C boot. See the Codegen release
notes for the latest information.
All sections shown in Example 5 that are initialized need to be loaded into the DSP in order for the code to
execute properly. In this case, the codestart, ramfuncs, .cinit, myreset and .text sections need to be
loaded. The other sections are uninitialized and will not be included in the loading process. The map file
also indicates the size of each section and the starting address. For example, the .text section has 0x155
words and starts at 0x3FA000.
output attributes/
section page origin length input sections
-------- ---- ---------- ---------- ----------------
codestart
0 00000000 00000002
00000000 00000002 DSP280x_CodeStartBranch.obj (codestart)
.pinit 0 00000002 00000000
To load the code using the CAN bootloader, the host must send the data in the format that the bootloader
understands. That is, the data must be sent as blocks of data with a size, starting address followed by the
data. A block size of 0 indicates the end of the data. The HEX2000.exe utility can be used to convert the
COFF file into a format that includes this boot information. The following command syntax has been used
to convert the application into an ASCII hex format file that includes all of the required information for the
bootloader:
Where:
- boot Convert all sections into bootable form.
- gpio8 Use the GPIO in 8-bit mode data format. The eCAN
uses the same data format as the GPIO in 8-bit mode.
- a Select ASCII-Hex as the output format.
The command line shown in Example 6 will generate an ASCII-Hex output file called GPIO34TOG.a00,
whose contents are explained in Example 7. This example assumes that the host will be able to read an
ASCII hex format file. The format may differ for your application. . Each section of data loaded can be tied
back to the map file described in Example 5. After the data stream is loaded, the boot ROM will jump to
the Entrypoint address that was read as part of the data stream. In this case, execution will begin at
0x3FA0000.
AA 08 ;Keyvalue
00 00 00 00 00 00 00 00 ;8 reserved words
00 00 00 00 00 00 00 00
3F 00 00 A0 ;Entrypoint 0x003FA000
02 00 ;Load 2 words - codestart section
00 00 00 00 ;Load block starting at 0x000000
7F 00 9A A0 ;Data block 0x007F, 0xA09A
16 00 ;Load 0x0016 words - ramfuncs section
00 00 02 00 ;Load block starting at 0x000002
22 76 1F 76 2A 00 00 1A 01 00 06 CC F0 ;Data = 0x7522, 0x761F etc...
FF 05 50 06 96 06 CC FF F0 A9 1A 00 05
06 96 04 1A FF 00 05 1A FF 00 1A 76 07
F6 00 77 06 00
55 01 ;Load 0x0155 words - .text section
3F 00 00 A0 ;Load block starting at 0x003FA000
AD 28 00 04 69 FF 1F 56 16 56 1A 56 40 ;Data = 0x28AD, 0x4000 etc...
29 1F 76 00 00 02 29 1B 76 22 76 A9 28
18 00 A8 28 00 00 01 09 1D 61 C0 76 18
00 04 29 0F 6F 00 9B A9 24 01 DF 04 6C
04 29 A8 24 01 DF A6 1E A1 F7 86 24 A7
06 .. ..
.. .. ..
.. .. ..
FC 63 E6 6F
19 00 ;Load 0x0019 words - .cinit section
00 00 18 00 ;Load block starting at 0x000018
FF FF 00 B0 3F 00 00 00 FE FF 02 B0 3F ;Data = 0xFFFF, 0xB000 etc...
00 00 00 00 00 FE FF 04 B0 3F 00 00 00
00 00 FE FF .. .. ..
.. .. ..
3F 00 00 00
02 00 ;Load 0x0002 words - myreset section
00 00 32 00 ;Load block starting at 0x000032
00 00 00 00 ;Data = 0x0000, 0x0000
00 00 ;Block size of 0 - end of data
Table 20 shows the boot ROM revision per device. A revision history and code listing for the latest boot
ROM code can be found in Section 4. In addition, a .zip file with each revision of the boot ROM code can
be downloaded at http://www-s.ti.com/sc/techlit/sprufn5.zip
This doc has been revised to include the following technical change(s).
TI PROVIDES TECHNICAL AND RELIABILITY DATA (INCLUDING DATASHEETS), DESIGN RESOURCES (INCLUDING REFERENCE
DESIGNS), APPLICATION OR OTHER DESIGN ADVICE, WEB TOOLS, SAFETY INFORMATION, AND OTHER RESOURCES “AS IS”
AND WITH ALL FAULTS, AND DISCLAIMS ALL WARRANTIES, EXPRESS AND IMPLIED, INCLUDING WITHOUT LIMITATION ANY
IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT OF THIRD
PARTY INTELLECTUAL PROPERTY RIGHTS.
These resources are intended for skilled developers designing with TI products. You are solely responsible for (1) selecting the appropriate
TI products for your application, (2) designing, validating and testing your application, and (3) ensuring your application meets applicable
standards, and any other safety, security, or other requirements. These resources are subject to change without notice. TI grants you
permission to use these resources only for development of an application that uses the TI products described in the resource. Other
reproduction and display of these resources is prohibited. No license is granted to any other TI intellectual property right or to any third
party intellectual property right. TI disclaims responsibility for, and you will fully indemnify TI and its representatives against, any claims,
damages, costs, losses, and liabilities arising out of your use of these resources.
TI’s products are provided subject to TI’s Terms of Sale (www.ti.com/legal/termsofsale.html) or other applicable terms available either on
ti.com or provided in conjunction with such TI products. TI’s provision of these resources does not expand or otherwise alter TI’s applicable
warranties or warranty disclaimers for TI products.
Mailing Address: Texas Instruments, Post Office Box 655303, Dallas, Texas 75265
Copyright © 2019, Texas Instruments Incorporated