From 490301edeb7bb881ff61b3809bd71d77ffbb8d91 Mon Sep 17 00:00:00 2001 From: Marcin Szymczyk Date: Tue, 4 Nov 2025 12:33:13 +0100 Subject: [PATCH 1/8] manifest: update zephyr with nrfx 4.0-rc2 Update with nrfx 4.0-rc2. Signed-off-by: Marcin Szymczyk --- west.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/west.yml b/west.yml index 790ca1300b66..1f07472a1666 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/3467/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 From aec9791e92b31305a1e782842f3c081cc5ea5386 Mon Sep 17 00:00:00 2001 From: Marcin Szymczyk Date: Wed, 5 Nov 2025 13:22:19 +0100 Subject: [PATCH 2/8] drivers: mpsl: clock: add missing `lfclk` functions Those are no longer static inlines in the header, so should be implemented separately. Signed-off-by: Marcin Szymczyk --- drivers/mpsl/clock_control/nrfx_clock_mpsl.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/mpsl/clock_control/nrfx_clock_mpsl.c b/drivers/mpsl/clock_control/nrfx_clock_mpsl.c index 7c5842288625..0c7c95833189 100644 --- a/drivers/mpsl/clock_control/nrfx_clock_mpsl.c +++ b/drivers/mpsl/clock_control/nrfx_clock_mpsl.c @@ -38,6 +38,26 @@ static void mpsl_hfclk_src_callback(mpsl_clock_evt_type_t evt_type) } } +void nrfx_clock_lfclk_start(void) +{ + nrfx_clock_start(NRF_CLOCK_DOMAIN_LFCLK); +} + +void nrfx_clock_lfclk_stop(void) +{ + nrfx_clock_stop(NRF_CLOCK_DOMAIN_LFCLK); +} + +void nrfx_clock_hfclk_start(void) +{ + nrfx_clock_start(NRF_CLOCK_DOMAIN_HFCLK); +} + +void nrfx_clock_hfclk_stop(void) +{ + nrfx_clock_stop(NRF_CLOCK_DOMAIN_HFCLK); +} + void nrfx_clock_start(nrf_clock_domain_t domain) { switch (domain) { From 6c400f9e3fd38544a8ca090921704f88b955278d Mon Sep 17 00:00:00 2001 From: Marcin Szymczyk Date: Wed, 5 Nov 2025 16:19:54 +0100 Subject: [PATCH 3/8] scripts: quarantine: fix for non-rebased fails Some fails are due to not rebased branch. Signed-off-by: Marcin Szymczyk --- scripts/quarantine.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/quarantine.yaml b/scripts/quarantine.yaml index ca7297d5ff45..7a781c3f3f49 100644 --- a/scripts/quarantine.yaml +++ b/scripts/quarantine.yaml @@ -216,10 +216,10 @@ comment: "https://nordicsemi.atlassian.net/browse/NRFX-8605" - scenarios: - - sample.mcumgr.smp_svr.bt.* - - sample.mcumgr.smp_svr.serial.* + - sample.mcumgr.smp_svr.* - sample.dfu.dfu_target platforms: - nrf54h20dk@0.9.0/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - thingy53/nrf5340/cpuapp comment: "Requires rebase on collab-nrfx-4.0 branch" From b4322a3ce67230b7d8739aeb38a42ea546c45373 Mon Sep 17 00:00:00 2001 From: Michal Frankiewicz Date: Wed, 5 Nov 2025 15:09:10 +0100 Subject: [PATCH 4/8] treewide: update error codes for nrfx_clock driver Updated error codes for nrfx_clock and attached nrfx and zephyr revisions. Signed-off-by: Michal Frankiewicz --- applications/nrf5340_audio/src/utils/peripherals.c | 1 - drivers/mpsl/clock_control/nrfx_clock_mpsl.c | 4 ++-- samples/bluetooth/nrf_auraconfig/src/nrf_auraconfig.c | 1 - subsys/net/lib/nrf70_fw_ext/ext_fw_load.c | 6 ++---- tests/bluetooth/iso/src/main.c | 1 - 5 files changed, 4 insertions(+), 9 deletions(-) diff --git a/applications/nrf5340_audio/src/utils/peripherals.c b/applications/nrf5340_audio/src/utils/peripherals.c index 2ff0fb30b571..721df72b96c3 100644 --- a/applications/nrf5340_audio/src/utils/peripherals.c +++ b/applications/nrf5340_audio/src/utils/peripherals.c @@ -149,7 +149,6 @@ int peripherals_init(void) /* Use this to turn on 128 MHz clock for cpu_app */ ret = nrfx_clock_divider_set(NRF_CLOCK_DOMAIN_HFCLK, NRF_CLOCK_HFCLK_DIV_1); - ret -= NRFX_ERROR_BASE_NUM; if (ret) { return ret; } diff --git a/drivers/mpsl/clock_control/nrfx_clock_mpsl.c b/drivers/mpsl/clock_control/nrfx_clock_mpsl.c index 0c7c95833189..7f7ca5a709ab 100644 --- a/drivers/mpsl/clock_control/nrfx_clock_mpsl.c +++ b/drivers/mpsl/clock_control/nrfx_clock_mpsl.c @@ -101,11 +101,11 @@ void nrfx_clock_enable(void) } -nrfx_err_t nrfx_clock_init(nrfx_clock_event_handler_t handler) +int nrfx_clock_init(nrfx_clock_event_handler_t handler) { event_handler = handler; - return NRFX_SUCCESS; + return 0; } diff --git a/samples/bluetooth/nrf_auraconfig/src/nrf_auraconfig.c b/samples/bluetooth/nrf_auraconfig/src/nrf_auraconfig.c index 09609f8dab76..dd34ab78c26d 100644 --- a/samples/bluetooth/nrf_auraconfig/src/nrf_auraconfig.c +++ b/samples/bluetooth/nrf_auraconfig/src/nrf_auraconfig.c @@ -703,7 +703,6 @@ void nrf_auraconfig_main(void) LOG_DBG("Main started"); ret = nrfx_clock_divider_set(NRF_CLOCK_DOMAIN_HFCLK, NRF_CLOCK_HFCLK_DIV_1); - ret -= NRFX_ERROR_BASE_NUM; ERR_CHK_MSG(ret, "Failed to set HFCLK divider"); ret = led_init(); diff --git a/subsys/net/lib/nrf70_fw_ext/ext_fw_load.c b/subsys/net/lib/nrf70_fw_ext/ext_fw_load.c index 5a96f3620206..6a92c74b4687 100644 --- a/subsys/net/lib/nrf70_fw_ext/ext_fw_load.c +++ b/subsys/net/lib/nrf70_fw_ext/ext_fw_load.c @@ -257,8 +257,7 @@ static void enable_xip_and_set_cpu_freq(void) /* Set CPU frequency to 64MHz (DIV_2) */ int ret = nrfx_clock_divider_set(NRF_CLOCK_DOMAIN_HFCLK, NRF_CLOCK_HFCLK_DIV_2); - if (ret != NRFX_SUCCESS) { - ret -= NRFX_ERROR_BASE_NUM; + if (ret != 0) { LOG_ERR("Failed to set CPU frequency: %d", ret); return; } @@ -293,8 +292,7 @@ static void disable_xip_and_restore_cpu_freq(void) if (current_divider != saved_divider) { int ret = nrfx_clock_divider_set(NRF_CLOCK_DOMAIN_HFCLK, saved_divider); - if (ret != NRFX_SUCCESS) { - ret -= NRFX_ERROR_BASE_NUM; + if (ret != 0) { LOG_ERR("Failed to restore CPU frequency: %d", ret); } else { LOG_DBG("CPU frequency restored to original value"); diff --git a/tests/bluetooth/iso/src/main.c b/tests/bluetooth/iso/src/main.c index 5600328f1a89..7b1733b7573e 100644 --- a/tests/bluetooth/iso/src/main.c +++ b/tests/bluetooth/iso/src/main.c @@ -18,7 +18,6 @@ static int hfclock_config_and_start(void) /* Use this to turn on 128 MHz clock for cpu_app */ ret = nrfx_clock_divider_set(NRF_CLOCK_DOMAIN_HFCLK, NRF_CLOCK_HFCLK_DIV_1); - ret -= NRFX_ERROR_BASE_NUM; if (ret) { return ret; } From b800653990e314445a030ddc229b12c9c6bb46c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Wed, 22 Oct 2025 11:25:03 +0200 Subject: [PATCH 5/8] susbys: nfc: replace nrfx_err_t with errno MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nrfx_err_t is to be removed from nrfx completely. Signed-off-by: Michał Stasiak --- subsys/nfc/lib/platform.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) 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) From 0004357873fbd314b28856cb54f1552a23e3d462 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Wed, 22 Oct 2025 12:14:53 +0200 Subject: [PATCH 6/8] treewide: align to nrfx_rtc returning errno MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NRFX RTC driver now returns errno values. Signed-off-by: Michał Stasiak --- applications/nrf5340_audio/src/modules/audio_sync_timer.c | 6 +++--- .../bluetooth/conn_time_sync/src/controller_time_nrf52.c | 6 +++--- .../conn_time_sync/src/controller_time_nrf53_app.c | 6 +++--- samples/bluetooth/iso_time_sync/src/controller_time_nrf52.c | 6 +++--- .../bluetooth/iso_time_sync/src/controller_time_nrf53_app.c | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) 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/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"); } From 8cbee8360f22ef897d1a3b32786a4834fb972797 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Wed, 22 Oct 2025 11:36:55 +0200 Subject: [PATCH 7/8] treewide: align to nrfx_nvmc returning errno MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NRFX NVMC driver now returns errno values. Signed-off-by: Michał Stasiak --- tests/subsys/bootloader/bl_validation/src/main.c | 12 ++++++------ tests/subsys/bootloader/bl_validation_neg/src/main.c | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) 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); From b21c0091f10e3cb4c039603dcb6e715cbcfa4635 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Tue, 4 Nov 2025 07:55:34 +0100 Subject: [PATCH 8/8] all: Align to GPPI API tweaking MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There are minor updates in GPPI API. Align in places that are affected. Signed-off-by: Krzysztof Chruściński --- applications/connectivity_bridge/prj.conf | 2 +- lib/fem_al/fem_al.c | 2 +- ...nrf_802154_platform_sl_lptimer_grtc_hw_task.c | 2 +- .../platform/nrf_802154_platform_timestamper.c | 2 +- .../boards/nrf52833dk_nrf52833.conf | 1 - .../boards/nrf52840dk_nrf52840.conf | 1 - .../conn_time_sync/src/controller_time_nrf52.c | 8 +++++++- .../src/controller_time_nrf53_app.c | 8 +++++++- .../conn_time_sync/src/controller_time_nrf54.c | 7 +++---- .../boards/nrf52833dk_nrf52833.conf | 1 - .../boards/nrf52840dk_nrf52840.conf | 1 - .../iso_time_sync/src/controller_time_nrf52.c | 8 +++++++- .../src/controller_time_nrf53_app.c | 8 +++++++- .../iso_time_sync/src/controller_time_nrf54.c | 7 +++---- samples/peripheral/802154_phy_test/src/rf_proc.c | 6 +++++- subsys/esb/esb_dppi.c | 16 ++++++++-------- subsys/esb/esb_ppi.c | 16 ++++++++-------- subsys/gazell/Kconfig | 2 +- subsys/mpsl/fem/common/mpsl_fem_utils.c | 2 +- subsys/mpsl/hwres/mpsl_dppi.c | 4 ++-- 20 files changed, 63 insertions(+), 41 deletions(-) diff --git a/applications/connectivity_bridge/prj.conf b/applications/connectivity_bridge/prj.conf index f60c50be99cb..783356233eed 100644 --- a/applications/connectivity_bridge/prj.conf +++ b/applications/connectivity_bridge/prj.conf @@ -73,7 +73,7 @@ CONFIG_UART_1_NRF_HW_ASYNC_TIMER=2 CONFIG_UART_USE_RUNTIME_CONFIGURE=y CONFIG_NRFX_UARTE=y CONFIG_NRFX_TIMER=y -CONFIG_NRFX_PPI=y +CONFIG_NRFX_GPPI=y CONFIG_HW_ID_LIBRARY=y CONFIG_RESET_ON_FATAL_ERROR=y diff --git a/lib/fem_al/fem_al.c b/lib/fem_al/fem_al.c index b12882f81be8..b36d150e66d9 100644 --- a/lib/fem_al/fem_al.c +++ b/lib/fem_al/fem_al.c @@ -361,7 +361,7 @@ static int radio_domain_nrfx_dppi_channel_alloc(uint8_t *channel) { int ch; - ch = nrfx_gppi_channel_alloc(nrfx_gppi_domain_id_get(RADIO_DOMAIN_NRF_DPPI), channel); + ch = nrfx_gppi_channel_alloc(nrfx_gppi_domain_id_get(RADIO_DOMAIN_NRF_DPPI)); if (ch < 0) { return ch; } diff --git a/modules/nrfxlib/nrf_802154/sl/platform/nrf_802154_platform_sl_lptimer_grtc_hw_task.c b/modules/nrfxlib/nrf_802154/sl/platform/nrf_802154_platform_sl_lptimer_grtc_hw_task.c index 0605c60d5b4d..ea2d2d6013a2 100644 --- a/modules/nrfxlib/nrf_802154/sl/platform/nrf_802154_platform_sl_lptimer_grtc_hw_task.c +++ b/modules/nrfxlib/nrf_802154/sl/platform/nrf_802154_platform_sl_lptimer_grtc_hw_task.c @@ -227,7 +227,7 @@ void nrf_802154_platform_sl_lptimer_hw_task_local_domain_connections_clear(void) #elif defined(NRF54L_SERIES) #include -#include +#include /* To trigger RADIO.TASKS_x with GRTC.EVENT_CAPTURE{?}, the following connection chain must be * created: diff --git a/modules/nrfxlib/nrf_802154/sl/platform/nrf_802154_platform_timestamper.c b/modules/nrfxlib/nrf_802154/sl/platform/nrf_802154_platform_timestamper.c index b9ac2aabb3f2..1ca69d590cba 100644 --- a/modules/nrfxlib/nrf_802154/sl/platform/nrf_802154_platform_timestamper.c +++ b/modules/nrfxlib/nrf_802154/sl/platform/nrf_802154_platform_timestamper.c @@ -228,7 +228,7 @@ void nrf_802154_platform_timestamper_local_domain_connections_setup(uint32_t dpp */ #include -#include +#include static nrfx_gppi_handle_t rad_peri_handle; diff --git a/samples/bluetooth/conn_time_sync/boards/nrf52833dk_nrf52833.conf b/samples/bluetooth/conn_time_sync/boards/nrf52833dk_nrf52833.conf index ec772c7e06d1..049731d69b6e 100644 --- a/samples/bluetooth/conn_time_sync/boards/nrf52833dk_nrf52833.conf +++ b/samples/bluetooth/conn_time_sync/boards/nrf52833dk_nrf52833.conf @@ -6,4 +6,3 @@ CONFIG_NRFX_TIMER=y CONFIG_NRFX_RTC2=y -CONFIG_NRFX_PPI=y diff --git a/samples/bluetooth/conn_time_sync/boards/nrf52840dk_nrf52840.conf b/samples/bluetooth/conn_time_sync/boards/nrf52840dk_nrf52840.conf index ec772c7e06d1..049731d69b6e 100644 --- a/samples/bluetooth/conn_time_sync/boards/nrf52840dk_nrf52840.conf +++ b/samples/bluetooth/conn_time_sync/boards/nrf52840dk_nrf52840.conf @@ -6,4 +6,3 @@ CONFIG_NRFX_TIMER=y CONFIG_NRFX_RTC2=y -CONFIG_NRFX_PPI=y 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 f147dcb79923..31fcac3e3bca 100644 --- a/samples/bluetooth/conn_time_sync/src/controller_time_nrf52.c +++ b/samples/bluetooth/conn_time_sync/src/controller_time_nrf52.c @@ -159,12 +159,18 @@ int config_egu_trigger_on_rtc_and_timer_match(void) uint32_t tep1 = nrf_egu_task_address_get(NRF_EGU0, NRF_EGU_TASK_TRIGGER0); int ret; - ret = nrfx_gppi_group_alloc(&eep0, 1, &group); + ret = nrfx_gppi_group_alloc(nrfx_gppi_domain_id_get(eep0), &group); if (ret < 0) { printk("Failed allocating group\n"); return ret; } + ret = nrfx_gppi_group_ep_add(group, eep0); + if (ret < 0) { + printk("Failed attaching an event to the group\n"); + return ret; + } + ret = nrfx_gppi_conn_alloc(eep0, nrfx_gppi_group_task_en_addr(group), &ppi_on_rtc_match); if (ret < 0) { printk("Failed allocating for RTC match\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 86543aed2329..dabaef53e13b 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 @@ -130,12 +130,18 @@ int config_egu_trigger_on_rtc_and_timer_match(void) uint32_t tep1 = nrf_egu_task_address_get(NRF_EGU0, NRF_EGU_TASK_TRIGGER0); int ret; - ret = nrfx_gppi_group_alloc(&eep0, 1, &group); + ret = nrfx_gppi_group_alloc(nrfx_gppi_domain_id_get(eep0), &group); if (ret < 0) { printk("Failed allocating group\n"); return ret; } + ret = nrfx_gppi_group_ep_add(group, eep0); + if (ret < 0) { + printk("Failed attaching an event to the group\n"); + return ret; + } + ret = nrfx_gppi_conn_alloc(eep0, nrfx_gppi_group_task_en_addr(group), &ppi_on_rtc_match); if (ret < 0) { printk("Failed allocating for RTC match\n"); diff --git a/samples/bluetooth/conn_time_sync/src/controller_time_nrf54.c b/samples/bluetooth/conn_time_sync/src/controller_time_nrf54.c index 0f4ea039c9f0..6bf550e92ac4 100644 --- a/samples/bluetooth/conn_time_sync/src/controller_time_nrf54.c +++ b/samples/bluetooth/conn_time_sync/src/controller_time_nrf54.c @@ -18,10 +18,9 @@ int controller_time_init(void) int ret; ret = nrfx_grtc_channel_alloc(&grtc_channel); - if (ret != NRFX_SUCCESS) { - printk("Failed allocating GRTC channel (ret: %d)\n", - ret - NRFX_ERROR_BASE_NUM); - return -ENODEV; + if (ret < 0) { + printk("Failed allocating GRTC channel (ret: %d)\n", ret); + return ret; } nrf_grtc_sys_counter_compare_event_enable(NRF_GRTC, grtc_channel); diff --git a/samples/bluetooth/iso_time_sync/boards/nrf52833dk_nrf52833.conf b/samples/bluetooth/iso_time_sync/boards/nrf52833dk_nrf52833.conf index ec772c7e06d1..049731d69b6e 100644 --- a/samples/bluetooth/iso_time_sync/boards/nrf52833dk_nrf52833.conf +++ b/samples/bluetooth/iso_time_sync/boards/nrf52833dk_nrf52833.conf @@ -6,4 +6,3 @@ CONFIG_NRFX_TIMER=y CONFIG_NRFX_RTC2=y -CONFIG_NRFX_PPI=y diff --git a/samples/bluetooth/iso_time_sync/boards/nrf52840dk_nrf52840.conf b/samples/bluetooth/iso_time_sync/boards/nrf52840dk_nrf52840.conf index ec772c7e06d1..049731d69b6e 100644 --- a/samples/bluetooth/iso_time_sync/boards/nrf52840dk_nrf52840.conf +++ b/samples/bluetooth/iso_time_sync/boards/nrf52840dk_nrf52840.conf @@ -6,4 +6,3 @@ CONFIG_NRFX_TIMER=y CONFIG_NRFX_RTC2=y -CONFIG_NRFX_PPI=y 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 1f859865e37b..e18c27d8071e 100644 --- a/samples/bluetooth/iso_time_sync/src/controller_time_nrf52.c +++ b/samples/bluetooth/iso_time_sync/src/controller_time_nrf52.c @@ -158,12 +158,18 @@ int config_egu_trigger_on_rtc_and_timer_match(void) uint32_t tep1 = nrf_egu_task_address_get(NRF_EGU0, NRF_EGU_TASK_TRIGGER0); int ret; - ret = nrfx_gppi_group_alloc(&eep0, 1, &group); + ret = nrfx_gppi_group_alloc(nrfx_gppi_domain_id_get(eep0), &group); if (ret < 0) { printk("Failed allocating group\n"); return ret; } + ret = nrfx_gppi_group_ep_add(group, eep0); + if (ret < 0) { + printk("Failed attaching an event to the group\n"); + return ret; + } + ret = nrfx_gppi_conn_alloc(eep0, nrfx_gppi_group_task_en_addr(group), &ppi_on_rtc_match); if (ret < 0) { printk("Failed allocating for RTC match\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 5224866b5a21..e9411ce535f1 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 @@ -131,12 +131,18 @@ int config_egu_trigger_on_rtc_and_timer_match(void) uint32_t tep1 = nrf_egu_task_address_get(NRF_EGU0, NRF_EGU_TASK_TRIGGER0); int ret; - ret = nrfx_gppi_group_alloc(&eep0, 1, &group); + ret = nrfx_gppi_group_alloc(nrfx_gppi_domain_id_get(eep0), &group); if (ret < 0) { printk("Failed allocating group\n"); return ret; } + ret = nrfx_gppi_group_ep_add(group, eep0); + if (ret < 0) { + printk("Failed attaching an event to the group\n"); + return ret; + } + ret = nrfx_gppi_conn_alloc(eep0, nrfx_gppi_group_task_en_addr(group), &ppi_on_rtc_match); if (ret < 0) { printk("Failed allocating for RTC match\n"); diff --git a/samples/bluetooth/iso_time_sync/src/controller_time_nrf54.c b/samples/bluetooth/iso_time_sync/src/controller_time_nrf54.c index b4049880b850..20935f398b9e 100644 --- a/samples/bluetooth/iso_time_sync/src/controller_time_nrf54.c +++ b/samples/bluetooth/iso_time_sync/src/controller_time_nrf54.c @@ -18,10 +18,9 @@ int controller_time_init(void) int ret; ret = nrfx_grtc_channel_alloc(&grtc_channel); - if (ret != NRFX_SUCCESS) { - printk("Failed allocating GRTC channel (ret: %d)\n", - ret - NRFX_ERROR_BASE_NUM); - return -ENODEV; + if (ret < 0) { + printk("Failed allocating GRTC channel (ret: %d)\n", ret); + return ret; } nrf_grtc_sys_counter_compare_event_enable(NRF_GRTC, grtc_channel); diff --git a/samples/peripheral/802154_phy_test/src/rf_proc.c b/samples/peripheral/802154_phy_test/src/rf_proc.c index 5088b6a8fe80..92bc3fcf4526 100644 --- a/samples/peripheral/802154_phy_test/src/rf_proc.c +++ b/samples/peripheral/802154_phy_test/src/rf_proc.c @@ -140,6 +140,7 @@ static void configure_antenna_diversity(void) { nrfx_gpiote_t *gpiote = &GPIOTE_NRFX_INST_BY_NODE(DT_NODELABEL(gpiote0)); NRF_TIMER_Type *ad_timer = NRF_TIMER3; + int rv; nrf_802154_sl_ant_div_cfg_t cfg = { .ant_sel_pin = CONFIG_PTT_ANT_PIN, @@ -147,7 +148,10 @@ static void configure_antenna_diversity(void) .p_timer = ad_timer }; - (void)nrfx_gppi_channel_alloc(0 ,&cfg.ppi_ch); + rv = nrfx_gppi_channel_alloc(0); + __ASSERT_NO_MSG(rv >= 0); + cfg.ppi_ch = (uint8_t)rv; + (void)nrfx_gpiote_channel_alloc(gpiote, &cfg.gpiote_ch); nrf_802154_sl_ant_div_mode_t ant_div_auto = 0x02; diff --git a/subsys/esb/esb_dppi.c b/subsys/esb/esb_dppi.c index 0e52b8a430e0..49a54b931de9 100644 --- a/subsys/esb/esb_dppi.c +++ b/subsys/esb/esb_dppi.c @@ -217,51 +217,51 @@ int esb_ppi_init(void) ARG_UNUSED(err); #else - ch = nrfx_gppi_channel_alloc(domain_id, NULL); + ch = nrfx_gppi_channel_alloc(domain_id); if (ch < 0) { goto error; } radio_address_timer_stop = (uint8_t)ch; - ch = nrfx_gppi_channel_alloc(domain_id, NULL); + ch = nrfx_gppi_channel_alloc(domain_id); if (ch < 0) { goto error; } timer_compare0_radio_disable = (uint8_t)ch; - ch = nrfx_gppi_channel_alloc(domain_id, NULL); + ch = nrfx_gppi_channel_alloc(domain_id); if (ch < 0) { goto error; } timer_compare1_radio_txen = (uint8_t)ch; - ch = nrfx_gppi_channel_alloc(domain_id, NULL); + ch = nrfx_gppi_channel_alloc(domain_id); if (ch < 0) { goto error; } disabled_phy_end_egu = (uint8_t)ch; - ch = nrfx_gppi_channel_alloc(domain_id, NULL); + ch = nrfx_gppi_channel_alloc(domain_id); if (ch < 0) { goto error; } egu_timer_start = (uint8_t)ch; - ch = nrfx_gppi_channel_alloc(domain_id, NULL); + ch = nrfx_gppi_channel_alloc(domain_id); if (ch < 0) { goto error; } egu_ramp_up = (uint8_t)ch; if (IS_ENABLED(CONFIG_ESB_NEVER_DISABLE_TX)) { - ch = nrfx_gppi_channel_alloc(domain_id, NULL); + ch = nrfx_gppi_channel_alloc(domain_id); if (ch < 0) { goto error; } radio_end_timer_start = (uint8_t)ch; } - ch = nrfx_gppi_group_channel_alloc(domain_id, NULL); + ch = nrfx_gppi_group_channel_alloc(domain_id); if (ch < 0) { LOG_ERR("gppi_group_alloc failed with: %d\n", ch); return ch; diff --git a/subsys/esb/esb_ppi.c b/subsys/esb/esb_ppi.c index d16a2b317cce..852f8146ab95 100644 --- a/subsys/esb/esb_ppi.c +++ b/subsys/esb/esb_ppi.c @@ -187,51 +187,51 @@ int esb_ppi_init(void) { int ch; - ch = nrfx_gppi_channel_alloc(0, NULL); + ch = nrfx_gppi_channel_alloc(0); if (ch < 0) { goto error; } egu_ramp_up = (nrf_ppi_channel_t)ch; - ch = nrfx_gppi_channel_alloc(0, NULL); + ch = nrfx_gppi_channel_alloc(0); if (ch < 0) { goto error; } disabled_egu = (nrf_ppi_channel_t)ch; - ch = nrfx_gppi_channel_alloc(0, NULL); + ch = nrfx_gppi_channel_alloc(0); if (ch < 0) { goto error; } egu_timer_start = (nrf_ppi_channel_t)ch; - ch = nrfx_gppi_channel_alloc(0, NULL); + ch = nrfx_gppi_channel_alloc(0); if (ch < 0) { goto error; } radio_address_timer_stop = (nrf_ppi_channel_t)ch; - ch = nrfx_gppi_channel_alloc(0, NULL); + ch = nrfx_gppi_channel_alloc(0); if (ch < 0) { goto error; } timer_compare0_radio_disable = (nrf_ppi_channel_t)ch; - ch = nrfx_gppi_channel_alloc(0, NULL); + ch = nrfx_gppi_channel_alloc(0); if (ch < 0) { goto error; } timer_compare1_radio_txen = (nrf_ppi_channel_t)ch; if (IS_ENABLED(CONFIG_ESB_NEVER_DISABLE_TX)) { - ch = nrfx_gppi_channel_alloc(0, NULL); + ch = nrfx_gppi_channel_alloc(0); if (ch < 0) { goto error; } radio_end_timer_start = (nrf_ppi_channel_t)ch; } - ch = nrfx_gppi_group_channel_alloc(0, NULL); + ch = nrfx_gppi_group_channel_alloc(0); if (ch < 0) { LOG_ERR("gppi_group_alloc failed with: %d\n", ch); return ch; diff --git a/subsys/gazell/Kconfig b/subsys/gazell/Kconfig index 77ed2f6ea377..eb6b0aa9b62e 100644 --- a/subsys/gazell/Kconfig +++ b/subsys/gazell/Kconfig @@ -7,7 +7,7 @@ menuconfig GAZELL bool "Gazell" depends on GZLL && CLOCK_CONTROL_NRF - select NRFX_PPI if HAS_HW_NRF_PPI + select NRFX_GPPI help Enable Gazell functionality. diff --git a/subsys/mpsl/fem/common/mpsl_fem_utils.c b/subsys/mpsl/fem/common/mpsl_fem_utils.c index 5773fd0da220..f05f9a329aba 100644 --- a/subsys/mpsl/fem/common/mpsl_fem_utils.c +++ b/subsys/mpsl/fem/common/mpsl_fem_utils.c @@ -20,7 +20,7 @@ int mpsl_fem_utils_ppi_channel_alloc(uint8_t *ppi_channels, size_t size) #endif for (int i = 0; i < size; i++) { - ch = nrfx_gppi_channel_alloc(domain_id, NULL); + ch = nrfx_gppi_channel_alloc(domain_id); if (ch < 0) { return ch; } diff --git a/subsys/mpsl/hwres/mpsl_dppi.c b/subsys/mpsl/hwres/mpsl_dppi.c index d749a3d9e8f1..55335fffffee 100644 --- a/subsys/mpsl/hwres/mpsl_dppi.c +++ b/subsys/mpsl/hwres/mpsl_dppi.c @@ -10,7 +10,7 @@ #if defined(DPPI_PRESENT) || defined(LUMOS_XXAA) static bool mpsl_hwres_channel_alloc(uint32_t node_id, uint8_t *p_ch) { - int ch = nrfx_gppi_channel_alloc(node_id, NULL); + int ch = nrfx_gppi_channel_alloc(node_id); if (ch < 0) { return false; @@ -32,7 +32,7 @@ bool mpsl_hwres_dppi_channel_alloc(NRF_DPPIC_Type *p_dppic, uint8_t *p_dppi_ch) #if defined(PPIB_PRESENT) #if defined(LUMOS_XXAA) -#include +#include static uint32_t ppib_get_domain(NRF_PPIB_Type *p_ppib) { switch ((uint32_t)p_ppib) {