From 56d0dfdc7a6590d13c878c4f33f90d77fd554bd0 Mon Sep 17 00:00:00 2001 From: Ian Martin Date: Wed, 2 Apr 2014 18:17:49 -0400 Subject: [PATCH 1/2] CC2538: Add a Makefile rule to generate a final assembly listing. --- cpu/cc2538/Makefile.cc2538 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cpu/cc2538/Makefile.cc2538 b/cpu/cc2538/Makefile.cc2538 index bc39b6e3e..2294354c4 100644 --- a/cpu/cc2538/Makefile.cc2538 +++ b/cpu/cc2538/Makefile.cc2538 @@ -3,6 +3,7 @@ CPP = arm-none-eabi-cpp LD = arm-none-eabi-gcc AR = arm-none-eabi-ar OBJCOPY = arm-none-eabi-objcopy +OBJDUMP = arm-none-eabi-objdump NM = arm-none-eabi-nm ifndef SOURCE_LDSCRIPT @@ -19,6 +20,7 @@ LDFLAGS += -T $(LDSCRIPT) LDFLAGS += -Wl,--gc-sections,--sort-section=alignment LDFLAGS += -Wl,-Map=$(@:.elf=-$(TARGET).map),--cref,--no-warn-mismatch OBJCOPY_FLAGS += -O binary --gap-fill 0xff +OBJDUMP_FLAGS += --disassemble --source --disassembler-options=force-thumb ### Are we building with code size optimisations? ifeq ($(SMALL),1) @@ -82,6 +84,9 @@ CUSTOM_RULE_LINK=1 %.bin: %.elf $(OBJCOPY) $(OBJCOPY_FLAGS) $< $@ +%.lst: %.elf + $(OBJDUMP) $(OBJDUMP_FLAGS) $< > $@ + ### We don't really need the .hex and .bin for the .$(TARGET) but let's make ### sure they get built %.$(TARGET): %.elf %.hex %.bin From 23a3a7f004c343c18b1a38a9dac790259f225965 Mon Sep 17 00:00:00 2001 From: Ian Martin Date: Wed, 16 Apr 2014 10:47:01 -0400 Subject: [PATCH 2/2] Add a note about "make cc2538-demo.lst" to the platform README. --- platform/cc2538dk/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platform/cc2538dk/README.md b/platform/cc2538dk/README.md index 04941fddd..786ea928f 100644 --- a/platform/cc2538dk/README.md +++ b/platform/cc2538dk/README.md @@ -244,6 +244,8 @@ If you want to upload the compiled firmware to a node via the serial boot loader For the `cc2538-demo`, the comments at the top of `cc2538-demo.c` describe in detail what the example does. +To generate an assembly listing of the compiled firmware, run `make cc2538-demo.lst`. This may be useful for debugging or optimizing your application code. To intersperse the C source code within the assembly listing, you must instruct the compiler to include debugging information by adding `CFLAGS += -g` to the project Makefile and rebuild by running `make clean cc2538-demo.lst`. + Node IEEE/RIME/IPv6 Addresses -----------------------------