Skip to content

Commit 39682b6

Browse files
masz-nordicmagp-nordic
authored andcommitted
modules: hal_nordic: align cmake to BSP path
1 parent b2314e1 commit 39682b6

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

modules/hal_nordic/nrfx/CMakeLists.txt

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,33 @@ if(NOT DEFINED NRFX_DIR)
1111
set(NRFX_DIR ${ZEPHYR_CURRENT_MODULE_DIR}/nrfx CACHE PATH "nrfx Directory")
1212
endif()
1313

14+
if(NOT DEFINED CONFIG_SOC_NORDIC_BSP_NAME)
15+
message(FATAL_ERROR "CONFIG_SOC_NORDIC_BSP_NAME has to be defined.")
16+
endif()
17+
1418
set(INC_DIR ${NRFX_DIR}/drivers/include)
1519
set(SRC_DIR ${NRFX_DIR}/drivers/src)
16-
set(MDK_DIR ${NRFX_DIR}/mdk)
20+
set(BSP_DIR ${NRFX_DIR}/bsp)
1721
set(HELPERS_DIR ${NRFX_DIR}/helpers)
22+
set(SOC_DIR ${BSP_DIR}/${CONFIG_SOC_NORDIC_BSP_NAME})
23+
set(MDK_DIR ${SOC_DIR}/mdk)
24+
25+
zephyr_compile_definitions(NRFX_BSP_NRF_PATH="${CONFIG_SOC_NORDIC_BSP_NAME}/mdk/nrf.h")
26+
zephyr_compile_definitions(NRFX_BSP_ERRATAS_PATH="${CONFIG_SOC_NORDIC_BSP_NAME}/mdk/nrf_erratas.h")
27+
zephyr_compile_definitions(NRFX_BSP_SOC_IRQS_PATH="${CONFIG_SOC_NORDIC_BSP_NAME}/soc/nrfx_irqs.h")
28+
zephyr_compile_definitions(NRFX_BSP_NRFX_EXT_PATH="${CONFIG_SOC_NORDIC_BSP_NAME}/nrfx_ext.h")
29+
zephyr_compile_definitions(NRFX_BSP_NRFX_COREDEP_PATH="${CONFIG_SOC_NORDIC_BSP_NAME}/soc/nrfx_coredep_defs.h")
1830

1931
zephyr_include_directories(${NRFX_DIR})
2032
zephyr_include_directories(${INC_DIR})
33+
zephyr_include_directories(${BSP_DIR})
34+
zephyr_include_directories(${SOC_DIR})
35+
zephyr_include_directories(${SOC_DIR}/templates)
2136
zephyr_include_directories(${MDK_DIR})
2237
zephyr_include_directories(.)
2338

39+
include(${SOC_DIR}/zephyr/nrfx.cmake OPTIONAL)
40+
2441
# Define MDK defines globally
2542
zephyr_compile_definitions_ifdef(CONFIG_SOC_SERIES_NRF51X NRF51)
2643
zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF51822_QFAA NRF51422_XXAA)
@@ -215,13 +232,13 @@ endif()
215232

216233
if(CONFIG_SOC_COMPATIBLE_NRF54LX AND CONFIG_NRFX_GPPI)
217234
zephyr_library_sources(${HELPERS_DIR}/nrfx_gppi_dppi_ppib_lumos.c)
218-
zephyr_library_sources(${NRFX_DIR}/soc/interconnect/dppic_ppib/nrfx_interconnect_dppic_ppib.c)
235+
zephyr_library_sources(${SOC_DIR}/soc/interconnect/dppic_ppib/nrfx_interconnect_dppic_ppib.c)
219236
endif()
220237

221238
if(CONFIG_SOC_SERIES_NRF54HX AND CONFIG_NRFX_GPPI)
222239
zephyr_library_sources(${HELPERS_DIR}/nrfx_gppi_dppi_ppib.c)
223-
zephyr_library_sources(${NRFX_DIR}/soc/interconnect/apb/nrfx_interconnect_apb.c)
224-
zephyr_library_sources(${NRFX_DIR}/soc/interconnect/ipct/nrfx_interconnect_ipct.c)
240+
zephyr_library_sources(${SOC_DIR}/soc/interconnect/apb/nrfx_interconnect_apb.c)
241+
zephyr_library_sources(${SOC_DIR}/soc/interconnect/ipct/nrfx_interconnect_ipct.c)
225242
endif()
226243

227244
# Get the SVD file for the current SoC

0 commit comments

Comments
 (0)