From 3a76d181f0480c39cafdf4978ef99231a2db15b8 Mon Sep 17 00:00:00 2001 From: crasbe Date: Fri, 19 Apr 2024 15:25:28 +0200 Subject: [PATCH] boards/nRF52xx: correctly set JLINK_DEVICE --- boards/common/nrf52/Makefile.include | 2 -- cpu/nrf52/Makefile.include | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/boards/common/nrf52/Makefile.include b/boards/common/nrf52/Makefile.include index 82ab6d06433ae..8e17d28b28b14 100644 --- a/boards/common/nrf52/Makefile.include +++ b/boards/common/nrf52/Makefile.include @@ -18,8 +18,6 @@ else PROGRAMMER ?= openocd endif -# setup JLink for flashing -JLINK_DEVICE = nrf52 # setup OpenOCD for flashing. Version 0.10 of OpenOCD doesn't contain support # for nrf52dk and nrf52840dk boards. To use OpenOCD with these a version # build from source (master > 2018, August the 13rd) is required. diff --git a/cpu/nrf52/Makefile.include b/cpu/nrf52/Makefile.include index e0dd3beefdbf7..ab571b699b2dd 100644 --- a/cpu/nrf52/Makefile.include +++ b/cpu/nrf52/Makefile.include @@ -35,6 +35,30 @@ ifneq (,$(filter nrf52840xxaa,$(CPU_MODEL))) RAM_LEN ?= 0x40000 endif +# Set the target for the JLink programmer for flashing. +# Boards that do not use a JLink ignore the flag. +ifneq (,$(filter nrf52805xxaa,$(CPU_MODEL))) + JLINK_DEVICE = nrf52805_xxaa +endif +ifneq (,$(filter nrf52810xxaa,$(CPU_MODEL))) + JLINK_DEVICE = nrf52810_xxaa +endif +ifneq (,$(filter nrf52811xxaa,$(CPU_MODEL))) + JLINK_DEVICE = nrf52811_xxaa +endif +ifneq (,$(filter nrf52820xxaa,$(CPU_MODEL))) + JLINK_DEVICE = nrf52820_xxaa +endif +ifneq (,$(filter nrf52832xxaa,$(CPU_MODEL))) + JLINK_DEVICE = nrf52832_xxaa +endif +ifneq (,$(filter nrf52833xxaa,$(CPU_MODEL))) + JLINK_DEVICE = nrf52833_xxaa +endif +ifneq (,$(filter nrf52840xxaa,$(CPU_MODEL))) + JLINK_DEVICE = nrf52840_xxaa +endif + VECTORS_O ?= $(BINDIR)/nrf52_vectors/vectors_$(CPU_MODEL).o include $(RIOTCPU)/nrf5x_common/Makefile.include