summaryrefslogtreecommitdiff
path: root/atmel-samd/Makefile
diff options
context:
space:
mode:
authorScott Shawcroft <scott@chickadee.tech>2016-10-04 16:13:33 -0700
committerScott Shawcroft <scott@chickadee.tech>2016-10-04 16:13:33 -0700
commit1fa4c20c27264e55b3442fe49bee2078a4516fa6 (patch)
treef18b1c2681f4e325e4009329d17a01a7a7275c7e /atmel-samd/Makefile
parent98458c56cc8801dce62866199541bcfcdb6ae26a (diff)
atmel-samd: Add Micro Trace Buffer support to the debug build.
The Micro Trace Buffer records the history of the pc and can be used to debug hard faults even when the stack trace is useless.
Diffstat (limited to 'atmel-samd/Makefile')
-rw-r--r--atmel-samd/Makefile4
1 files changed, 3 insertions, 1 deletions
diff --git a/atmel-samd/Makefile b/atmel-samd/Makefile
index 525d8c226..1b6792646 100644
--- a/atmel-samd/Makefile
+++ b/atmel-samd/Makefile
@@ -92,8 +92,10 @@ CFLAGS_CORTEX_M0 = \
CFLAGS = $(INC) -Wall -Werror -ansi -std=gnu99 -nostdlib $(CFLAGS_CORTEX_M0) $(COPT)
#Debugging/Optimization
+# TODO(tannewt): Figure out what NDEBUG does. Adding it to the debug build
+# reduces code size pretty dramatically.
ifeq ($(DEBUG), 1)
-CFLAGS += -Os -ggdb
+CFLAGS += -Os -ggdb -DNDEBUG -DENABLE_MICRO_TRACE_BUFFER
else
CFLAGS += -Os -DNDEBUG
endif