From e50e2f8c62a262c6ee109204b30b485a5bb3c074 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Thu, 18 Nov 2010 23:55:58 +0100 Subject: simtrace: Commit Makefile changes to support build of simtrace WARNING These changes will enable the simtrace firmware to be built like this: make -f Makefile.dfu BOARD=OLIMEX make BOARD=SIMTRACE DEBUG=1 TARGET=main_simtrace --- firmware/Makefile | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'firmware/Makefile') diff --git a/firmware/Makefile b/firmware/Makefile index 08126c1..9b75b3a 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -42,8 +42,8 @@ FLASH_TOOL = AT91FLASH # MCU name and submodel MCU = arm7tdmi -#SUBMDL = AT91SAM7S64 -SUBMDL = AT91SAM7S128 +SUBMDL = AT91SAM7S64 +#SUBMDL = AT91SAM7S128 USE_THUMB_MODE = NO #USE_THUMB_MODE = YES @@ -70,7 +70,7 @@ PATH_TO_LINKSCRIPTS=link/ # Target file name (without extension). TARGET:=main_reqa -USBSTRINGS=src/picc/usb_strings_app.h src/pcd/usb_strings_app.h +USBSTRINGS=src/picc/usb_strings_app.h src/pcd/usb_strings_app.h src/simtrace/usb_strings_app.h # List C source files here. (C dependencies are automatically generated.) # use file-extension c for "c-only"-files @@ -112,6 +112,11 @@ SRCARM += src/picc/tc_fdt.c src/picc/ssc_picc.c src/picc/adc.c \ SRCARM += src/picc/$(TARGET).c endif +ifeq ($(BOARD), SIMTRACE) +SRCARM += src/simtrace/iso7816_uart.c src/simtrace/tc_etu.c +SRCARM += src/simtrace/$(TARGET).c +endif + # List C++ source files here. # use file-extension cpp for C++-files (use extension .cpp) @@ -202,6 +207,12 @@ CDEFS += -DPCD CINCS = -Isrc/pcd endif +ifeq ($(BOARD),SIMTRACE) +CDEFS += -DSIMTRACE +CINCS = -Isrc/simtrace +endif + + # Place -I options here CINCS += -Iinclude -Isrc -- cgit v1.2.3 From ff741ee31fe2a6b25f8f7fcfb1397bb0c82616d6 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Thu, 16 Jun 2011 21:00:02 +0200 Subject: simtrace: add more definitions regarding real hw prototype --- firmware/Makefile | 2 ++ 1 file changed, 2 insertions(+) (limited to 'firmware/Makefile') diff --git a/firmware/Makefile b/firmware/Makefile index 9b75b3a..57c983e 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -113,6 +113,8 @@ SRCARM += src/picc/$(TARGET).c endif ifeq ($(BOARD), SIMTRACE) +SUBMDL = AT91SAM7S256 +TARGET := main_simtrace SRCARM += src/simtrace/iso7816_uart.c src/simtrace/tc_etu.c SRCARM += src/simtrace/$(TARGET).c endif -- cgit v1.2.3 From cda126a7ef6fbb54a18a4786c15117800a13f7b3 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Thu, 16 Jun 2011 21:16:13 +0200 Subject: simtrace: add support for the analog bus switch --- firmware/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'firmware/Makefile') diff --git a/firmware/Makefile b/firmware/Makefile index 57c983e..9a95d44 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -115,7 +115,8 @@ endif ifeq ($(BOARD), SIMTRACE) SUBMDL = AT91SAM7S256 TARGET := main_simtrace -SRCARM += src/simtrace/iso7816_uart.c src/simtrace/tc_etu.c +SRCARM += src/simtrace/iso7816_uart.c src/simtrace/tc_etu.c \ + src/simtrace/sim_switch.c SRCARM += src/simtrace/$(TARGET).c endif -- cgit v1.2.3 From dda0896d875ec2d33b6de94df818a2f94526272b Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sat, 30 Jul 2011 00:34:59 +0200 Subject: use gcc/ld flags -ffunction-sections and --gc-sections This will discard unused functions from the resulting binary --- firmware/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'firmware/Makefile') diff --git a/firmware/Makefile b/firmware/Makefile index 9a95d44..b085c33 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -249,7 +249,7 @@ CFLAGS += -Wredundant-decls -Wreturn-type -Wshadow CFLAGS += -Wbad-function-cast -Wsign-compare -Waggregate-return CFLAGS += -Wa,-adhlns=$(subst $(suffix $<),.lst,$<) CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) -#CFLAGS += -ffunction-sections -fdata-sections +CFLAGS += -ffunction-sections -fdata-sections # flags only for C CONLYFLAGS += -Wnested-externs @@ -315,7 +315,7 @@ LDFLAGS += -lc -lgcc LDFLAGS += $(CPLUSPLUS_LIB) LDFLAGS += $(patsubst %,-L%,$(EXTRA_LIBDIRS)) LDFLAGS += $(patsubst %,-l%,$(EXTRA_LIBS)) -#LDFLAGS += --gc-sections +LDFLAGS += -Wl,--gc-sections -Wl,--entry=_startup # Set Linker-Script Depending On Selected Memory and Controller ifeq ($(RUN_MODE),RUN_FROM_RAM) -- cgit v1.2.3 From 5a8cd9feca7d0d09aee736ff804be4967828aefd Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sat, 30 Jul 2011 00:37:04 +0200 Subject: add new RUN_FROM_RAM run-mode for direct DFU-to-RAM support --- firmware/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'firmware/Makefile') diff --git a/firmware/Makefile b/firmware/Makefile index b085c33..68ff85f 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -49,7 +49,7 @@ USE_THUMB_MODE = NO #USE_THUMB_MODE = YES ## Create ROM-Image (final) -RUN_MODE=RUN_FROM_ROM +RUN_MODE:=RUN_FROM_ROM ## Create RAM-Image (debugging) - not used in this example #RUN_MODE=RUN_FROM_RAM @@ -319,7 +319,7 @@ LDFLAGS += -Wl,--gc-sections -Wl,--entry=_startup # Set Linker-Script Depending On Selected Memory and Controller ifeq ($(RUN_MODE),RUN_FROM_RAM) -LDFLAGS +=-T$(PATH_TO_LINKSCRIPTS)$(SUBMDL)-RAM.ld +LDFLAGS +=-T$(PATH_TO_LINKSCRIPTS)$(SUBMDL)-RAM$(IMGTYPE).ld else LDFLAGS +=-T$(PATH_TO_LINKSCRIPTS)$(SUBMDL)-ROM$(IMGTYPE).ld endif -- cgit v1.2.3 From 9f120cdf57b9dc2ca8112cbb89587f77df4facd2 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sat, 30 Jul 2011 00:38:20 +0200 Subject: Makefile: SIMtrace uses SAM7S128, not 256 --- firmware/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'firmware/Makefile') diff --git a/firmware/Makefile b/firmware/Makefile index 68ff85f..1f2f7ed 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -113,7 +113,7 @@ SRCARM += src/picc/$(TARGET).c endif ifeq ($(BOARD), SIMTRACE) -SUBMDL = AT91SAM7S256 +SUBMDL = AT91SAM7S128 TARGET := main_simtrace SRCARM += src/simtrace/iso7816_uart.c src/simtrace/tc_etu.c \ src/simtrace/sim_switch.c -- cgit v1.2.3 From de0d7e35eed67bab478fda9eee7cb9edb1f34f04 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sat, 30 Jul 2011 00:39:22 +0200 Subject: simtrace: add some early spi flash utility routines This also adds a new 'main_factory' target for simtrace --- firmware/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'firmware/Makefile') diff --git a/firmware/Makefile b/firmware/Makefile index 1f2f7ed..3f7a2e9 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -116,7 +116,7 @@ ifeq ($(BOARD), SIMTRACE) SUBMDL = AT91SAM7S128 TARGET := main_simtrace SRCARM += src/simtrace/iso7816_uart.c src/simtrace/tc_etu.c \ - src/simtrace/sim_switch.c + src/simtrace/sim_switch.c src/simtrace/spi_flash.c SRCARM += src/simtrace/$(TARGET).c endif -- cgit v1.2.3