From 59ab17487f9bde015aef1338b74916ab75068fd2 Mon Sep 17 00:00:00 2001 From: Thomas Klaehn Date: Tue, 31 Mar 2020 18:03:35 +0200 Subject: [PATCH] build system: Fix flags regarding nrf52 soft device --- Makefile | 7 +++++-- build_system/platform/nrf52/Makefile.nrf52 | 16 ++++++++-------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 240f85e..174ec04 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,7 @@ CC = $(CROSS_COMPILE)gcc CPP = $(CROSS_COMPILE)cpp CXX = $(CROSS_COMPILE)g++ OBJCOPY = $(CROSS_COMPILE)objcopy +OBJDUMP = $(CROSS_COMPILE)objdump SIZE = $(CROSS_COMPILE)size CHECK = cppcheck @@ -75,9 +76,11 @@ check: $(C_SRCS) $(TARGET): $(OBJS) $(THIS_MAKEFILE) @mkdir -p $(dir $@) - $(CXX) $(CXX_FLAGS) $(LD_FLAGS) $(OBJS) $(addprefix -l,$(LIBS)) -o $@ + $(CXX) $(CXX_FLAGS) $(LD_FLAGS) $(OBJS) $(addprefix -l,$(LIBS)) -Wl,-Map=$@.map -o $@ + $(OBJDUMP) --disassemble-all --section=.text --source -EL -C --wide --line-numbers --inlines $@ > $@.text.disassemble ln -sf $(shell pwd)/$@ $(shell pwd)/bin/firmware.elf - $(SIZE) -x $@ + $(SIZE) -x $@ > $@.size + @cat $@.size $(TARGET_HEX): $(TARGET) $(THIS_MAKEFILE) $(OBJCOPY) -O ihex $(TARGET) $(TARGET_HEX) diff --git a/build_system/platform/nrf52/Makefile.nrf52 b/build_system/platform/nrf52/Makefile.nrf52 index 754513a..c947537 100644 --- a/build_system/platform/nrf52/Makefile.nrf52 +++ b/build_system/platform/nrf52/Makefile.nrf52 @@ -25,9 +25,9 @@ C_FLAGS += -DFLOAT_ABI_HARD C_FLAGS += -DNRF52 C_FLAGS += -DNRF52832_XXAA C_FLAGS += -DNRF52_PAN_74 -C_FLAGS += -DNRF_SD_BLE_API_VERSION=7 -C_FLAGS += -DS132 -C_FLAGS += -DSOFTDEVICE_PRESENT +# C_FLAGS += -DNRF_SD_BLE_API_VERSION=7 +# C_FLAGS += -DS132 +# C_FLAGS += -DSOFTDEVICE_PRESENT C_FLAGS += -mcpu=$(CPU) C_FLAGS += -mthumb -mabi=aapcs C_FLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16 @@ -42,9 +42,9 @@ CXX_FLAGS += -DFLOAT_ABI_HARD CXX_FLAGS += -DNRF52 CXX_FLAGS += -DNRF52832_XXAA CXX_FLAGS += -DNRF52_PAN_74 -CXX_FLAGS += -DNRF_SD_BLE_API_VERSION=7 -CXX_FLAGS += -DS132 -CXX_FLAGS += -DSOFTDEVICE_PRESENT +# CXX_FLAGS += -DNRF_SD_BLE_API_VERSION=7 +# CXX_FLAGS += -DS132 +# CXX_FLAGS += -DSOFTDEVICE_PRESENT CXX_FLAGS += -mcpu=$(CPU) CXX_FLAGS += -mthumb -mabi=aapcs CXX_FLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16 @@ -64,8 +64,8 @@ A_FLAGS += -DFLOAT_ABI_HARD A_FLAGS += -DNRF52 A_FLAGS += -DNRF52832_XXAA A_FLAGS += -DNRF52_PAN_74 -A_FLAGS += -DNRF_SD_BLE_API_VERSION=7 -A_FLAGS += -DS132 +# A_FLAGS += -DNRF_SD_BLE_API_VERSION=7 +# A_FLAGS += -DS132 # A_FLAGS += -DSOFTDEVICE_PRESENT A_FLAGS += -D__HEAP_SIZE=8192 A_FLAGS += -D__HEAP_SIZE=8192