diff --git a/nrf5/Makefile b/nrf5/Makefile index c8d852f6ad..7aa0dd52a7 100644 --- a/nrf5/Makefile +++ b/nrf5/Makefile @@ -63,7 +63,7 @@ INC += -I./hal/$(MCU_VARIANT) INC += -I./drivers/display INC += -I../lib/mp-readline -NRF_DEFINES = -D$(MCU_VARIANT_UPPER) +NRF_DEFINES += -D$(MCU_VARIANT_UPPER) NRF_DEFINES += -DCONFIG_GPIO_AS_PINRESET CFLAGS_CORTEX_M = -mthumb -mabi=aapcs -fsingle-precision-constant -Wdouble-promotion @@ -159,7 +159,7 @@ DRIVERS_SRC_C += $(addprefix drivers/,\ #ifeq ($(SD), ) SRC_C += \ - device/$(MCU_VARIANT)/system_$(MCU_VARIANT).c \ + device/$(MCU_VARIANT)/system_$(MCU_SUB_VARIANT).c \ SRC_S = \ device/$(MCU_VARIANT)/startup_$(MCU_VARIANT).s \ diff --git a/nrf5/boards/microbit/mpconfigboard.mk b/nrf5/boards/microbit/mpconfigboard.mk index c8a0f0caea..f959edab50 100644 --- a/nrf5/boards/microbit/mpconfigboard.mk +++ b/nrf5/boards/microbit/mpconfigboard.mk @@ -1,5 +1,5 @@ MCU_SERIES = m0 MCU_VARIANT = nrf51 -LD_FILE = boards/nrf51822_aa.ld +MCU_SUB_VARIANT = nrf51822 +LD_FILE = boards/$(MCU_SUB_VARIANT)_aa.ld FLASHER = pyocd - diff --git a/nrf5/boards/pca10000/mpconfigboard.mk b/nrf5/boards/pca10000/mpconfigboard.mk index d2a566aea8..523653ede0 100644 --- a/nrf5/boards/pca10000/mpconfigboard.mk +++ b/nrf5/boards/pca10000/mpconfigboard.mk @@ -1,4 +1,5 @@ MCU_SERIES = m0 MCU_VARIANT = nrf51 -LD_FILE = boards/nrf51822_aa.ld +MCU_SUB_VARIANT = nrf51822 +LD_FILE = boards/$(MCU_SUB_VARIANT)_aa.ld diff --git a/nrf5/boards/pca10001/mpconfigboard.mk b/nrf5/boards/pca10001/mpconfigboard.mk index 40a74fd176..269fdc95af 100644 --- a/nrf5/boards/pca10001/mpconfigboard.mk +++ b/nrf5/boards/pca10001/mpconfigboard.mk @@ -1,3 +1,4 @@ MCU_SERIES = m0 MCU_VARIANT = nrf51 -LD_FILE = boards/nrf51822_aa.ld +MCU_SUB_VARIANT = nrf51822 +LD_FILE = boards/$(MCU_SUB_VARIANT)_aa.ld diff --git a/nrf5/boards/pca10028/mpconfigboard.mk b/nrf5/boards/pca10028/mpconfigboard.mk index ac92424ec7..01b6bcf7e1 100644 --- a/nrf5/boards/pca10028/mpconfigboard.mk +++ b/nrf5/boards/pca10028/mpconfigboard.mk @@ -1,4 +1,4 @@ MCU_SERIES = m0 MCU_VARIANT = nrf51 -LD_FILE = boards/nrf51822_ac.ld - +MCU_SUB_VARIANT = nrf51822 +LD_FILE = boards/$(MCU_SUB_VARIANT)_ac.ld diff --git a/nrf5/boards/pca10031/mpconfigboard.mk b/nrf5/boards/pca10031/mpconfigboard.mk index 72a21aa76f..01b6bcf7e1 100644 --- a/nrf5/boards/pca10031/mpconfigboard.mk +++ b/nrf5/boards/pca10031/mpconfigboard.mk @@ -1,3 +1,4 @@ MCU_SERIES = m0 MCU_VARIANT = nrf51 -LD_FILE = boards/nrf51822_ac.ld +MCU_SUB_VARIANT = nrf51822 +LD_FILE = boards/$(MCU_SUB_VARIANT)_ac.ld diff --git a/nrf5/boards/pca10040/mpconfigboard.mk b/nrf5/boards/pca10040/mpconfigboard.mk index 3b6af95f75..62fce4c795 100644 --- a/nrf5/boards/pca10040/mpconfigboard.mk +++ b/nrf5/boards/pca10040/mpconfigboard.mk @@ -1,4 +1,6 @@ MCU_SERIES = m4 MCU_VARIANT = nrf52 -LD_FILE = boards/nrf52832_aa.ld +MCU_SUB_VARIANT = nrf52832 +LD_FILE = boards/$(MCU_SUB_VARIANT)_aa.ld +NRF_DEFINES += -DNRF52832_XXAA diff --git a/nrf5/boards/pca10056/mpconfigboard.mk b/nrf5/boards/pca10056/mpconfigboard.mk index 2e273dabc7..15a88ed091 100644 --- a/nrf5/boards/pca10056/mpconfigboard.mk +++ b/nrf5/boards/pca10056/mpconfigboard.mk @@ -1,4 +1,6 @@ MCU_SERIES = m4 MCU_VARIANT = nrf52 -LD_FILE = boards/nrf52840_aa.ld +MCU_SUB_VARIANT = nrf52840 +LD_FILE = boards/$(MCU_SUB_VARIANT)_aa.ld +NRF_DEFINES += -DNRF52840_XXAA