Hi all,

We are having a very strange problem here. We mede de Olimex parallel
Jtag programmer. We have a custom made board, with just a msp430F149,
the regulator and 8 leds in port 6. We made a simple led test program
(see attached), we compiled it, and the we write it using our Jtag
programmer.

All go well, leds blink and all happy.

But, now, we couldn't access JTAG.

This happend with 2 board, the same steps, the same result.

Any one have some idea of what could be happening?

Thanks in advance,
BR,
fede.-
#include <io.h>

int main(void) {

  P6DIR=0xFF;  /* Configure all pins on port 2 as outputs. */
  P6OUT=0x22;  

  for(;;) {
    /* The following two lines implement a very crude delay loop.
       The actual length of the delay can vary significantly.
       This approach may not work with all compilers. */
    volatile int i;        /* Declare "i" as volatile ... */
    for(i=0;i<20000;i++);  /* ... so that this loop will not be optimized. */

    P6OUT=~P6OUT;          /* Toggle the state of all pins on port 2.  Every
                           pin that is high will be set low, and every
                           pin that is low will be set high.  */
  }

}
#
# Template Makefile for msp430
#
# 'make' builds TARGET
# 'make clean' deletes everything except source files and Makefile
# 'make program' erases and programs flash on msp430 with TARGET, then resets it.
# 'make reset' resets the msp430
# 'make foo.lst' makes an assembler listing of foo.c

# You need to set TARGET, MCU and SOURCES for your project.
# TARGET is the name of the executable file to be produced (.elf)
# eg if TARGET is foo.elf, then foo.elf will be produced, which can be programmed
#    into the msp430 flash by typing 'make program'

TARGET   = primer.elf
MCU      = msp430x149
#MCU             = msp430x1121


# List all the source files here
# eg if you have a source file foo.c then list it here
SOURCES = main.c


# use lines like those below to include your own libraries and standard include files.
# Changing a library won't cause a rebuild - use make clean then make.
# this will link libboard430.a (use LIBPATH to say where it is, and take care of the order):
#LIBS = -lcc2420 -lboard430

# paths to extra libraries and extra standard includes
#ROOTPATH = ../..
#LIBPATH = -L$(ROOTPATH)/lib
#INCLUDES = -I$(ROOTPATH)/include


# You probably don't need to change anything below this line.
#######################################################################################
#CFLAGS   = -mmcu=$(MCU) -g -O3 -Wall -Wcast-align -Wcast-qual -Wimplicit \
#	   -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
#	   -Wpointer-arith -Wredundant-decls -Wreturn-type -Wshadow \
#	   -Wstrict-prototypes -Wswitch -Wunused $(INCLUDES)
#CFLAGS   = -mmcu=$(MCU) -g -O3 -Wall -Wcast-align -Wcast-qual -Wimplicit \
	   -Wmissing-declarations -Wnested-externs \
	   -Wpointer-arith -Wredundant-decls -Wreturn-type -Wshadow \
	   -Wstrict-prototypes -Wswitch -Wunused $(INCLUDES)
CFLAGS   = -mmcu=${MCU} -O2 -Wall -g
ASFLAGS  = -mmcu=$(MCU) -x assembler-with-cpp -Wa,-gstabs
LDFLAGS  = -mmcu=$(MCU) -Wl $(LIBPATH)

########################################################################################

CC       = msp430-gcc
LD       = msp430-ld
AR       = msp430-ar
AS       = msp430-gcc
GASP     = msp430-gasp
NM       = msp430-nm
OBJCOPY  = msp430-objcopy
RANLIB   = msp430-ranlib
STRIP    = msp430-strip
SIZE     = msp430-size
READELF  = msp430-readelf
CP       = cp -p
RM       = rm -f
MV       = mv

#Linux jtag program
JTAGPROG = jtag.py

#Windows jtag program
#JTAGPROG = msp430-jtag

PROGRAM  = $(JTAGPROG) -mEpv
RESET    = $(JTAGPROG) -r
########################################################################################

# the file which will include dependencies
DEPEND = $(TARGET:.elf=.d)

# all the object files
OBJECTS = $(SOURCES:.c=.o)

$(TARGET): $(OBJECTS) Makefile
	$(CC) $(OBJECTS) $(LDFLAGS) $(LIBS) -o $@

# rule for making assembler source listing, to see the code
%.lst : %.c
	$(CC) -c $(CFLAGS) -Wa,-anlhd $< > $@

# include the dependencies
-include $(DEPEND)

# dependencies file
# includes also considered, since some of these are our own
# (otherwise use -MM instead of -M)
$(DEPEND): $(SOURCES) Makefile
	$(CC) -M ${CFLAGS} $(SOURCES) >$@


.PHONY:	clean
clean:
	-$(RM) $(OBJECTS)
	-$(RM) $(TARGET)
	-$(RM) $(SOURCES:.c=.lst)
	-$(RM) $(DEPEND)	

.PHONY: program
program: $(TARGET)
	$(PROGRAM) $(TARGET)

.PHONY: reset
reset:
	$(RESET)

Reply via email to