From 085601f79567f8838e4cceac4035aaa46d7fce37 Mon Sep 17 00:00:00 2001 From: George Oikonomou Date: Thu, 4 Oct 2018 15:39:00 +0100 Subject: [PATCH 1/2] Default to using os/lib/dbg-io for all arm-powered platforms With the exception of one specific build configuration for platform nrf52dk, all our arm-based platforms use the debugging I/O library from os/lib/dbg-io. This commit changes the build system to include this module by default for all arm devices. Platform / CPU Makefiles will no longer need to request this MODULE explicitly. Configuration provided to allow exclusion where required, as is the case for nrf52dk when NRF52_USE_RTT is set to 1. --- arch/cpu/arm/Makefile.arm | 11 +++++++++-- arch/cpu/cc2538/Makefile.cc2538 | 2 -- arch/cpu/cc26xx-cc13xx/Makefile.cc26xx-cc13xx | 2 -- .../simplelink-cc13xx-cc26xx/Makefile.cc13xx-cc26xx | 3 --- arch/platform/jn516x/Makefile.jn516x | 2 -- arch/platform/nrf52dk/Makefile.nrf52dk | 4 ++-- 6 files changed, 11 insertions(+), 13 deletions(-) diff --git a/arch/cpu/arm/Makefile.arm b/arch/cpu/arm/Makefile.arm index 285031e82..f2f86ff7a 100644 --- a/arch/cpu/arm/Makefile.arm +++ b/arch/cpu/arm/Makefile.arm @@ -29,10 +29,17 @@ else CFLAGS += -O2 endif -### Use CMSIS and the existing dbg-io from arch/cpu/arm/common -CONTIKI_ARM_DIRS += . common/dbg-io +### Use CMSIS from arch/cpu/arm/common +CONTIKI_ARM_DIRS += . CONTIKI_CPU_DIRS += $(addprefix ../arm/, $(CONTIKI_ARM_DIRS)) +### Default to use os/lib/dbg-io unless configured to do otherwise +PLATFORM_DBG_IO ?= 0 + +ifeq ($(PLATFORM_DBG_IO),0) + MODULES += os/lib/dbg-io +endif + ### CPU-dependent cleanup files CLEAN += *.elf *.bin *.lst *.hex *.i16hex diff --git a/arch/cpu/cc2538/Makefile.cc2538 b/arch/cpu/cc2538/Makefile.cc2538 index 891215093..51a5c40c7 100644 --- a/arch/cpu/cc2538/Makefile.cc2538 +++ b/arch/cpu/cc2538/Makefile.cc2538 @@ -28,8 +28,6 @@ CONTIKI_CPU_SOURCEFILES += slip-arch.c slip.c CONTIKI_CPU_SOURCEFILES += i2c.c cc2538-temp-sensor.c vdd3-sensor.c CONTIKI_CPU_SOURCEFILES += cfs-coffee.c cfs-coffee-arch.c pwm.c -MODULES += os/lib/dbg-io - USB_SOURCEFILES += usb-core.c cdc-acm.c usb-arch.c usb-serial.c cdc-acm-descriptors.c CPU_START_SOURCEFILES = startup-gcc.c diff --git a/arch/cpu/cc26xx-cc13xx/Makefile.cc26xx-cc13xx b/arch/cpu/cc26xx-cc13xx/Makefile.cc26xx-cc13xx index f54a8d72d..00f9ae232 100644 --- a/arch/cpu/cc26xx-cc13xx/Makefile.cc26xx-cc13xx +++ b/arch/cpu/cc26xx-cc13xx/Makefile.cc26xx-cc13xx @@ -45,8 +45,6 @@ CONTIKI_CPU_SOURCEFILES += ble-cc2650.c ble-hal-cc26xx.c ble-addr.c rf-ble-cmd.c CONTIKI_CPU_SOURCEFILES += random.c soc-trng.c int-master.c CONTIKI_CPU_SOURCEFILES += spi-arch.c -MODULES += os/lib/dbg-io - CONTIKI_SOURCEFILES += $(CONTIKI_CPU_SOURCEFILES) CPU_START_SOURCEFILES += fault-handlers.c $(TI_XXWARE_STARTUP_SRCS) diff --git a/arch/cpu/simplelink-cc13xx-cc26xx/Makefile.cc13xx-cc26xx b/arch/cpu/simplelink-cc13xx-cc26xx/Makefile.cc13xx-cc26xx index 3eb11182d..dfd14637e 100644 --- a/arch/cpu/simplelink-cc13xx-cc26xx/Makefile.cc13xx-cc26xx +++ b/arch/cpu/simplelink-cc13xx-cc26xx/Makefile.cc13xx-cc26xx @@ -91,9 +91,6 @@ SDK_DEVICES := $(CORE_SDK)/source/ti/devices/$(SDK_DEVICES_NAME) EXTERNALDIRS += $(SDK_SOURCE) $(SDK_NORTOS) -# CPU-dependent debug source files -MODULES += os/lib/dbg-io - # CPU-dependent directories CONTIKI_CPU_DIRS += . dev $(SUBFAMILY) CONTIKI_CPU_DIRS += rf rf-settings rf-settings/$(DEVICE_FAMILY_LC) diff --git a/arch/platform/jn516x/Makefile.jn516x b/arch/platform/jn516x/Makefile.jn516x index 6cff59c65..9ad9488d5 100644 --- a/arch/platform/jn516x/Makefile.jn516x +++ b/arch/platform/jn516x/Makefile.jn516x @@ -103,8 +103,6 @@ endif CONTIKI_TARGET_DIRS = . dev CONTIKI_TARGET_MAIN = platform.c -MODULES += os/lib/dbg-io - ifeq ($(JN516x_WITH_DR1175),1) JN516x_WITH_DR1174 = 1 CFLAGS += -DSENSOR_BOARD_DR1175 diff --git a/arch/platform/nrf52dk/Makefile.nrf52dk b/arch/platform/nrf52dk/Makefile.nrf52dk index 7e931880a..302c9c91d 100644 --- a/arch/platform/nrf52dk/Makefile.nrf52dk +++ b/arch/platform/nrf52dk/Makefile.nrf52dk @@ -9,12 +9,12 @@ CONTIKI_TARGET_DIRS += . dev config CONTIKI_SOURCEFILES += platform.c leds-arch.c nrf52dk-sensors.c button-sensor.c temperature-sensor.c ifeq ($(NRF52_USE_RTT),1) -### Use the existing debug I/O in arch/cpu/arm/common +### Suppress the existing debug I/O in os/lib +PLATFORM_DBG_IO = 1 CONTIKI_TARGET_DIRS += rtt CONTIKI_SOURCEFILES += rtt-printf.c segger-rtt.c segger-rtt-printf.c else CONTIKI_SOURCEFILES += dbg.c -MODULES += os/lib/dbg-io endif ### Unless the example dictates otherwise, build with code size optimisations switched off From 123b38fc2bbf4cc19c601d46a9e70e97f6464726 Mon Sep 17 00:00:00 2001 From: George Oikonomou Date: Fri, 5 Oct 2018 11:13:44 +0100 Subject: [PATCH 2/2] Rename make variable to better match current practice --- arch/cpu/arm/Makefile.arm | 4 ++-- arch/platform/nrf52dk/Makefile.nrf52dk | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/cpu/arm/Makefile.arm b/arch/cpu/arm/Makefile.arm index f2f86ff7a..83f9b8a36 100644 --- a/arch/cpu/arm/Makefile.arm +++ b/arch/cpu/arm/Makefile.arm @@ -34,9 +34,9 @@ CONTIKI_ARM_DIRS += . CONTIKI_CPU_DIRS += $(addprefix ../arm/, $(CONTIKI_ARM_DIRS)) ### Default to use os/lib/dbg-io unless configured to do otherwise -PLATFORM_DBG_IO ?= 0 +MAKE_WITH_LIB_DBG_IO ?= 1 -ifeq ($(PLATFORM_DBG_IO),0) +ifeq ($(MAKE_WITH_LIB_DBG_IO),1) MODULES += os/lib/dbg-io endif diff --git a/arch/platform/nrf52dk/Makefile.nrf52dk b/arch/platform/nrf52dk/Makefile.nrf52dk index 302c9c91d..e1d56c090 100644 --- a/arch/platform/nrf52dk/Makefile.nrf52dk +++ b/arch/platform/nrf52dk/Makefile.nrf52dk @@ -10,7 +10,7 @@ CONTIKI_SOURCEFILES += platform.c leds-arch.c nrf52dk-sensors.c button-sensor.c ifeq ($(NRF52_USE_RTT),1) ### Suppress the existing debug I/O in os/lib -PLATFORM_DBG_IO = 1 +MAKE_WITH_LIB_DBG_IO = 0 CONTIKI_TARGET_DIRS += rtt CONTIKI_SOURCEFILES += rtt-printf.c segger-rtt.c segger-rtt-printf.c else