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 <jamie.mccrae@nordicsemi.no>
This commit is contained in:
Jamie McCrae 2024-02-02 11:37:55 +00:00 committed by Carles Cufi
parent c79f1b0d94
commit c828dcc60e
1 changed files with 6 additions and 1 deletions

View File

@ -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. "