From 974850cdf263636fb54fe9f8c7d5d0711fb84deb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Th=C3=A9baudeau?= Date: Thu, 31 Oct 2013 16:25:27 +0100 Subject: [PATCH 1/3] cc2538: Generate .hex output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ELF files generated by GCC make SmartRF Flash Programmer 2 crash (only the TI format is supported by this tool for ELFs), and binary files are not very appropriate because they are gapless, so generate Intel HEX files since these are very well supported by most programming tools while still flexible. Signed-off-by: Benoît Thébaudeau --- cpu/cc2538/Makefile.cc2538 | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/cpu/cc2538/Makefile.cc2538 b/cpu/cc2538/Makefile.cc2538 index ad54c59e8..073de35bb 100644 --- a/cpu/cc2538/Makefile.cc2538 +++ b/cpu/cc2538/Makefile.cc2538 @@ -27,7 +27,7 @@ ifdef NODEID endif ### CPU-dependent cleanup files -CLEAN += symbols.c symbols.h *.d *.elf +CLEAN += symbols.c symbols.h *.d *.elf *.hex ### CPU-dependent directories CONTIKI_CPU_DIRS = . dev usb @@ -54,7 +54,7 @@ CONTIKI_SOURCEFILES += $(CONTIKI_CPU_SOURCEFILES) $(DEBUG_IO_SOURCEFILES) CONTIKI_SOURCEFILES += $(USB_CORE_SOURCEFILES) $(USB_ARCH_SOURCEFILES) ### Don't treat the .elf as intermediate -.PRECIOUS: %.elf %.bin +.PRECIOUS: %.elf %.hex %.bin ### Always re-build ieee-addr.o in case the command line passes a new NODEID FORCE: @@ -70,12 +70,15 @@ CUSTOM_RULE_LINK=1 $(TRACE_LD) $(Q)$(LD) $(LDFLAGS) ${filter-out $(LDSCRIPT) %.a,$^} ${filter %.a,$^} -o $@ +%.hex: %.elf + $(OBJCOPY) -O ihex $< $@ + %.bin: %.elf $(OBJCOPY) $(OBJCOPY_FLAGS) $< $@ -### We don't really need the .bin for the .$(TARGET) but let's make sure it -### gets built -%.$(TARGET): %.elf %.bin +### We don't really need the .hex and .bin for the .$(TARGET) but let's make +### sure they get built +%.$(TARGET): %.elf %.hex %.bin cp $< $@ ### This rule is used to generate the correct linker script From a7d10ce2ad6aa55b7fb5a6c702f96d8308282312 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Th=C3=A9baudeau?= Date: Tue, 29 Oct 2013 14:14:35 +0100 Subject: [PATCH 2/3] cc2538: Make it possible to use a custom linker script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Benoît Thébaudeau --- cpu/cc2538/Makefile.cc2538 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cpu/cc2538/Makefile.cc2538 b/cpu/cc2538/Makefile.cc2538 index 073de35bb..103e177fc 100644 --- a/cpu/cc2538/Makefile.cc2538 +++ b/cpu/cc2538/Makefile.cc2538 @@ -5,6 +5,9 @@ AR = arm-none-eabi-ar OBJCOPY = arm-none-eabi-objcopy NM = arm-none-eabi-nm +ifndef SOURCE_LDSCRIPT +SOURCE_LDSCRIPT = $(CONTIKI_CPU)/cc2538.lds +endif LDSCRIPT = $(OBJECTDIR)/cc2538.ld CFLAGS += -O2 -mcpu=cortex-m3 -mthumb -mlittle-endian @@ -88,6 +91,6 @@ LDGENFLAGS += -imacros "contiki-conf.h" LDGENFLAGS += -x c -P -E # NB: Assumes LDSCRIPT was not overridden and is in $(OBJECTDIR) -$(LDSCRIPT): $(CONTIKI_CPU)/cc2538.lds FORCE | $(OBJECTDIR) +$(LDSCRIPT): $(SOURCE_LDSCRIPT) FORCE | $(OBJECTDIR) $(TRACE_CC) $(Q)$(CC) $(LDGENFLAGS) $< -o $@ From 6452624120d1ad2af1fcb244b7713077cec13c26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Th=C3=A9baudeau?= Date: Thu, 31 Oct 2013 17:52:58 +0100 Subject: [PATCH 3/3] cc2538dk: Make it possible to override UIP_CONF_TCP_MSS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Benoît Thébaudeau --- platform/cc2538dk/contiki-conf.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platform/cc2538dk/contiki-conf.h b/platform/cc2538dk/contiki-conf.h index a2a23eca3..86e8bd3fc 100644 --- a/platform/cc2538dk/contiki-conf.h +++ b/platform/cc2538dk/contiki-conf.h @@ -318,7 +318,9 @@ typedef uint32_t rtimer_clock_t; #ifndef UIP_CONF_TCP #define UIP_CONF_TCP 1 #endif +#ifndef UIP_CONF_TCP_MSS #define UIP_CONF_TCP_MSS 64 +#endif #define UIP_CONF_UDP 1 #define UIP_CONF_UDP_CHECKSUMS 1 #define UIP_CONF_ICMP6 1