www.ti.com
Bootloader Code Listing (V3.0)
CLRC OVM
; Set PM shift of 0
SPM 0
; Decide which boot mode to use
LCR
_SelectBootMode
; Cleanup and exit.
At this point the EntryAddr
; is located in the ACC register
BF
_ExitBoot,UNC
;-----------------------------------------------
; _ExitBoot
;-----------------------------------------------
;-----------------------------------------------
;This module cleans up after the boot loader
;
; 1) Make sure the stack is deallocated.
;
SP = 0x400 after exiting the boot
;
loader
; 2) Push 0 onto the stack so RPC will be
;
0 after using LRETR to jump to the
;
entry point
; 2) Load RPC with the entry point
; 3) Clear all XARn registers
; 4) Clear ACC, P and XT registers
; 5) LRETR - this will also clear the RPC
;
register since 0 was on the stack
;-----------------------------------------------
_ExitBoot:
;-----------------------------------------------
;
Insure that the stack is deallocated
;-----------------------------------------------
MOV SP,#__stack
;-----------------------------------------------
; Clear the bottom of the stack.
This will end up
; in RPC when you are finished
;-----------------------------------------------
MOV
*SP++,#0
MOV
*SP++,#0
;-----------------------------------------------
; Load RPC with the entry point as determined
; by the boot mode.
This address will be returned
; in the ACC register.
;-----------------------------------------------
PUSH ACC
POP
RPC
;-----------------------------------------------
; Put registers back in their reset state.
;
; Clear all the XARn, ACC, XT, and P and DP
; registers
;
; NOTE: Leave the device in C28x operating mode
60
Bootloader Code Overview
SPRU722C – November 2004 – Revised October 2006