diff --git a/drivers/pwm/pwm_nrfx.c b/drivers/pwm/pwm_nrfx.c index e5a046fd975..301cbd98ff3 100644 --- a/drivers/pwm/pwm_nrfx.c +++ b/drivers/pwm/pwm_nrfx.c @@ -22,10 +22,10 @@ LOG_MODULE_REGISTER(pwm_nrfx, CONFIG_PWM_LOG_LEVEL); -/* NRFX_PWM_NRF52_ANOMALY_109_WORKAROUND_ENABLED can be undefined or defined +/* NRF52_ERRATA_109_ENABLE_WORKAROUND can be undefined or defined * to 0 or 1, hence the use of #if IS_ENABLED(). */ -#if IS_ENABLED(NRFX_PWM_NRF52_ANOMALY_109_WORKAROUND_ENABLED) +#if IS_ENABLED(NRF52_ERRATA_109_ENABLE_WORKAROUND) #define ANOMALY_109_EGU_IRQ_CONNECT(idx) _EGU_IRQ_CONNECT(idx) #define _EGU_IRQ_CONNECT(idx) \ extern void nrfx_egu_##idx##_irq_handler(void); \ diff --git a/modules/hal_nordic/nrfx/CMakeLists.txt b/modules/hal_nordic/nrfx/CMakeLists.txt index dc31c3a13ca..73ff289f289 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) @@ -215,13 +234,13 @@ endif() 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__ diff --git a/modules/hal_nordic/nrfx/nrfx_kconfig.h b/modules/hal_nordic/nrfx/nrfx_kconfig.h index 6e3583743bc..c90ec0996a0 100644 --- a/modules/hal_nordic/nrfx/nrfx_kconfig.h +++ b/modules/hal_nordic/nrfx/nrfx_kconfig.h @@ -495,7 +495,7 @@ #ifdef CONFIG_NRFX_SPIM3 #define NRFX_SPIM3_ENABLED 1 #ifdef CONFIG_NRF52_ANOMALY_198_WORKAROUND -#define NRFX_SPIM3_NRF52840_ANOMALY_198_WORKAROUND_ENABLED 1 +#define NRF52_ERRATA_198_ENABLE_WORKAROUND 1 #endif #endif #ifdef CONFIG_NRFX_SPIM4 @@ -806,10 +806,10 @@ #define NRFX_TWIM137_ENABLED 1 #endif #ifdef CONFIG_NRF52_ANOMALY_219_WORKAROUND -#define NRFX_TWIM_NRF52_ANOMALY_219_WORKAROUND_ENABLED 1 +#define NRF52_ERRATA_219_ENABLE_WORKAROUND 1 #endif #ifdef CONFIG_SOC_NRF53_ANOMALY_47_WORKAROUND -#define NRFX_TWIM_NRF53_ANOMALY_47_WORKAROUND_ENABLED 1 +#define NRF53_ERRATA_47_ENABLE_WORKAROUND 1 #endif #ifdef CONFIG_NRFX_TWIS @@ -1007,10 +1007,7 @@ #endif #ifdef CONFIG_NRF52_ANOMALY_109_WORKAROUND -#define NRFX_SPIM_NRF52_ANOMALY_109_WORKAROUND_ENABLED 1 -#define NRFX_SPIS_NRF52_ANOMALY_109_WORKAROUND_ENABLED 1 -#define NRFX_TWIM_NRF52_ANOMALY_109_WORKAROUND_ENABLED 1 -#define NRFX_PWM_NRF52_ANOMALY_109_WORKAROUND_ENABLED 1 +#define NRF52_ERRATA_109_ENABLE_WORKAROUND 1 #define NRFX_PWM_NRF52_ANOMALY_109_EGU_INSTANCE \ CONFIG_NRF52_ANOMALY_109_WORKAROUND_EGU_INSTANCE #endif 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; } 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 f510c1ec391..19a355e66b4 100644 --- a/soc/nordic/Kconfig +++ b/soc/nordic/Kconfig @@ -13,6 +13,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..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/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})