diff --git a/applications/nrf5340_audio/src/modules/audio_sync_timer.c b/applications/nrf5340_audio/src/modules/audio_sync_timer.c index 2c6f570ca6b6..d4a8eeacedf7 100644 --- a/applications/nrf5340_audio/src/modules/audio_sync_timer.c +++ b/applications/nrf5340_audio/src/modules/audio_sync_timer.c @@ -170,17 +170,17 @@ static void rtc_isr_handler(nrfx_rtc_int_type_t int_type) */ static int audio_sync_timer_init(void) { - nrfx_err_t ret; + int ret; uint32_t eep0, tep0, tep1; ret = nrfx_timer_init(&audio_sync_hf_timer_instance, &cfg, unused_timer_isr_handler); - if (ret - NRFX_ERROR_BASE_NUM) { + if (ret < 0) { LOG_ERR("nrfx timer init error: %d", ret); return -ENODEV; } ret = nrfx_rtc_init(&audio_sync_lf_timer_instance, &rtc_cfg, rtc_isr_handler); - if (ret - NRFX_ERROR_BASE_NUM) { + if (ret < 0) { LOG_ERR("nrfx rtc init error: %d", ret); return -ENODEV; } diff --git a/modules/hal_nordic/CMakeLists.txt b/modules/hal_nordic/CMakeLists.txt index 3c5945d6dd03..4291e78e21e8 100644 --- a/modules/hal_nordic/CMakeLists.txt +++ b/modules/hal_nordic/CMakeLists.txt @@ -1,5 +1,10 @@ # Copyright (c) 2025 Nordic Semiconductor ASA # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +# Set path to the latest version of nrfx +set(NRFX_DIR ${CMAKE_CURRENT_LIST_DIR}/../../../nrfx/) +set(NRFX_DIR ${NRFX_DIR} CACHE STRING "Path to nrfx") + zephyr_get(NRFX_DIR SYSBUILD GLOBAL) if(NOT DEFINED NRFX_DIR) diff --git a/samples/bluetooth/conn_time_sync/src/controller_time_nrf52.c b/samples/bluetooth/conn_time_sync/src/controller_time_nrf52.c index ca1c80a20483..f147dcb79923 100644 --- a/samples/bluetooth/conn_time_sync/src/controller_time_nrf52.c +++ b/samples/bluetooth/conn_time_sync/src/controller_time_nrf52.c @@ -57,8 +57,8 @@ static int rtc_config(void) const nrfx_rtc_config_t rtc_cfg = NRFX_RTC_DEFAULT_CONFIG; ret = nrfx_rtc_init(&app_rtc_instance, &rtc_cfg, rtc_isr_handler); - if (ret != NRFX_SUCCESS) { - printk("Failed initializing RTC (ret: %d)\n", ret - NRFX_ERROR_BASE_NUM); + if (ret != 0) { + printk("Failed initializing RTC (ret: %d)\n", ret); return -ENODEV; } @@ -267,7 +267,7 @@ void controller_time_trigger_set(uint64_t timestamp_us) timer_val = MAX(timer_val, 1); timer_val = MIN(timer_val, 30); - if (nrfx_rtc_cc_set(&app_rtc_instance, 0, rtc_val, false) != NRFX_SUCCESS) { + if (nrfx_rtc_cc_set(&app_rtc_instance, 0, rtc_val, false) != 0) { printk("Failed setting trigger\n"); } diff --git a/samples/bluetooth/conn_time_sync/src/controller_time_nrf53_app.c b/samples/bluetooth/conn_time_sync/src/controller_time_nrf53_app.c index fd348f7c20e4..86543aed2329 100644 --- a/samples/bluetooth/conn_time_sync/src/controller_time_nrf53_app.c +++ b/samples/bluetooth/conn_time_sync/src/controller_time_nrf53_app.c @@ -48,8 +48,8 @@ static int rtc_config(void) const nrfx_rtc_config_t rtc_cfg = NRFX_RTC_DEFAULT_CONFIG; ret = nrfx_rtc_init(&app_rtc_instance, &rtc_cfg, rtc_isr_handler); - if (ret != NRFX_SUCCESS) { - printk("Failed initializing RTC (ret: %d)\n", ret - NRFX_ERROR_BASE_NUM); + if (ret != 0) { + printk("Failed initializing RTC (ret: %d)\n", ret); return -ENODEV; } @@ -233,7 +233,7 @@ void controller_time_trigger_set(uint64_t timestamp_us) timer_val = MAX(timer_val, 1); timer_val = MIN(timer_val, 30); - if (nrfx_rtc_cc_set(&app_rtc_instance, 0, rtc_val, false) != NRFX_SUCCESS) { + if (nrfx_rtc_cc_set(&app_rtc_instance, 0, rtc_val, false) != 0) { printk("Failed setting trigger\n"); } diff --git a/samples/bluetooth/iso_time_sync/src/controller_time_nrf52.c b/samples/bluetooth/iso_time_sync/src/controller_time_nrf52.c index 9f82dde3da82..1f859865e37b 100644 --- a/samples/bluetooth/iso_time_sync/src/controller_time_nrf52.c +++ b/samples/bluetooth/iso_time_sync/src/controller_time_nrf52.c @@ -57,8 +57,8 @@ static int rtc_config(void) const nrfx_rtc_config_t rtc_cfg = NRFX_RTC_DEFAULT_CONFIG; ret = nrfx_rtc_init(&app_rtc_instance, &rtc_cfg, rtc_isr_handler); - if (ret != NRFX_SUCCESS) { - printk("Failed initializing RTC (ret: %d)\n", ret - NRFX_ERROR_BASE_NUM); + if (ret != 0) { + printk("Failed initializing RTC (ret: %d)\n", ret); return -ENODEV; } @@ -266,7 +266,7 @@ void controller_time_trigger_set(uint64_t timestamp_us) timer_val = MAX(timer_val, 1); timer_val = MIN(timer_val, 30); - if (nrfx_rtc_cc_set(&app_rtc_instance, 0, rtc_val, false) != NRFX_SUCCESS) { + if (nrfx_rtc_cc_set(&app_rtc_instance, 0, rtc_val, false) != 0) { printk("Failed setting trigger\n"); } diff --git a/samples/bluetooth/iso_time_sync/src/controller_time_nrf53_app.c b/samples/bluetooth/iso_time_sync/src/controller_time_nrf53_app.c index 4a990511bbd0..5224866b5a21 100644 --- a/samples/bluetooth/iso_time_sync/src/controller_time_nrf53_app.c +++ b/samples/bluetooth/iso_time_sync/src/controller_time_nrf53_app.c @@ -48,8 +48,8 @@ static int rtc_config(void) const nrfx_rtc_config_t rtc_cfg = NRFX_RTC_DEFAULT_CONFIG; ret = nrfx_rtc_init(&app_rtc_instance, &rtc_cfg, rtc_isr_handler); - if (ret != NRFX_SUCCESS) { - printk("Failed initializing RTC (ret: %d)\n", ret - NRFX_ERROR_BASE_NUM); + if (ret != 0) { + printk("Failed initializing RTC (ret: %d)\n", ret); return -ENODEV; } @@ -234,7 +234,7 @@ void controller_time_trigger_set(uint64_t timestamp_us) timer_val = MAX(timer_val, 1); timer_val = MIN(timer_val, 30); - if (nrfx_rtc_cc_set(&app_rtc_instance, 0, rtc_val, false) != NRFX_SUCCESS) { + if (nrfx_rtc_cc_set(&app_rtc_instance, 0, rtc_val, false) != 0) { printk("Failed setting trigger\n"); } diff --git a/subsys/nfc/lib/platform.c b/subsys/nfc/lib/platform.c index ddea39c24b50..9233c0450dd5 100644 --- a/subsys/nfc/lib/platform.c +++ b/subsys/nfc/lib/platform.c @@ -106,7 +106,7 @@ static void clock_handler(struct onoff_manager *mgr, int res) nrfx_nfct_state_force(NRFX_NFCT_STATE_ACTIVATED); } -nrfx_err_t nfc_platform_setup(nfc_lib_cb_resolve_t nfc_lib_cb_resolve, uint8_t *p_irq_priority) +int nfc_platform_setup(nfc_lib_cb_resolve_t nfc_lib_cb_resolve, uint8_t *p_irq_priority) { int err; @@ -128,14 +128,14 @@ nrfx_err_t nfc_platform_setup(nfc_lib_cb_resolve_t nfc_lib_cb_resolve, uint8_t * err = nfc_platform_internal_init(nfc_lib_cb_resolve); if (err) { LOG_ERR("NFC platform init fail: callback resolution function pointer is invalid"); - return NRFX_ERROR_NULL; + return -EFAULT; } LOG_DBG("NFC platform initialized"); - return NRFX_SUCCESS; + return 0; } -static nrfx_err_t nfc_platform_tagheaders_get(uint32_t tag_header[3]) +static int nfc_platform_tagheaders_get(uint32_t tag_header[3]) { #if defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) && defined(NRF_FICR_S) /* If the NFC Platform code is built for the non-secure target and FICR @@ -153,7 +153,7 @@ static nrfx_err_t nfc_platform_tagheaders_get(uint32_t tag_header[3]) if (plt_err != TFM_PLATFORM_ERR_SUCCESS || err != 0) { LOG_ERR("Could not read FICR NFC Tag Header (plt_err %d, err: %d)", plt_err, err); - return NRFX_ERROR_INTERNAL; + return -ECANCELED; } tag_header[0] = ficr_nfc_ns.TAGHEADER0; @@ -171,27 +171,27 @@ static nrfx_err_t nfc_platform_tagheaders_get(uint32_t tag_header[3]) #endif /* defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) && defined(NRF_FICR_S) */ - return NRFX_SUCCESS; + return 0; } -nrfx_err_t nfc_platform_nfcid1_default_bytes_get(uint8_t * const buf, +int nfc_platform_nfcid1_default_bytes_get(uint8_t * const buf, uint32_t buf_len) { if (!buf) { - return NRFX_ERROR_INVALID_PARAM; + return -EINVAL; } if ((buf_len != NRFX_NFCT_NFCID1_SINGLE_SIZE) && (buf_len != NRFX_NFCT_NFCID1_DOUBLE_SIZE) && (buf_len != NRFX_NFCT_NFCID1_TRIPLE_SIZE)) { - return NRFX_ERROR_INVALID_LENGTH; + return -E2BIG; } - nrfx_err_t err; + int err; uint32_t nfc_tag_header[3]; err = nfc_platform_tagheaders_get(nfc_tag_header); - if (err != NRFX_SUCCESS) { + if (err != 0) { return err; } @@ -219,7 +219,7 @@ nrfx_err_t nfc_platform_nfcid1_default_bytes_get(uint8_t * const buf, } } - return NRFX_SUCCESS; + return 0; } uint8_t *nfc_platform_buffer_alloc(size_t size) diff --git a/tests/subsys/bootloader/bl_validation/src/main.c b/tests/subsys/bootloader/bl_validation/src/main.c index 115f9683c84a..06ef98505ee6 100644 --- a/tests/subsys/bootloader/bl_validation/src/main.c +++ b/tests/subsys/bootloader/bl_validation/src/main.c @@ -42,9 +42,9 @@ ZTEST(bl_validation_test, test_validation) for (uint32_t erase_addr = new_addr; erase_addr < (new_addr + copy_len); erase_addr += DT_PROP(DT_CHOSEN(zephyr_flash), erase_block_size)) { - uint32_t ret = nrfx_nvmc_page_erase(erase_addr); + int ret = nrfx_nvmc_page_erase(erase_addr); - zassert_equal(NRFX_SUCCESS, ret, "Erase failed.\r\n"); + zassert_equal(0, ret, "Erase failed.\r\n"); } nrfx_nvmc_words_write(new_addr, (const uint32_t *)PM_ADDRESS, (copy_len + 3) / 4); @@ -82,9 +82,9 @@ ZTEST(bl_validation_test, test_s1) for (uint32_t erase_addr = new_addr; erase_addr < (new_addr + move_len); erase_addr += DT_PROP(DT_CHOSEN(zephyr_flash), erase_block_size)) { - uint32_t ret = nrfx_nvmc_page_erase(erase_addr); + int ret = nrfx_nvmc_page_erase(erase_addr); - zassert_equal(NRFX_SUCCESS, ret, "Erase failed.\r\n"); + zassert_equal(0, ret, "Erase failed.\r\n"); } nrfx_nvmc_words_write(new_addr, (const uint32_t *)PM_S1_ADDRESS, @@ -92,9 +92,9 @@ ZTEST(bl_validation_test, test_s1) for (uint32_t erase_addr = PM_S1_ADDRESS; erase_addr < new_addr; erase_addr += DT_PROP(DT_CHOSEN(zephyr_flash), erase_block_size)) { - uint32_t ret = nrfx_nvmc_page_erase(erase_addr); + int ret = nrfx_nvmc_page_erase(erase_addr); - zassert_equal(NRFX_SUCCESS, ret, "Erase failed.\r\n"); + zassert_equal(0, ret, "Erase failed.\r\n"); } zassert_true(bl_validate_firmware(PM_S1_ADDRESS, new_addr), NULL); diff --git a/tests/subsys/bootloader/bl_validation_neg/src/main.c b/tests/subsys/bootloader/bl_validation_neg/src/main.c index d88e4e70e1f0..2763fb1f391f 100644 --- a/tests/subsys/bootloader/bl_validation_neg/src/main.c +++ b/tests/subsys/bootloader/bl_validation_neg/src/main.c @@ -53,9 +53,9 @@ ZTEST(test_bl_validation_neg, test_validation_neg1) s1_info_copied->valid, "Failed to invalidate S1.\r\n"); zassert_equal((uint32_t)s1_info_copied, PM_S1_ADDRESS, "S1 info found at wrong address.\r\n"); - uint32_t ret = nrfx_nvmc_page_erase(PM_S1_ADDRESS); + int ret = nrfx_nvmc_page_erase(PM_S1_ADDRESS); - zassert_equal(NRFX_SUCCESS, ret, "Erase failed.\r\n"); + zassert_equal(0, ret, "Erase failed.\r\n"); } else { /* First boot */ @@ -64,9 +64,9 @@ ZTEST(test_bl_validation_neg, test_validation_neg1) erase_addr < (new_addr + copy_len); erase_addr += DT_PROP(DT_CHOSEN(zephyr_flash), erase_block_size)) { - uint32_t ret = nrfx_nvmc_page_erase(new_addr); + int ret = nrfx_nvmc_page_erase(new_addr); - zassert_equal(NRFX_SUCCESS, ret, "Erase failed.\r\n"); + zassert_equal(0, ret, "Erase failed.\r\n"); } nrfx_nvmc_words_write(new_addr, (const uint32_t *)PM_ADDRESS, copy_len / 4); diff --git a/west.yml b/west.yml index 790ca1300b66..300f43330baa 100644 --- a/west.yml +++ b/west.yml @@ -66,7 +66,7 @@ manifest: # https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/modules.html - name: zephyr repo-path: sdk-zephyr - revision: a0491b6ceaf072ff7fa108ecfeddb7cbc6c3afa7 + revision: pull/3417/head import: # In addition to the zephyr repository itself, NCS also # imports the contents of zephyr/west.yml at the above @@ -146,7 +146,7 @@ manifest: - name: nrfxlib repo-path: sdk-nrfxlib path: nrfxlib - revision: cb3c6efaa8357bd6fa354976dbaef3a61c3bf98b + revision: pull/1901/head - name: trusted-firmware-m repo-path: sdk-trusted-firmware-m path: modules/tee/tf-m/trusted-firmware-m @@ -280,7 +280,7 @@ manifest: path: nrfx groups: - nrfx - revision: 438fc5f49a2cfdef455b3f3b273814489ff7a571 + revision: pull/987/head # West-related configuration for the nrf repository. self: