diff --git a/drivers/clock_control/clock_control_nrf.c b/drivers/clock_control/clock_control_nrf.c index c8c03c7f0baa..f42a673b7597 100644 --- a/drivers/clock_control/clock_control_nrf.c +++ b/drivers/clock_control/clock_control_nrf.c @@ -800,7 +800,6 @@ static void hfclkaudio_init(void) static int clk_init(const struct device *dev) { - nrfx_err_t nrfx_err; int err; static const struct onoff_transitions transitions = { .start = onoff_start, @@ -814,8 +813,7 @@ static int clk_init(const struct device *dev) IRQ_CONNECT(DT_INST_IRQN(0), DT_INST_IRQ(0, priority), nrfx_isr, nrfx_power_clock_irq_handler, 0); - nrfx_err = nrfx_clock_init(clock_event_handler); - if (nrfx_err != NRFX_SUCCESS) { + if (nrfx_clock_init(clock_event_handler) != 0) { return -EIO; } diff --git a/drivers/timer/nrf_grtc_timer.c b/drivers/timer/nrf_grtc_timer.c index d8584b0d7fa6..a77b81a79fca 100644 --- a/drivers/timer/nrf_grtc_timer.c +++ b/drivers/timer/nrf_grtc_timer.c @@ -93,16 +93,7 @@ static inline uint64_t counter(void) static inline int get_comparator(uint32_t chan, uint64_t *cc) { - nrfx_err_t result; - - result = nrfx_grtc_syscounter_cc_value_read(chan, cc); - if (result != NRFX_SUCCESS) { - if (result != NRFX_ERROR_INVALID_PARAM) { - return -EAGAIN; - } - return -EPERM; - } - return 0; + return nrfx_grtc_syscounter_cc_value_read(chan, cc); } /* @@ -173,14 +164,14 @@ static void sys_clock_timeout_handler(int32_t id, uint64_t cc_val, void *p_conte int32_t z_nrf_grtc_timer_chan_alloc(void) { uint8_t chan; - nrfx_err_t err_code; + int err_code; /* Prevent allocating all available channels - one must be left for system purposes. */ if (ext_channels_allocated >= EXT_CHAN_COUNT) { return -ENOMEM; } err_code = nrfx_grtc_channel_alloc(&chan); - if (err_code != NRFX_SUCCESS) { + if (err_code < 0) { return -ENOMEM; } ext_channels_allocated++; @@ -190,9 +181,9 @@ int32_t z_nrf_grtc_timer_chan_alloc(void) void z_nrf_grtc_timer_chan_free(int32_t chan) { IS_CHANNEL_ALLOWED_ASSERT(chan); - nrfx_err_t err_code = nrfx_grtc_channel_free(chan); + int err_code = nrfx_grtc_channel_free(chan); - if (err_code == NRFX_SUCCESS) { + if (err_code == 0) { ext_channels_allocated--; } } @@ -249,19 +240,13 @@ int z_nrf_grtc_timer_compare_read(int32_t chan, uint64_t *val) static int compare_set_nolocks(int32_t chan, uint64_t target_time, z_nrf_grtc_timer_compare_handler_t handler, void *user_data) { - nrfx_err_t result; - __ASSERT_NO_MSG(target_time < COUNTER_SPAN); nrfx_grtc_channel_t user_channel_data = { .handler = handler, .p_context = user_data, .channel = chan, }; - result = nrfx_grtc_syscounter_cc_absolute_set(&user_channel_data, target_time, true); - if (result != NRFX_SUCCESS) { - return -EPERM; - } - return 0; + return nrfx_grtc_syscounter_cc_absolute_set(&user_channel_data, target_time, true); } static int compare_set(int32_t chan, uint64_t target_time, @@ -314,7 +299,6 @@ int z_nrf_grtc_timer_capture_prepare(int32_t chan) .p_context = NULL, .channel = chan, }; - nrfx_err_t result; IS_CHANNEL_ALLOWED_ASSERT(chan); @@ -322,13 +306,7 @@ int z_nrf_grtc_timer_capture_prepare(int32_t chan) * (makes CCEN=1). COUNTER_SPAN is used so as not to fire an event unnecessarily * - it can be assumed that such a large value will never be reached. */ - result = nrfx_grtc_syscounter_cc_absolute_set(&user_channel_data, COUNTER_SPAN, false); - - if (result != NRFX_SUCCESS) { - return -EPERM; - } - - return 0; + return nrfx_grtc_syscounter_cc_absolute_set(&user_channel_data, COUNTER_SPAN, false); } int z_nrf_grtc_timer_capture_read(int32_t chan, uint64_t *captured_time) @@ -336,9 +314,7 @@ int z_nrf_grtc_timer_capture_read(int32_t chan, uint64_t *captured_time) /* TODO: The implementation should probably go to nrfx_grtc and this * should be just a wrapper for some nrfx_grtc_syscounter_capture_read. */ - - uint64_t capt_time; - nrfx_err_t result; + int result; IS_CHANNEL_ALLOWED_ASSERT(chan); @@ -349,14 +325,8 @@ int z_nrf_grtc_timer_capture_read(int32_t chan, uint64_t *captured_time) */ return -EBUSY; } - result = nrfx_grtc_syscounter_cc_value_read(chan, &capt_time); - if (result != NRFX_SUCCESS) { - return -EPERM; - } - - __ASSERT_NO_MSG(capt_time < COUNTER_SPAN); - - *captured_time = capt_time; + result = nrfx_grtc_syscounter_cc_value_read(chan, captured_time); + __ASSERT_NO_MSG(*captured_time < COUNTER_SPAN); return 0; } @@ -369,7 +339,7 @@ uint64_t z_nrf_grtc_timer_startup_value_get(void) #if defined(CONFIG_POWEROFF) && defined(CONFIG_NRF_GRTC_START_SYSCOUNTER) int z_nrf_grtc_wakeup_prepare(uint64_t wake_time_us) { - nrfx_err_t err_code; + int err_code; static uint8_t systemoff_channel; uint64_t now = counter(); nrfx_grtc_sleep_config_t sleep_cfg; @@ -392,9 +362,9 @@ int z_nrf_grtc_wakeup_prepare(uint64_t wake_time_us) k_spinlock_key_t key = k_spin_lock(&lock); err_code = nrfx_grtc_channel_alloc(&systemoff_channel); - if (err_code != NRFX_SUCCESS) { + if (err_code < 0) { k_spin_unlock(&lock, key); - return -ENOMEM; + return err_code; } (void)nrfx_grtc_syscounter_cc_int_disable(systemoff_channel); ret = compare_set(systemoff_channel, @@ -459,7 +429,7 @@ uint32_t sys_clock_elapsed(void) static int sys_clock_driver_init(void) { - nrfx_err_t err_code; + int err_code; IRQ_CONNECT(DT_IRQN(GRTC_NODE), DT_IRQ(GRTC_NODE, priority), nrfx_isr, nrfx_grtc_irq_handler, 0); @@ -477,19 +447,19 @@ static int sys_clock_driver_init(void) #endif err_code = nrfx_grtc_init(0); - if (err_code != NRFX_SUCCESS) { - return -EPERM; + if (err_code < 0) { + return err_code; } #if defined(CONFIG_NRF_GRTC_START_SYSCOUNTER) err_code = nrfx_grtc_syscounter_start(true, &system_clock_channel_data.channel); - if (err_code != NRFX_SUCCESS) { - return err_code == NRFX_ERROR_NO_MEM ? -ENOMEM : -EPERM; + if (err_code < 0) { + return err_code; } #else err_code = nrfx_grtc_channel_alloc(&system_clock_channel_data.channel); - if (err_code != NRFX_SUCCESS) { - return -ENOMEM; + if (err_code < 0) { + return err_code; } #endif /* CONFIG_NRF_GRTC_START_SYSCOUNTER */ diff --git a/modules/hal_nordic/nrfx/CMakeLists.txt b/modules/hal_nordic/nrfx/CMakeLists.txt index d05e741c74c2..d388e5f36c03 100644 --- a/modules/hal_nordic/nrfx/CMakeLists.txt +++ b/modules/hal_nordic/nrfx/CMakeLists.txt @@ -130,13 +130,9 @@ zephyr_library_sources_ifdef(CONFIG_HAS_NORDIC_RAM_CTRL ${HELPERS_DIR}/nrf if(CONFIG_NRFX_GPPI) zephyr_library_sources_ifdef(CONFIG_NRFX_GPPI_V1 ${HELPERS_DIR}/internal/nrfx_gppiv1_shim.c) if(CONFIG_HAS_HW_NRF_PPI) - zephyr_library_sources_ifdef(CONFIG_NRFX_GPPI_V1 ${HELPERS_DIR}/internal/nrfx_gppiv1_ppi.c) - zephyr_library_sources_ifdef(CONFIG_NRFX_GPPI_V1 ${HELPERS_DIR}/internal/nrfx_ppi.c) zephyr_library_sources_ifndef(CONFIG_NRFX_GPPI_V1 ${HELPERS_DIR}/nrfx_gppi_ppi.c) else() - zephyr_library_sources_ifdef(CONFIG_NRFX_GPPI_V1 ${HELPERS_DIR}/internal/nrfx_gppiv1_dppi.c) zephyr_library_sources_ifndef(CONFIG_NRFX_GPPI_V1 ${HELPERS_DIR}/nrfx_gppi_dppi.c) - zephyr_library_sources_ifdef(CONFIG_NRFX_GPPI_V1 ${HELPERS_DIR}/internal/nrfx_dppi.c) endif() endif() @@ -144,8 +140,12 @@ zephyr_library_sources_ifdef(CONFIG_NRFX_PRS ${SRC_DIR}/prs/nrfx_prs.c) zephyr_library_sources_ifdef(CONFIG_NRFX_ADC ${SRC_DIR}/nrfx_adc.c) zephyr_library_sources_ifdef(CONFIG_NRFX_CLOCK ${SRC_DIR}/nrfx_clock.c) +zephyr_library_sources_ifdef(CONFIG_NRFX_CLOCK ${SRC_DIR}/nrfx_clock_lfclk.c) zephyr_library_sources_ifdef(CONFIG_NRFX_CLOCK ${SRC_DIR}/nrfx_clock_hfclk.c) zephyr_library_sources_ifdef(CONFIG_NRFX_CLOCK ${SRC_DIR}/nrfx_clock_xo.c) +zephyr_library_sources_ifdef(CONFIG_NRFX_CLOCK ${SRC_DIR}/nrfx_clock_lfclk.c) +zephyr_library_sources_ifdef(CONFIG_NRFX_CLOCK ${SRC_DIR}/nrfx_clock_hfclk192m.c) +zephyr_library_sources_ifdef(CONFIG_NRFX_CLOCK ${SRC_DIR}/nrfx_clock_hfclkaudio.c) zephyr_library_sources_ifdef(CONFIG_NRFX_COMP ${SRC_DIR}/nrfx_comp.c) zephyr_library_sources_ifdef(CONFIG_NRFX_CRACEN ${SRC_DIR}/nrfx_cracen.c) zephyr_library_sources_ifdef(CONFIG_NRFX_EGU ${SRC_DIR}/nrfx_egu.c) @@ -220,8 +220,6 @@ zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LX_SKIP_GLITCHDETECTOR_DISABLE zephyr_compile_definitions_ifndef(CONFIG_SOC_NRF54L_ANOMALY_56_WORKAROUND NRF54L_CONFIGURATION_56_ENABLE=0) if(CONFIG_SOC_COMPATIBLE_NRF54LX AND CONFIG_NRFX_GPPI) - zephyr_library_sources_ifdef(CONFIG_NRFX_GPPI_V1 ${HELPERS_DIR}/internal/nrfx_gppiv1_ppib.c) - zephyr_library_sources_ifdef(CONFIG_NRFX_GPPI_V1 ${HELPERS_DIR}/internal/nrfx_ppib.c) zephyr_library_sources_ifndef(CONFIG_NRFX_GPPI_V1 ${HELPERS_DIR}/nrfx_gppi_lumos.c) endif() diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index a0a90975f151..0d7a198661c3 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -417,10 +417,10 @@ config NRFX_SPI2 select NRFX_SPI config NRFX_SPIM - bool + bool "SPIM driver" config NRFX_SPIS - bool + bool "SPIS driver" config NRFX_SYSTICK bool "SYSTICK driver" diff --git a/modules/hal_nordic/nrfx/nrfx_glue.c b/modules/hal_nordic/nrfx/nrfx_glue.c index f5665f95c72e..88112022d081 100644 --- a/modules/hal_nordic/nrfx/nrfx_glue.c +++ b/modules/hal_nordic/nrfx/nrfx_glue.c @@ -10,7 +10,7 @@ void nrfx_isr(const void *irq_handler) { - ((nrfx_irq_handler_t)irq_handler)(); + ((nrfx_irq_handler_t)irq_handler)(NULL); } void nrfx_busy_wait(uint32_t usec_to_wait) diff --git a/samples/net/zperf/src/nrf5340_cpu_boost.c b/samples/net/zperf/src/nrf5340_cpu_boost.c index 0eff58c32e37..f1704ebbf818 100644 --- a/samples/net/zperf/src/nrf5340_cpu_boost.c +++ b/samples/net/zperf/src/nrf5340_cpu_boost.c @@ -22,7 +22,6 @@ static int nrf53_cpu_boost(void) /* For optimal performance, the CPU frequency should be set to 128 MHz */ err = nrfx_clock_divider_set(NRF_CLOCK_DOMAIN_HFCLK, NRF_CLOCK_HFCLK_DIV_1); - err -= NRFX_ERROR_BASE_NUM; if (err != 0) { LOG_WRN("Failed to set 128 MHz: %d", err); } diff --git a/scripts/pylib/twister/twisterlib/coverage.py b/scripts/pylib/twister/twisterlib/coverage.py index 9354d0519c5d..2603b498b2a1 100644 --- a/scripts/pylib/twister/twisterlib/coverage.py +++ b/scripts/pylib/twister/twisterlib/coverage.py @@ -413,10 +413,9 @@ def collect_coverage(self, outdir, coverage_file, ztest_file, coveragelog): # We want to remove tests/* and tests/ztest/test/* but save tests/ztest cmd = ["gcovr", "-r", self.base_dir, "--gcov-ignore-parse-errors=negative_hits.warn_once_per_file", + "--gcov-ignore-parse-errors=suspicious_hits.warn_once_per_file", "--gcov-executable", self.gcov_tool, "-e", "tests/*"] - if self.version >= "7.0": - cmd += ["--gcov-object-directory", outdir] cmd += excludes + self.options + ["--json", "-o", coverage_file, outdir] cmd_str = " ".join(cmd) logger.debug(f"Running: {cmd_str}") @@ -431,8 +430,6 @@ def collect_coverage(self, outdir, coverage_file, ztest_file, coveragelog): cmd += ["--gcov-executable", self.gcov_tool, "-f", "tests/ztest", "-e", "tests/ztest/test/*", "--json", "-o", ztest_file, outdir] - if self.version >= "7.0": - cmd += ["--gcov-object-directory", outdir] cmd_str = " ".join(cmd) logger.debug(f"Running: {cmd_str}") diff --git a/soc/nordic/nrf54l/soc.c b/soc/nordic/nrf54l/soc.c index 3396c453dad7..1ed4da147d7b 100644 --- a/soc/nordic/nrf54l/soc.c +++ b/soc/nordic/nrf54l/soc.c @@ -23,7 +23,7 @@ #include #include #include -#include +#include "../../../../nrfx/bsp/stable/soc/interconnect/nrfx_gppi_lumos.h" LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL); #if (defined(NRF_APPLICATION) && !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE)) || \ diff --git a/subsys/bluetooth/audio/shell/bap_usb.c b/subsys/bluetooth/audio/shell/bap_usb.c index 330cff1eb19b..07e846fe3623 100644 --- a/subsys/bluetooth/audio/shell/bap_usb.c +++ b/subsys/bluetooth/audio/shell/bap_usb.c @@ -738,7 +738,6 @@ int bap_usb_init(void) */ err = nrfx_clock_divider_set(NRF_CLOCK_DOMAIN_HFCLK, NRF_CLOCK_HFCLK_DIV_1); - err -= NRFX_ERROR_BASE_NUM; if (err != 0) { LOG_WRN("Failed to set 128 MHz: %d", err); } diff --git a/west.yml b/west.yml index 0a2889a6edde..01aad23ea0d2 100644 --- a/west.yml +++ b/west.yml @@ -199,9 +199,9 @@ manifest: path: modules/hal/microchip groups: - hal - - name: hal_nordic - url: https://github.com/nrfconnect/sdk-hal_nordic - revision: a74256b731c022fbe7576a76b6bb62815ec1f08f + - name: sdk-hal_nordic + url: https://github.com/mib1-nordic/sdk-hal_nordic + revision: align_nrfx_examples path: modules/hal/nordic groups: - hal