From ba3f367a932d0c2d17cb988b22d06dd2f2a88dec Mon Sep 17 00:00:00 2001 From: Magdalena Pastula Date: Wed, 10 Sep 2025 15:10:32 +0200 Subject: [PATCH 1/4] [nrf fromlist] modules: hal_nordic: align paths to BSP Align paths after introducing BSP. Upstream PR #: 96160 Signed-off-by: Magdalena Pastula --- modules/hal_nordic/nrfx/CMakeLists.txt | 27 +++++++-- modules/hal_nordic/nrfx/nrfx_config.h | 80 +------------------------- 2 files changed, 24 insertions(+), 83 deletions(-) diff --git a/modules/hal_nordic/nrfx/CMakeLists.txt b/modules/hal_nordic/nrfx/CMakeLists.txt index e944f06c805..8aaaf4c3da4 100644 --- a/modules/hal_nordic/nrfx/CMakeLists.txt +++ b/modules/hal_nordic/nrfx/CMakeLists.txt @@ -11,16 +11,35 @@ if(NOT DEFINED NRFX_DIR) set(NRFX_DIR ${ZEPHYR_CURRENT_MODULE_DIR}/nrfx CACHE PATH "nrfx Directory") endif() +if(NOT DEFINED CONFIG_SOC_NORDIC_BSP_NAME) + message(FATAL_ERROR "CONFIG_SOC_NORDIC_BSP_NAME has to be defined.") +endif() + set(INC_DIR ${NRFX_DIR}/drivers/include) set(SRC_DIR ${NRFX_DIR}/drivers/src) -set(MDK_DIR ${NRFX_DIR}/mdk) +set(BSP_DIR ${NRFX_DIR}/bsp) set(HELPERS_DIR ${NRFX_DIR}/helpers) +set(SOC_DIR ${BSP_DIR}/${CONFIG_SOC_NORDIC_BSP_NAME}) +set(MDK_DIR ${SOC_DIR}/mdk) + +if(NOT CONFIG_SOC_NORDIC_BSP_NAME STREQUAL "stable") + zephyr_compile_definitions(NRFX_BSP_NRF_PATH="${CONFIG_SOC_NORDIC_BSP_NAME}/mdk/nrf.h") + zephyr_compile_definitions(NRFX_BSP_ERRATAS_PATH="${CONFIG_SOC_NORDIC_BSP_NAME}/mdk/nrf_erratas.h") + zephyr_compile_definitions(NRFX_BSP_SOC_IRQS_PATH="${CONFIG_SOC_NORDIC_BSP_NAME}/soc/nrfx_irqs.h") + zephyr_compile_definitions(NRFX_BSP_NRFX_EXT_PATH="${CONFIG_SOC_NORDIC_BSP_NAME}/nrfx_ext.h") + zephyr_compile_definitions(NRFX_BSP_NRFX_COREDEP_PATH="${CONFIG_SOC_NORDIC_BSP_NAME}/soc/nrfx_coredep_defs.h") +endif() zephyr_include_directories(${NRFX_DIR}) zephyr_include_directories(${INC_DIR}) +zephyr_include_directories(${BSP_DIR}) +zephyr_include_directories(${SOC_DIR}) +zephyr_include_directories(${SOC_DIR}/templates) zephyr_include_directories(${MDK_DIR}) zephyr_include_directories(.) +include(${SOC_DIR}/zephyr/nrfx.cmake OPTIONAL) + # Define MDK defines globally zephyr_compile_definitions_ifdef(CONFIG_SOC_SERIES_NRF51X NRF51) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF51822_QFAA NRF51422_XXAA) @@ -197,13 +216,13 @@ zephyr_compile_definitions_ifndef(CONFIG_SOC_NRF54L_ANOMALY_56_WORKAROUND NRF54L if(CONFIG_SOC_COMPATIBLE_NRF54LX AND CONFIG_NRFX_GPPI) zephyr_library_sources(${HELPERS_DIR}/nrfx_gppi_dppi_ppib_lumos.c) - zephyr_library_sources(${NRFX_DIR}/soc/interconnect/dppic_ppib/nrfx_interconnect_dppic_ppib.c) + zephyr_library_sources(${SOC_DIR}/soc/interconnect/dppic_ppib/nrfx_interconnect_dppic_ppib.c) endif() if(CONFIG_SOC_SERIES_NRF54HX AND CONFIG_NRFX_GPPI) zephyr_library_sources(${HELPERS_DIR}/nrfx_gppi_dppi_ppib.c) - zephyr_library_sources(${NRFX_DIR}/soc/interconnect/apb/nrfx_interconnect_apb.c) - zephyr_library_sources(${NRFX_DIR}/soc/interconnect/ipct/nrfx_interconnect_ipct.c) + zephyr_library_sources(${SOC_DIR}/soc/interconnect/apb/nrfx_interconnect_apb.c) + zephyr_library_sources(${SOC_DIR}/soc/interconnect/ipct/nrfx_interconnect_ipct.c) endif() # Get the SVD file for the current SoC diff --git a/modules/hal_nordic/nrfx/nrfx_config.h b/modules/hal_nordic/nrfx/nrfx_config.h index fac2341c1c5..de8c130f443 100644 --- a/modules/hal_nordic/nrfx/nrfx_config.h +++ b/modules/hal_nordic/nrfx/nrfx_config.h @@ -29,83 +29,5 @@ #endif /* Use defaults for undefined symbols. */ -#include -#if defined(NRF51) - #include -#elif defined(NRF52805_XXAA) - #include -#elif defined(NRF52810_XXAA) - #include -#elif defined(NRF52811_XXAA) - #include -#elif defined(NRF52820_XXAA) - #include -#elif defined(NRF52832_XXAA) || defined (NRF52832_XXAB) - #include -#elif defined(NRF52833_XXAA) - #include -#elif defined(NRF52840_XXAA) - #include -#elif defined(NRF5340_XXAA_APPLICATION) - #include -#elif defined(NRF5340_XXAA_NETWORK) - #include -#elif defined(NRF54H20_XXAA) && defined(NRF_APPLICATION) - #include -#elif defined(NRF54H20_XXAA) && defined(NRF_RADIOCORE) - #include -#elif defined(NRF54H20_XXAA) && defined(NRF_PPR) - #include -#elif defined(NRF54H20_XXAA) && defined(NRF_FLPR) - #include -#elif defined(NRF54H20_ENGA_XXAA) && defined(NRF_APPLICATION) - #include -#elif defined(NRF54H20_ENGA_XXAA) && defined(NRF_RADIOCORE) - #include -#elif defined(NRF54H20_ENGA_XXAA) && defined(NRF_PPR) - #include -#elif defined(NRF54H20_ENGA_XXAA) && defined(NRF_FLPR) - #include -#elif defined(NRF54H20_ENGB_XXAA) && defined(NRF_APPLICATION) - #include -#elif defined(NRF54H20_ENGB_XXAA) && defined(NRF_RADIOCORE) - #include -#elif defined(NRF54H20_ENGB_XXAA) && defined(NRF_PPR) - #include -#elif defined(NRF54H20_ENGB_XXAA) && defined(NRF_FLPR) - #include -#elif defined(NRF54L05_XXAA) && defined(NRF_APPLICATION) - #include -#elif defined(NRF54L05_XXAA) && defined(NRF_FLPR) - #include -#elif defined(NRF54L10_XXAA) && defined(NRF_APPLICATION) - #include -#elif defined(NRF54L10_XXAA) && defined(NRF_FLPR) - #include -#elif defined(NRF54L15_XXAA) && defined(NRF_APPLICATION) - #include -#elif defined(NRF54L15_XXAA) && defined(NRF_FLPR) - #include -#elif defined(NRF54LM20A_ENGA_XXAA) && defined(NRF_APPLICATION) - #include -#elif defined(NRF54LM20A_ENGA_XXAA) && defined(NRF_FLPR) - #include -#elif defined(NRF54LV10A_ENGA_XXAA) && defined(NRF_APPLICATION) - #include -#elif defined(NRF54LV10A_ENGA_XXAA) && defined(NRF_FLPR) - #include -#elif defined(NRF9120_XXAA) || defined(NRF9160_XXAA) - #include -#elif defined(NRF9230_ENGB_XXAA) && defined(NRF_APPLICATION) - #include -#elif defined(NRF9230_ENGB_XXAA) && defined(NRF_RADIOCORE) - #include -#elif defined(NRF9230_ENGB_XXAA) && defined(NRF_PPR) - #include -#elif defined(NRF9230_ENGB_XXAA) && defined(NRF_FLPR) - #include -#else - #include "nrfx_config_ext.h" -#endif - +#include "nrfx_templates_config.h" #endif // NRFX_CONFIG_H__ From b1b3ee04fade20c0d2976166e6470b962ecb8c6c Mon Sep 17 00:00:00 2001 From: Magdalena Pastula Date: Wed, 10 Sep 2025 15:11:10 +0200 Subject: [PATCH 2/4] [nrf fromlist] soc: nordic: align paths to BSP Align paths after introducing BSP. Upstream PR #: 96160 Signed-off-by: Magdalena Pastula --- soc/nordic/CMakeLists.txt | 5 ++++- soc/nordic/Kconfig | 4 ++++ soc/nordic/nrf54h/bicr/CMakeLists.txt | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/soc/nordic/CMakeLists.txt b/soc/nordic/CMakeLists.txt index 0c9e9184d6d..f32466d38ee 100644 --- a/soc/nordic/CMakeLists.txt +++ b/soc/nordic/CMakeLists.txt @@ -45,6 +45,9 @@ if(CONFIG_BUILD_WITH_TFM) ) endif() -add_subdirectory(${SOC_SERIES}) +if(CONFIG_SOC_NORDIC_BSP_NAME STREQUAL "stable") + add_subdirectory(${SOC_SERIES}) +endif() + add_subdirectory(common) add_subdirectory_ifdef(CONFIG_NRF_IRONSIDE ironside) diff --git a/soc/nordic/Kconfig b/soc/nordic/Kconfig index d86e98e3dbc..7b13ea9a148 100644 --- a/soc/nordic/Kconfig +++ b/soc/nordic/Kconfig @@ -50,6 +50,10 @@ config SOC_FAMILY_NORDIC_NRF if SOC_FAMILY_NORDIC_NRF +config SOC_NORDIC_BSP_NAME + string + default "stable" + rsource "common/Kconfig.peripherals" rsource "*/Kconfig" diff --git a/soc/nordic/nrf54h/bicr/CMakeLists.txt b/soc/nordic/nrf54h/bicr/CMakeLists.txt index a93e36abbd2..3aa08e69b91 100644 --- a/soc/nordic/nrf54h/bicr/CMakeLists.txt +++ b/soc/nordic/nrf54h/bicr/CMakeLists.txt @@ -1,7 +1,7 @@ if(CONFIG_SOC_NRF54H20_GENERATE_BICR) set(bicr_json_file ${BOARD_DIR}/bicr.json) set(bicr_hex_file ${PROJECT_BINARY_DIR}/bicr.hex) - set(svd_file ${ZEPHYR_HAL_NORDIC_MODULE_DIR}/nrfx/mdk/nrf54h20_application.svd) + set(svd_file ${ZEPHYR_HAL_NORDIC_MODULE_DIR}/nrfx/bsp/stable/mdk/nrf54h20_application.svd) if(EXISTS ${bicr_json_file}) set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${bicr_json_file}) From 0db934247d787354a222c34590824f97ebbb7c86 Mon Sep 17 00:00:00 2001 From: Magdalena Pastula Date: Thu, 11 Sep 2025 17:37:24 +0200 Subject: [PATCH 3/4] [nrf fromlist] soc: nordic: nrf54h: temporarily change path to nrfx Temporarily change path from hal_nordic to nrfx in BICR CMake. This is needed, because BICR is in soc directory which is included before modules, where NRFX_DIR symbol is defined. Upstream PR #: 96160 Signed-off-by: Magdalena Pastula --- soc/nordic/nrf54h/bicr/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soc/nordic/nrf54h/bicr/CMakeLists.txt b/soc/nordic/nrf54h/bicr/CMakeLists.txt index 3aa08e69b91..fef09a2b319 100644 --- a/soc/nordic/nrf54h/bicr/CMakeLists.txt +++ b/soc/nordic/nrf54h/bicr/CMakeLists.txt @@ -1,7 +1,7 @@ if(CONFIG_SOC_NRF54H20_GENERATE_BICR) set(bicr_json_file ${BOARD_DIR}/bicr.json) set(bicr_hex_file ${PROJECT_BINARY_DIR}/bicr.hex) - set(svd_file ${ZEPHYR_HAL_NORDIC_MODULE_DIR}/nrfx/bsp/stable/mdk/nrf54h20_application.svd) + set(svd_file ${ZEPHYR_BASE}/../nrfx/bsp/stable/mdk/nrf54h20_application.svd) if(EXISTS ${bicr_json_file}) set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${bicr_json_file}) From df31c4ab82b6671935839cc431da143923368be1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Wed, 17 Sep 2025 14:32:41 +0200 Subject: [PATCH 4/4] [nrf fromlist] samples: nordic: nrfx_prs: remove deprecated UARTE API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nrfx_uarte_rx is deprecated and will be soon removed. Replaced by new API. Upstream PR #: 96153 Signed-off-by: MichaƂ Stasiak --- samples/boards/nordic/nrfx_prs/src/main.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/samples/boards/nordic/nrfx_prs/src/main.c b/samples/boards/nordic/nrfx_prs/src/main.c index 1b9411d2da4..e9e63e574d2 100644 --- a/samples/boards/nordic/nrfx_prs/src/main.c +++ b/samples/boards/nordic/nrfx_prs/src/main.c @@ -260,9 +260,15 @@ static bool uarte_transfer(const uint8_t *tx_data, size_t tx_data_len, { nrfx_err_t err; - err = nrfx_uarte_rx(&uarte, rx_buf, rx_buf_size); + err = nrfx_uarte_rx_buffer_set(&uarte, rx_buf, rx_buf_size); if (err != NRFX_SUCCESS) { - printk("nrfx_uarte_rx() failed: 0x%08x\n", err); + printk("nrfx_uarte_rx_buffer_set() failed: 0x%08x\n", err); + return false; + } + + err = nrfx_uarte_rx_enable(&uarte, NRFX_UARTE_RX_ENABLE_STOP_ON_END); + if (err != NRFX_SUCCESS) { + printk("nrfx_uarte_rx_enable() failed: 0x%08x\n", err); return false; }