CCS compiled without errors. The EVM is set for "no boot process". After loading and beginning execution, stopping the execution (or using a breakpoint) shows that .main is never reached. It is stuck in a loop involving .memcpy.
Here is the program:
/*
The "CHIP_6701" symbol is set by the user in the "C6000 Compiler" window (in the
"Tool Settings" tab under "Build Properties") when creating the workspace & project setups
*/
#include <csl.h>
#include <csl_timer.h>
void TimerEventHandler(void);
TIMER_Handle hTimer1;
Uint32 Timer1_delta;
Uint32 Timer1_busy;
Uint32 Timer1_count;
Uint32 Timer1_count_old;
Uint32 Loop_count;
/*----------------------------------------------------------------------------*/
static Uint32 TimerControl = TIMER_CTL_RMK(
/* Timer control register (CTL)(TSTAT)*/
TIMER_CTL_INVINP_NO, /* TINP inverter control(INVINP). Only affects operation
if CLKSRC =0.
TIMER_CTL_INVINP_NO - Uninverted TINP drives timer
TIMER_CTL_INVINP_YES - inverted TINP drives timer */
TIMER_CTL_CLKSRC_CPUOVR4, /* Timer input clock source (CLKSRC)
TIMER_CTL_CLKSRC_CPUOVR4 - CPU clock /4 */
TIMER_CTL_CP_PULSE, /* Clock/pulse mode(CP)
TIMER_CTL_CP_PULSE - Pulse mode.TSTAT is active one
CPU clock after the timer reaches the timer
p13 period.PWID determines when it goes inactive.*/
TIMER_CTL_HLD_YES, /* ?Hold(HLD). Counter may be read or written regardless of
HLD value.
TIMER_CTL_HLD_YES - Counter is disabled and held in
current value.
TIMER_CTL_HLD_NO - COunter is allowed to count. */
TIMER_CTL_GO_NO, /* Go bit(GO). Resets and starts the timer counter.
TIMER_CTL_GO_NO - No effects on the timer.
TIMER_CTL_GO_YES - if HLD =1, the counter register
is zeroed and begins counting on next clock. */
TIMER_CTL_PWID_ONE, /* Pulse width(PWID). Only used in pulse mode.
TIMER_CTL_PWID_ONE - TSTAT goes inactive one timer
input clock cycle after the timer counter value
equals the timer period value.
TIMER_CTL_PWID_TWO - TSTAT goes inactive two timer
input clock cycles after the timer counter value
equals the timer period value. */
/*TIMER_CTL_DATIN,*/
TIMER_CTL_DATOUT_0, /* Data output (DATOUT).
TIMER_CTL_DATOUT_0 - If FUNC =0,the DATOUT is
driven on TOUT.
TIMER_CTL_DATOUT_1 - If FUNC =1,The DATOUT is driven
on TOUT after inversion by INVOUT. */
TIMER_CTL_INVOUT_NO, /* TOUT inverter control (INVOUT)
TIMER_CTL_INVOUT_NO - Uninverted TSTAT drives TOUT
TIMER_CTL_INVOUT_YES - Inverted TSTAT drives TOUT.*/
TIMER_CTL_FUNC_GPIO /* Function of TOUT pin(FUNC).
TIMER_CTL_FUNC_GPIO - TOU is a general purpose
output pin
TIMER_CTL_FUNC_TOUT - TOUT is a timer output pin */
);
void main()
{
/* Must initialize the Chip Support Library (CSL) before using it */
CSL_init();
/* Open TIMER1 device and reset it to power-on default state */
hTimer1 = TIMER_open(TIMER_DEV1, TIMER_OPEN_RESET);
/* Get the event ID for TIMER1 */
/* TimerEventId1 = TIMER_getEventId(hTimer1);
*/
/* Configure the timer devices */
TIMER_configArgs(hTimer1,
TimerControl, /* use predefined control value */
0xFFFFFFFF, /* set period */
0x00000000 /* start count value at zero */
);
/* Start the timers */
TIMER_start(hTimer1);
Timer1_busy = TRUE;
Timer1_count_old = 0;
Timer1_delta = 0;
Loop_count = 0;
while (Timer1_busy) /* Do forever */
{
Timer1_count = TIMER_getCount(hTimer1);
Timer1_delta = Timer1_count - Timer1_count_old;
Timer1_count_old = Timer1_count;
Loop_count = Loop_count + 1;
};
/* Stop the timer */
TIMER_pause(hTimer1);
TIMER_close(hTimer1);
}