www.ti.com
Bootloader Code Listing (V3.0)
// TI File $Revision: /main/7 $
// Checkin $Date: January 20, 2005
10:05:26 $
//###########################################################################
//
// FILE:
CAN_Boot.c
//
// TITLE:
280x CAN Boot mode routines
//
// Functions:
//
//
Uint32 CAN_Boot(void)
//
void CAN_Init(void)
//
Uint32 CAN_GetWordData(void)
//
// Notes:
// BRP = 2, Bit time = 10. This would yield the following bit rates with the
// default PLL setting:
// XCLKIN = 40 MHz
SYSCLKOUT = 20 MHz
Bit rate = 1 Mbits/s
// XCLKIN = 20 MHz
SYSCLKOUT = 10 MHz
Bit rate = 500 kbits/s
// XCLKIN = 10 MHz
SYSCLKOUT =
5 MHz
Bit rate = 250 kbits/s
// XCLKIN =
5 MHz
SYSCLKOUT = 2.5MHz
Bit rate = 125 kbits/s
//###########################################################################
// $TI Release:$
// $Release Date:$
//###########################################################################
#include "DSP280x_Device.h"
#include "280x_Boot.h"
// Private functions
void CAN_Init(void);
Uint16 CAN_GetWordData(void);
// External functions
extern void CopyData(void);
extern Uint32 GetLongData(void);
extern void ReadReservedFn(void);
//#################################################
// Uint32 CAN_Boot(void)
//--------------------------------------------
// This module is the main CAN boot routine.
// It will load code via the CAN-A port.
//
// It will return a entry point address back
// to the InitBoot routine which in turn calls
// the ExitBoot routine.
//--------------------------------------------
Uint32 CAN_Boot()
{
Uint32 EntryAddr;
// If the missing clock detect bit is set, just
// loop here.
if(SysCtrlRegs.PLLSTS.bit.MCLKSTS == 1)
{
for(;;);
}
// Assign GetWordData to the CAN-A version of the
// function.
GetWordData is a pointer to a function.
GetWordData = CAN_GetWordData;
CAN_Init();
82
Bootloader Code Overview
SPRU722C – November 2004 – Revised October 2006