I am successfully using the 2004-11-12 mspgcc-win32 release to debug
msp430f149 devices using gdb and gdbproxy. I am also successfully using
most of the debugger functionality on 1611 devices. However, on 1611
devices when 'ctrl-c' is used at the gdb prompt to interrupt a running
program, the program is unable to 'continue' properly. It appears that the
'continue' does not restart the SMCLK and MCLK.
For simplicity, I am running the blinking led demo program on a TI
development board with the 32 kHz watch crystal in place and powered by the
TI FET. The program is modified to output the ACLK, SMCLK, and MCLK to I/O
pins. On both 149 and 1611 devices, 'ctrl-c' stops the SMCLK and MCLK
(probed at the pins). On the 149 devices, 'continue' restarts these clocks
and the led begins blinking again, but on the 1611 devices it does not. The
debugger is still functional on the 1611 as I can read variables, dump
memory, single step, etc., but the led never blinks as the SMCLK-based
timerA never counts. A 'monitor reset' fixes the situation, but this forces
the program to restart rather than continue execution.
The problem does not exist when a breakpoint is hit. With a breakpoint, the
MCLK and SMCLK appear to keep running even while the program is stopped and
'continue' can work just fine. Why do these clocks stop with 'ctrl-c' and
not breakpoints? I have found that these clocks do not stop running with
the IAR tools when the program is stopped, and the program can continue just
fine. However, I really would like to switch to GCC/Eclipse.
Any help is greatly appreciated. My source file, makefile, and gdb.ini
configuration file are included below.
Duane
fet140_ta01_GCC.c
----------------------
#include <signal.h>
#include <io.h>
int main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
TACTL = TASSEL1 + TACLR; // SMCLK, clear TAR
P1DIR |= 0x01; // P1.0 output
TACTL |= MC1; // Start Timer_A in continuous mode
TACCTL0 = 0;
P5DIR |= BIT6 + BIT5 + BIT4;
P5SEL |= BIT6 + BIT5 + BIT4;
for (;;)
{
TACCR0 = TAR + 40000;
while (!(TACCTL0 & CCIFG))
{
_NOP();
_NOP();
}
TACCTL0 &= ~CCIFG;
P1OUT ^= 0x01;
}
return 0;
}
makefile
---------------------------------
CC=msp430-gcc
CFLAGS= -g -O2 -mmcu=msp430x1611
#CFLAGS= -g -O2 -mmcu=msp430x149
PROGS = \
fet140_ta01_GCC
all: $(PROGS)
build: $(PROGS)
clean:
-rm -f $(PROGS)
gdb.ini
------------------------------
set remoteaddresssize 16
set remotetimeout 999999
target remote localhost:2000
monitor erase all
load fet140_ta01_GCC
add-symbol-file fet140_ta01_GCC
monitor reset