diff --git a/cpu/nrf51/Makefile.include b/cpu/nrf51/Makefile.include index 500a78244b..c95ad04470 100644 --- a/cpu/nrf51/Makefile.include +++ b/cpu/nrf51/Makefile.include @@ -1,2 +1,18 @@ +ROM_START_ADDR ?= 0 + +# Set ROM and RAM lengths according to CPU model +ifneq (,$(filter nrf51x22xxaa nrf51x22xxab,$(CPU_MODEL))) + ROM_LEN ?= 0x40000 + RAM_LEN ?= 0x4000 +endif +ifneq (,$(filter nrf51x22xxaa,$(CPU_MODEL))) + ROM_LEN ?= 0x20000 + RAM_LEN ?= 0x4000 +endif +ifneq (,$(filter nrf51x22xxac,$(CPU_MODEL))) + ROM_LEN ?= 0x40000 + RAM_LEN ?= 0x8000 +endif + include $(RIOTCPU)/nrf5x_common/Makefile.include include $(RIOTMAKE)/arch/cortexm.inc.mk diff --git a/cpu/nrf51/ldscripts/nrf51x22xxaa.ld b/cpu/nrf51/ldscripts/nrf51x22xxaa.ld deleted file mode 100644 index 50dbd4e652..0000000000 --- a/cpu/nrf51/ldscripts/nrf51x22xxaa.ld +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2015 Freie Universität Berlin - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -/** - * @addtogroup cpu_nrf51822 - * @{ - * - * @file - * @brief Memory definitions for the NRF51X22XXAA - * - * @author Hauke Petersen - * - * @} - */ - -MEMORY -{ - rom (rx) : ORIGIN = 0x00000000, LENGTH = 256K - ram (w!rx) : ORIGIN = 0x20000000, LENGTH = 16K -} - -INCLUDE cortexm_base.ld diff --git a/cpu/nrf51/ldscripts/nrf51x22xxab.ld b/cpu/nrf51/ldscripts/nrf51x22xxab.ld deleted file mode 100644 index 805bf913c7..0000000000 --- a/cpu/nrf51/ldscripts/nrf51x22xxab.ld +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2015 Freie Universität Berlin - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -/** - * @addtogroup cpu_nrf51822 - * @{ - * - * @file - * @brief Memory definitions for the NRF51X22XXAB - * - * @author Hauke Petersen - * - * @} - */ - -MEMORY -{ - rom (rx) : ORIGIN = 0x00000000, LENGTH = 128K - ram (w!rx) : ORIGIN = 0x20000000, LENGTH = 16K -} - -INCLUDE cortexm_base.ld diff --git a/cpu/nrf51/ldscripts/nrf51x22xxac.ld b/cpu/nrf51/ldscripts/nrf51x22xxac.ld deleted file mode 100644 index 6b755b32bb..0000000000 --- a/cpu/nrf51/ldscripts/nrf51x22xxac.ld +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2015 Freie Universität Berlin - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -/** - * @addtogroup cpu_nrf51822 - * @{ - * - * @file - * @brief Memory definitions for the NRF51X22XXAC - * - * @author Stephane D'Alu - * - * @} - */ - -MEMORY -{ - rom (rx) : ORIGIN = 0x00000000, LENGTH = 256K - ram (w!rx) : ORIGIN = 0x20000000, LENGTH = 32K -} - -INCLUDE cortexm_base.ld diff --git a/cpu/nrf52/Makefile.include b/cpu/nrf52/Makefile.include index 1fa7f149cf..98e984bf87 100644 --- a/cpu/nrf52/Makefile.include +++ b/cpu/nrf52/Makefile.include @@ -35,11 +35,6 @@ ifneq (,$(filter nrf52840xxaa,$(CPU_MODEL))) RAM_LEN ?= 0x40000 endif -ROM_START_ADDR ?= 0x00000000 -RAM_START_ADDR ?= 0x20000000 - -LINKER_SCRIPT ?= cortexm.ld - VECTORS_O ?= $(BINDIR)/nrf52_vectors/vectors_$(CPU_MODEL).o include $(RIOTCPU)/nrf5x_common/Makefile.include diff --git a/cpu/nrf5x_common/Makefile.include b/cpu/nrf5x_common/Makefile.include index c4b3dec388..649ecdb290 100644 --- a/cpu/nrf5x_common/Makefile.include +++ b/cpu/nrf5x_common/Makefile.include @@ -1,3 +1,8 @@ CFLAGS += -DCPU_FAM_$(call uppercase_and_underscore,$(CPU_FAM)) +ROM_START_ADDR ?= 0x00000000 +RAM_START_ADDR ?= 0x20000000 + +LINKER_SCRIPT ?= cortexm.ld + INCLUDES += -I$(RIOTCPU)/nrf5x_common/include diff --git a/cpu/nrf9160/Makefile.include b/cpu/nrf9160/Makefile.include index b1d2242c3f..118ee9668c 100644 --- a/cpu/nrf9160/Makefile.include +++ b/cpu/nrf9160/Makefile.include @@ -2,11 +2,6 @@ ROM_LEN ?= 0x100000 RAM_LEN ?= 0x40000 -ROM_START_ADDR ?= 0x00000000 -RAM_START_ADDR ?= 0x20000000 - -LINKER_SCRIPT ?= cortexm.ld - FLASHFILE ?= $(BINFILE) PROGRAMMER ?= jlink