From d75d9d98f59898a206e173854f1b24eb92083302 Mon Sep 17 00:00:00 2001 From: Mariano Alvira Date: Wed, 15 Apr 2009 13:40:21 -0400 Subject: [PATCH] This makefile seems to do better. --- Makefile | 10 +++++----- tests/nvm-read.c | 16 +++++++++++----- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index dba449c52..ef7d7d188 100644 --- a/Makefile +++ b/Makefile @@ -46,7 +46,7 @@ AOBJS = COBJS = $(patsubst %.c,%.o,$(wildcard src/*.c)) TESTS = $(wildcard tests/*.c) TARGETS = $(patsubst %.c,%.o,$(TESTS)) - +#TARGETS = tests/blink-white.o # Add GCC lib PLATFORM_LIBS += --no-warn-mismatch -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc @@ -54,11 +54,11 @@ PLATFORM_LIBS += --no-warn-mismatch -L $(shell dirname `$(CC) $(CFLAGS) -print-l ######################################################################### #ALL = blink.srec blink.bin blink.dis blink.System.map -ALL = $(TARGETS) $(TESTS:.c=.srec) $(TESTS:.c=.bin) $(TESTS:.c=.dis) +ALL = $(TESTS:.c=.srec) $(TESTS:.c=.bin) $(TESTS:.c=.dis) .PRECIOUS: $(COBJS) $(TARGETS) $(TESTS:.c=.obj) -all: $(COBJS) $(ALL) +all: $(ALL) %.srec: %.obj $(OBJCOPY) ${OBJCFLAGS} -O srec $< $@ @@ -73,9 +73,9 @@ all: $(COBJS) $(ALL) $(OBJDUMP) -DS $< > $@ %.obj: $(AOBJS) $(COBJS) $(TARGETS) $(LDSCRIPT) - $(LD) $(LDFLAGS) $(AOBJS) $(COBJS) \ + $(LD) $(LDFLAGS) $(AOBJS) \ --start-group $(PLATFORM_LIBS) --end-group \ - -Map $*.map $*.o -o $@ + -Map $*.map $*.o $< -o $@ %.System.map: %.obj diff --git a/tests/nvm-read.c b/tests/nvm-read.c index 3bf208aff..b14677663 100644 --- a/tests/nvm-read.c +++ b/tests/nvm-read.c @@ -31,7 +31,7 @@ const uint8_t hex[16]={'0','1','2','3','4','5','6','7', __attribute__ ((section ("startup"))) void main(void) { uint8_t c; - nvmType_t type; + uint32_t type; nvmErr_t err; *(volatile uint32_t *)GPIO_PAD_DIR0 = 0x00000100; @@ -53,14 +53,20 @@ void main(void) { reg(UART1_CON) = 0x00000003; /* enable receive and transmit */ reg(GPIO_FUNC_SEL0) = ( (0x01 << (14*2)) | (0x01 << (15*2)) ); /* set GPIO15-14 to UART (UART1 TX and RX)*/ + vreg_init(); + + puts("CRM status: 0x"); + put_hex32(reg(0x80003018)); + puts("\n\r"); + puts("Detecting internal nvm\n\r"); err = nvm_detect(gNvmInternalInterface_c, &type); - puts("nvm_detect returned: "); - putc(err); - puts(" type is: "); - putc(type); + puts("nvm_detect returned: 0x"); + put_hex(err); + puts(" type is: 0x"); + put_hex(type); puts("\n\r"); while(1) {