From c828dcc60ecad27e68d4190097f944f58d4cdcfc Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Fri, 2 Feb 2024 11:37:55 +0000 Subject: [PATCH] boards: common: openocd-nrf5: Add HWMv2 support Adds support for determining the running from the identifier which is needed for HWMv2 Signed-off-by: Jamie McCrae --- boards/common/openocd-nrf5.board.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/boards/common/openocd-nrf5.board.cmake b/boards/common/openocd-nrf5.board.cmake index 90ab5d32a4c..b8793628820 100644 --- a/boards/common/openocd-nrf5.board.cmake +++ b/boards/common/openocd-nrf5.board.cmake @@ -6,9 +6,14 @@ # # Boards which don't meet this convention can set this variable before # including this script. -if (NOT DEFINED OPENOCD_NRF5_SUBFAMILY) +if(NOT DEFINED OPENOCD_NRF5_SUBFAMILY) string(REGEX MATCH nrf5. OPENOCD_NRF5_SUBFAMILY "${BOARD}") + + if(HWMv2 AND "${OPENOCD_NRF5_SUBFAMILY}" STREQUAL "") + string(REGEX MATCH nrf5. OPENOCD_NRF5_SUBFAMILY "${BOARD_IDENTIFIER}") + endif() endif() + if("${OPENOCD_NRF5_SUBFAMILY}" STREQUAL "") message(FATAL_ERROR "Can't match nrf5 subfamily from BOARD name. "