From 1d2357abe174addb26a996b79921242e3298341c Mon Sep 17 00:00:00 2001 From: Jakub Zymelka Date: Fri, 7 Nov 2025 17:47:55 +0100 Subject: [PATCH 01/72] manifest: Update sdk-zephyr, nrfxlib, tf-m and mcuboot revisions Update sdk-zephyr with collab-nrfx-4.0 merged to main branch. Update nrfxlib with major rework of GPPI library. Manifest sdk-mcuboot updated to nrfx_wdt changes. TF-M: platform: nordic_nrf: align to nrfx 4.0 Signed-off-by: Jakub Zymelka --- west.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/west.yml b/west.yml index 8a3ef33489b..9a3505c9102 100644 --- a/west.yml +++ b/west.yml @@ -64,7 +64,7 @@ manifest: # https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/modules.html - name: zephyr repo-path: sdk-zephyr - revision: dc05376c170fc2739a4881629caf49c40d485a9e + revision: 428ce9f27bc368f8023de98cdd494b060374962b import: # In addition to the zephyr repository itself, NCS also # imports the contents of zephyr/west.yml at the above @@ -126,7 +126,7 @@ manifest: compare-by-default: true - name: mcuboot repo-path: sdk-mcuboot - revision: 093efc87ca3057ab2bc3844af6bd924251ead62d + revision: 0d9411f5dda336b999c56c4eb13c502af8b59851 path: bootloader/mcuboot - name: qcbor url: https://github.com/laurencelundblade/QCBOR @@ -143,11 +143,11 @@ manifest: - name: nrfxlib repo-path: sdk-nrfxlib path: nrfxlib - revision: 6ab70a90ada3ffa173cd816f725a2cd9f35962f7 + revision: 9b969cc34b07d44c8b3ad5bb6fa5cab6646e7ed1 - name: trusted-firmware-m repo-path: sdk-trusted-firmware-m path: modules/tee/tf-m/trusted-firmware-m - revision: 565a30c7f4426cdf644bff03766a292dd509ee9c + revision: cc5a59a410adc66d3b1b34a24efe00a7ac2fcf5b - name: psa-arch-tests repo-path: sdk-psa-arch-tests path: modules/tee/tf-m/psa-arch-tests From 78a06cd99ce3cf18634f5ca1e92d68c352affd2f Mon Sep 17 00:00:00 2001 From: Marcin Jelinski Date: Tue, 28 Oct 2025 12:01:26 +0100 Subject: [PATCH 02/72] nfc: platform: Enable workaround for MLTPAN-60 anomaly Enabled workaround for MLTPAN-60 anomaly in NFC platform. Ref: NCSDK-31244 Signed-off-by: Marcin Jelinski --- subsys/nfc/lib/platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/nfc/lib/platform.c b/subsys/nfc/lib/platform.c index 4ca00fb83b4..0fde277662c 100644 --- a/subsys/nfc/lib/platform.c +++ b/subsys/nfc/lib/platform.c @@ -37,7 +37,7 @@ LOG_MODULE_REGISTER(nfc_platform, CONFIG_NFC_PLATFORM_LOG_LEVEL); #if NRF53_ERRATA_70_ENABLE_WORKAROUND || NRF52_ERRATA_190_ENABLE_WORKAROUND || \ - NRF52_ERRATA_79_ENABLE_WORKAROUND + NRF52_ERRATA_79_ENABLE_WORKAROUND || NRF54L_ERRATA_60_ENABLE_WORKAROUND #define NFC_PLATFORM_USE_TIMER_WORKAROUND 1 #else #define NFC_PLATFORM_USE_TIMER_WORKAROUND 0 From 5916263c0c0343bb4dfa7b8c97f3fdb8c664b895 Mon Sep 17 00:00:00 2001 From: Magdalena Pastula Date: Fri, 12 Sep 2025 13:48:17 +0200 Subject: [PATCH 03/72] modules: hal_nordic: nrfx: align MDK path to BSP Make MDK path dependent on BSP path, since it is now located there. Signed-off-by: Magdalena Pastula --- modules/hal_nordic/nrfx/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/hal_nordic/nrfx/CMakeLists.txt b/modules/hal_nordic/nrfx/CMakeLists.txt index 48bafb48fe8..c06089bd510 100644 --- a/modules/hal_nordic/nrfx/CMakeLists.txt +++ b/modules/hal_nordic/nrfx/CMakeLists.txt @@ -3,6 +3,9 @@ zephyr_library_amend(${ZEPHYR_NRF_MODULE_DIR}) +set(BSP_DIR ${NRFX_DIR}/bsp) +set(SOC_DIR ${BSP_DIR}/${CONFIG_SOC_NORDIC_BSP_NAME}) +set(MDK_DIR ${SOC_DIR}/mdk) set(mdk_dir ${NRFX_DIR}/mdk) set(helpers_dir ${NRFX_DIR}/helpers) @@ -16,7 +19,7 @@ zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF7120_ENGA NRF7120_ENGA_XXAA) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF7120_ENGA_CPUAPP NRF_APPLICATION) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF7120_ENGA_CPUFLPR NRF_FLPR) -zephyr_library_sources_ifdef(CONFIG_SOC_NRF7120_ENGA ${mdk_dir}/system_nrf7120_enga.c) +zephyr_library_sources_ifdef(CONFIG_SOC_NRF7120_ENGA ${MDK_DIR}/system_nrf7120_enga.c) mdk_svd_ifdef(CONFIG_SOC_NRF54LS05B_ENGA_CPUAPP nrf54ls05b_enga_application.svd) mdk_svd_ifdef(CONFIG_SOC_NRF54LV10A_ENGA_CPUAPP nrf54lv10a_enga_application.svd) From adeb2853d21bd9271cec10dab57dfa7ac2f6bd82 Mon Sep 17 00:00:00 2001 From: Magdalena Pastula Date: Mon, 15 Sep 2025 17:07:27 +0200 Subject: [PATCH 04/72] tests: drivers: nrfx_integration_test: remove selecting PRS BOX > 0 Remove selecting PRS BOX other than PRS_BOX_0, as it now causes compilation errors due to not checking if `NRFX_PRS_BOX_*_ADDR` is defined in nrfx driver. Signed-off-by: Magdalena Pastula --- tests/drivers/nrfx_integration_test/Kconfig | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/drivers/nrfx_integration_test/Kconfig b/tests/drivers/nrfx_integration_test/Kconfig index b3775f55a87..ce977a92737 100644 --- a/tests/drivers/nrfx_integration_test/Kconfig +++ b/tests/drivers/nrfx_integration_test/Kconfig @@ -142,9 +142,5 @@ config NRFX_ALL_DRIVERS select NRFX_WDT31 if HAS_HW_NRF_WDT31 select NRFX_WDT130 if HAS_HW_NRF_WDT130 select NRFX_PRS_BOX_0 - select NRFX_PRS_BOX_1 - select NRFX_PRS_BOX_2 - select NRFX_PRS_BOX_3 - select NRFX_PRS_BOX_4 source "Kconfig.zephyr" From 0aedd65b0a133f4a27c7d920ea03f7d5ed75847d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Thu, 18 Sep 2025 10:25:03 +0200 Subject: [PATCH 05/72] lib: ram_pwrdn: replace deprecated NRF_POWER symbol MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NRF_POWER_RAMPOWER_S0POWER is deprecated and is to be removed soon. Signed-off-by: Michał Stasiak --- lib/ram_pwrdn/ram_pwrdn.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ram_pwrdn/ram_pwrdn.c b/lib/ram_pwrdn/ram_pwrdn.c index 3c2cadf2ea6..9eb4d63e15f 100644 --- a/lib/ram_pwrdn/ram_pwrdn.c +++ b/lib/ram_pwrdn/ram_pwrdn.c @@ -88,8 +88,8 @@ static const struct ram_bank banks[] = { static void ram_bank_power_down(uint8_t bank_id, uint8_t first_section_id, uint8_t last_section_id) { #if defined(CONFIG_SOC_NRF52840) || defined(CONFIG_SOC_NRF52833) - uint32_t mask = GENMASK(NRF_POWER_RAMPOWER_S0POWER + last_section_id, - NRF_POWER_RAMPOWER_S0POWER + first_section_id); + uint32_t mask = GENMASK(NRF_POWER_RAMPOWER_S0POWER_POS + last_section_id, + NRF_POWER_RAMPOWER_S0POWER_POS + first_section_id); nrf_power_rampower_mask_off(NRF_POWER, bank_id, mask); #elif defined(CONFIG_SOC_NRF5340_CPUAPP) uint32_t mask = GENMASK(VMC_RAM_POWER_S0POWER_Pos + last_section_id, @@ -108,8 +108,8 @@ static void ram_bank_power_down(uint8_t bank_id, uint8_t first_section_id, uint8 static void ram_bank_power_up(uint8_t bank_id, uint8_t first_section_id, uint8_t last_section_id) { #if defined(CONFIG_SOC_NRF52840) || defined(CONFIG_SOC_NRF52833) - uint32_t mask = GENMASK(NRF_POWER_RAMPOWER_S0POWER + last_section_id, - NRF_POWER_RAMPOWER_S0POWER + first_section_id); + uint32_t mask = GENMASK(NRF_POWER_RAMPOWER_S0POWER_POS + last_section_id, + NRF_POWER_RAMPOWER_S0POWER_POS + first_section_id); nrf_power_rampower_mask_on(NRF_POWER, bank_id, mask); #elif defined(CONFIG_SOC_NRF5340_CPUAPP) uint32_t mask = GENMASK(VMC_RAM_POWER_S0POWER_Pos + last_section_id, From 4a6ae70cab8443e49a0ada1de4ee47e74dc4a392 Mon Sep 17 00:00:00 2001 From: Magdalena Pastula Date: Thu, 18 Sep 2025 16:00:44 +0200 Subject: [PATCH 06/72] scripts: quarantine: add not passing tests to quarantine Will be fixed in NRFX-8421. Signed-off-by: Magdalena Pastula --- scripts/quarantine.yaml | 13 +++++++++++++ scripts/quarantine_zephyr.yaml | 12 ++++++++++++ 2 files changed, 25 insertions(+) diff --git a/scripts/quarantine.yaml b/scripts/quarantine.yaml index e158a69ee19..0b35732b495 100644 --- a/scripts/quarantine.yaml +++ b/scripts/quarantine.yaml @@ -101,3 +101,16 @@ platforms: - nrf9160dk_nrf9160 comment: "https://nordicsemi.atlassian.net/browse/NCSDK-36569" + +- scenarios: + - sample.debug.memfault + - sample.debug.memfault.etb + platforms: + - nrf7002dk/nrf5340/cpuapp + comment: "https://nordicsemi.atlassian.net/browse/NRFX-8480" + +- scenarios: + - sample.bluetooth.peripheral_mds + platforms: + - nrf5340dk/nrf5340/cpuapp + comment: "https://nordicsemi.atlassian.net/browse/NRFX-8480" diff --git a/scripts/quarantine_zephyr.yaml b/scripts/quarantine_zephyr.yaml index 02db65cf099..5ea69b30d33 100644 --- a/scripts/quarantine_zephyr.yaml +++ b/scripts/quarantine_zephyr.yaml @@ -585,3 +585,15 @@ - nrf54h20dk@0.9.0/nrf54h20/cpuapp - nrf54h20dk@0.9.0/nrf54h20/cpurad comment: "Not compatible" + +- scenarios: + - arch.arm.*.no_optimizations + - llext.writable + - llext.writable_slid_linking + - llext.writable_relocatable_slid_linking + - llext.writable_relocatable + comment: "https://nordicsemi.atlassian.net/browse/NRFX-8497" + +- scenarios: + - examples.nrfx.* + comment: "https://nordicsemi.atlassian.net/browse/NRFX-8588" From 52101c2d56be76acf795807b357b42a5e57488be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Tue, 30 Sep 2025 12:17:13 +0200 Subject: [PATCH 07/72] applications: nrf5340_audio: add prescaler structure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added prescaler substructure to I2S configuration. Signed-off-by: Michał Stasiak --- applications/nrf5340_audio/src/modules/audio_i2s.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/applications/nrf5340_audio/src/modules/audio_i2s.c b/applications/nrf5340_audio/src/modules/audio_i2s.c index 2674e630b90..1182342b852 100644 --- a/applications/nrf5340_audio/src/modules/audio_i2s.c +++ b/applications/nrf5340_audio/src/modules/audio_i2s.c @@ -46,8 +46,11 @@ static nrfx_i2s_config_t cfg = { .mode = NRF_I2S_MODE_MASTER, .format = NRF_I2S_FORMAT_I2S, .alignment = NRF_I2S_ALIGN_LEFT, - .ratio = I2S_RATIO, - .mck_setup = 0x66666000, + .prescalers = { + .ratio = I2S_RATIO, + .mck_setup = 0x66666000, + .enable_bypass = false, + }, #if (CONFIG_AUDIO_BIT_DEPTH_16) .sample_width = NRF_I2S_SWIDTH_16BIT, #elif (CONFIG_AUDIO_BIT_DEPTH_32) @@ -57,7 +60,6 @@ static nrfx_i2s_config_t cfg = { #endif /* (CONFIG_AUDIO_BIT_DEPTH_16) */ .channels = NRF_I2S_CHANNELS_STEREO, .clksrc = NRF_I2S_CLKSRC_ACLK, - .enable_bypass = false, }; static i2s_blk_comp_callback_t i2s_blk_comp_callback; From 590595ded24822800e0de823312a814f263ba40d Mon Sep 17 00:00:00 2001 From: Jakub Zymelka Date: Mon, 13 Oct 2025 10:33:09 +0200 Subject: [PATCH 08/72] dts: common: nordic: Switch saadc pin definitions for generic ones Switch saadc pin definitions for generic ones defined in nrf-saadc.h Signed-off-by: Jakub Zymelka --- dts/common/nordic/nrf54ls05b.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dts/common/nordic/nrf54ls05b.dtsi b/dts/common/nordic/nrf54ls05b.dtsi index 3f7f5bf6ad8..0491e052ed8 100644 --- a/dts/common/nordic/nrf54ls05b.dtsi +++ b/dts/common/nordic/nrf54ls05b.dtsi @@ -6,7 +6,7 @@ #include #include -#include +#include #include /delete-node/ &sw_pwm; From dc295f7bf0ac6386a10e3aa89167eaa7a05909d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Tue, 30 Sep 2025 14:41:43 +0200 Subject: [PATCH 09/72] tests: drivers: nrfx_integration_test: remove deleted configs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removed instance specific SPIM and SPIS config symbols. Signed-off-by: Michał Stasiak --- tests/drivers/nrfx_integration_test/Kconfig | 24 --------------------- 1 file changed, 24 deletions(-) diff --git a/tests/drivers/nrfx_integration_test/Kconfig b/tests/drivers/nrfx_integration_test/Kconfig index ce977a92737..b7dc66e9391 100644 --- a/tests/drivers/nrfx_integration_test/Kconfig +++ b/tests/drivers/nrfx_integration_test/Kconfig @@ -54,30 +54,6 @@ config NRFX_ALL_DRIVERS select NRFX_SPI0 if HAS_HW_NRF_SPI0 select NRFX_SPI1 if HAS_HW_NRF_SPI1 select NRFX_SPI2 if HAS_HW_NRF_SPI2 - select NRFX_SPIM0 if HAS_HW_NRF_SPIM0 - select NRFX_SPIM1 if HAS_HW_NRF_SPIM1 - select NRFX_SPIM2 if HAS_HW_NRF_SPIM2 - select NRFX_SPIM3 if HAS_HW_NRF_SPIM3 - select NRFX_SPIM4 if HAS_HW_NRF_SPIM4 - select NRFX_SPIM00 if HAS_HW_NRF_SPIM00 - select NRFX_SPIM20 if HAS_HW_NRF_SPIM20 - select NRFX_SPIM21 if HAS_HW_NRF_SPIM21 - select NRFX_SPIM22 if HAS_HW_NRF_SPIM22 - select NRFX_SPIM30 if HAS_HW_NRF_SPIM30 - select NRFX_SPIM120 if HAS_HW_NRF_SPIM120 - select NRFX_SPIM121 if HAS_HW_NRF_SPIM121 - select NRFX_SPIM130 if HAS_HW_NRF_SPIM130 - select NRFX_SPIM131 if HAS_HW_NRF_SPIM131 - select NRFX_SPIM132 if HAS_HW_NRF_SPIM132 - select NRFX_SPIM133 if HAS_HW_NRF_SPIM133 - select NRFX_SPIM134 if HAS_HW_NRF_SPIM134 - select NRFX_SPIM135 if HAS_HW_NRF_SPIM135 - select NRFX_SPIM136 if HAS_HW_NRF_SPIM136 - select NRFX_SPIM137 if HAS_HW_NRF_SPIM137 - select NRFX_SPIS0 if HAS_HW_NRF_SPIS0 - select NRFX_SPIS1 if HAS_HW_NRF_SPIS1 - select NRFX_SPIS2 if HAS_HW_NRF_SPIS2 - select NRFX_SPIS3 if HAS_HW_NRF_SPIS3 select NRFX_SYSTICK if CPU_CORTEX_M_HAS_SYSTICK select NRFX_TEMP if HAS_HW_NRF_TEMP select NRFX_TIMER0 if HAS_HW_NRF_TIMER0 From c841ba59f9f3572f873714ae1d95809ac34ee111 Mon Sep 17 00:00:00 2001 From: Marcin Szymczyk Date: Thu, 2 Oct 2025 16:32:58 +0200 Subject: [PATCH 10/72] treewide: align to modified include paths in nrfx Include nrfx instead of MDK. Signed-off-by: Marcin Szymczyk --- include/bl_storage.h | 2 +- include/drivers/gpio/hpf_gpio.h | 2 +- include/esb.h | 2 +- include/tfm/tfm_builtin_key_ids.h | 2 +- lib/fem_al/fem_al.c | 2 +- lib/flash_patch/flash_patch.c | 2 +- lib/fprotect/fprotect_bprot.c | 2 +- lib/fprotect/fprotect_rram.c | 2 +- lib/fprotect/fprotect_spu.c | 2 +- lib/hw_unique_key/hw_unique_key_cc3xx_kmu.c | 1 - lib/nrf_modem_lib/nrf_modem_os.c | 2 +- modules/nrfxlib/nrf_802154/sl/platform/nrf_802154_hp_timer.c | 2 +- .../services/include/tfm_platform_user_memory_ranges.h | 2 +- .../trusted-firmware-m/tfm_boards/src/log_memory_protection.c | 3 +-- samples/benchmarks/coremark/src/main.c | 2 +- samples/bluetooth/direct_test_mode/src/dtm.c | 1 - samples/bluetooth/direct_test_mode/src/dtm_hw.c | 2 +- samples/crypto/psa_tls/src/main.c | 2 +- .../psa_tls/src/non-secure/psa_tls_credentials_client.c | 2 +- .../psa_tls/src/non-secure/psa_tls_credentials_server.c | 2 +- samples/crypto/psa_tls/src/psa_dtls_functions_client.c | 2 +- samples/crypto/psa_tls/src/psa_dtls_functions_server.c | 2 +- samples/crypto/psa_tls/src/psa_tls_common.c | 2 +- samples/crypto/psa_tls/src/psa_tls_functions_client.c | 2 +- samples/crypto/psa_tls/src/psa_tls_functions_server.c | 2 +- .../crypto/psa_tls/src/secure/psa_tls_credentials_client.c | 2 +- .../crypto/psa_tls/src/secure/psa_tls_credentials_server.c | 2 +- samples/esb/esb_monitor/src/main.c | 3 +-- samples/esb/esb_prx/src/main.c | 3 +-- samples/esb/esb_ptx/src/main.c | 3 +-- samples/nrf5340/empty_app_core/README.rst | 1 - samples/nrf5340/empty_app_core/src/main.c | 1 - samples/peripheral/radio_test/src/main.c | 2 +- samples/peripheral/radio_test/src/radio_test.c | 1 - soc/nordic/nrf71/soc.c | 4 ++-- subsys/bootloader/bl_crypto/bl_crypto_cc310_common.c | 2 +- subsys/bootloader/bl_storage/bl_storage.c | 2 +- subsys/esb/esb.c | 3 +-- subsys/mpsl/clock_ctrl/mpsl_clock_ctrl.c | 1 + subsys/nfc/lib/platform.c | 2 -- .../src/drivers/cracen/common/include/security/cracen.h | 2 +- .../nrf_security/src/drivers/cracen/cracenpsa/src/lib_kmu.c | 2 +- subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/hw.h | 2 +- subsys/nrf_security/src/utils/nrf_security_core.c | 2 +- 44 files changed, 39 insertions(+), 50 deletions(-) diff --git a/include/bl_storage.h b/include/bl_storage.h index 850242a99f3..792114399ea 100644 --- a/include/bl_storage.h +++ b/include/bl_storage.h @@ -10,7 +10,7 @@ #include #include #include -#include +#include #if defined(CONFIG_NRFX_NVMC) #include #elif defined(CONFIG_NRFX_RRAMC) diff --git a/include/drivers/gpio/hpf_gpio.h b/include/drivers/gpio/hpf_gpio.h index 2f16d27ef68..c90a873909c 100644 --- a/include/drivers/gpio/hpf_gpio.h +++ b/include/drivers/gpio/hpf_gpio.h @@ -7,7 +7,7 @@ #ifndef HPF_GPIO_H #define HPF_GPIO_H -#include +#include #include #ifdef __cplusplus diff --git a/include/esb.h b/include/esb.h index 692dc66ab0b..81d21b4aaf2 100644 --- a/include/esb.h +++ b/include/esb.h @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include diff --git a/include/tfm/tfm_builtin_key_ids.h b/include/tfm/tfm_builtin_key_ids.h index 9750d2d5689..2e738374cbf 100644 --- a/include/tfm/tfm_builtin_key_ids.h +++ b/include/tfm/tfm_builtin_key_ids.h @@ -7,7 +7,7 @@ #ifndef __TFM_BUILTIN_KEY_IDS_H__ #define __TFM_BUILTIN_KEY_IDS_H__ -#include +#include #if defined(NRF_CRACENCORE) || defined(CONFIG_HAS_HW_NRF_CRACEN) diff --git a/lib/fem_al/fem_al.c b/lib/fem_al/fem_al.c index eecce4f635b..719430348be 100644 --- a/lib/fem_al/fem_al.c +++ b/lib/fem_al/fem_al.c @@ -12,7 +12,7 @@ #ifdef DPPI_PRESENT #include #endif -#include +#include #include diff --git a/lib/flash_patch/flash_patch.c b/lib/flash_patch/flash_patch.c index c6b97a402f9..6756b89b642 100644 --- a/lib/flash_patch/flash_patch.c +++ b/lib/flash_patch/flash_patch.c @@ -4,7 +4,7 @@ * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ -#include +#include #include #include diff --git a/lib/fprotect/fprotect_bprot.c b/lib/fprotect/fprotect_bprot.c index cf20be2c2b1..dc65fbc177d 100644 --- a/lib/fprotect/fprotect_bprot.c +++ b/lib/fprotect/fprotect_bprot.c @@ -4,7 +4,7 @@ * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ -#include +#include #if defined(NRF_BPROT) #include #define PROTECT nrf_bprot_nvm_blocks_protection_enable diff --git a/lib/fprotect/fprotect_rram.c b/lib/fprotect/fprotect_rram.c index dbc9ce4a7e2..1c85c982596 100644 --- a/lib/fprotect/fprotect_rram.c +++ b/lib/fprotect/fprotect_rram.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #define RRAMC_REGION_FOR_FPROTECT_DEFAULT_VALUE 0x0000000f diff --git a/lib/fprotect/fprotect_spu.c b/lib/fprotect/fprotect_spu.c index d2aafd5b9c9..7f842964815 100644 --- a/lib/fprotect/fprotect_spu.c +++ b/lib/fprotect/fprotect_spu.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #define SPU_BLOCK_SIZE CONFIG_FPROTECT_BLOCK_SIZE diff --git a/lib/hw_unique_key/hw_unique_key_cc3xx_kmu.c b/lib/hw_unique_key/hw_unique_key_cc3xx_kmu.c index 3eb74cf9da6..41da5f0921a 100644 --- a/lib/hw_unique_key/hw_unique_key_cc3xx_kmu.c +++ b/lib/hw_unique_key/hw_unique_key_cc3xx_kmu.c @@ -11,7 +11,6 @@ #include #include -#include #include #define KMU_KEYSLOT_SIZE_WORDS 4 diff --git a/lib/nrf_modem_lib/nrf_modem_os.c b/lib/nrf_modem_lib/nrf_modem_os.c index 7c76cc750f3..9db7796a685 100644 --- a/lib/nrf_modem_lib/nrf_modem_os.c +++ b/lib/nrf_modem_lib/nrf_modem_os.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include diff --git a/modules/nrfxlib/nrf_802154/sl/platform/nrf_802154_hp_timer.c b/modules/nrfxlib/nrf_802154/sl/platform/nrf_802154_hp_timer.c index 79bf80cdf6b..69e07fbce96 100644 --- a/modules/nrfxlib/nrf_802154/sl/platform/nrf_802154_hp_timer.c +++ b/modules/nrfxlib/nrf_802154/sl/platform/nrf_802154_hp_timer.c @@ -19,7 +19,7 @@ #include #include -#include "nrf.h" +#include "nrfx.h" #include "hal/nrf_timer.h" #include "nrf_802154_sl_periphs.h" diff --git a/modules/trusted-firmware-m/tfm_boards/services/include/tfm_platform_user_memory_ranges.h b/modules/trusted-firmware-m/tfm_boards/services/include/tfm_platform_user_memory_ranges.h index e0111102f28..465ffddc434 100644 --- a/modules/trusted-firmware-m/tfm_boards/services/include/tfm_platform_user_memory_ranges.h +++ b/modules/trusted-firmware-m/tfm_boards/services/include/tfm_platform_user_memory_ranges.h @@ -11,7 +11,7 @@ #include -#include "nrf.h" +#include "nrfx.h" /* * On platforms like nrf53 we provide a service for reading out diff --git a/modules/trusted-firmware-m/tfm_boards/src/log_memory_protection.c b/modules/trusted-firmware-m/tfm_boards/src/log_memory_protection.c index 86de76a1bc1..5122f9d6a2d 100644 --- a/modules/trusted-firmware-m/tfm_boards/src/log_memory_protection.c +++ b/modules/trusted-firmware-m/tfm_boards/src/log_memory_protection.c @@ -7,8 +7,7 @@ #include #include #include -#include -#include +#include #include #include diff --git a/samples/benchmarks/coremark/src/main.c b/samples/benchmarks/coremark/src/main.c index 5343445aad5..fb5e2d82811 100644 --- a/samples/benchmarks/coremark/src/main.c +++ b/samples/benchmarks/coremark/src/main.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include "coremark_zephyr.h" diff --git a/samples/bluetooth/direct_test_mode/src/dtm.c b/samples/bluetooth/direct_test_mode/src/dtm.c index ba5d728e48a..79ce90ce6bc 100644 --- a/samples/bluetooth/direct_test_mode/src/dtm.c +++ b/samples/bluetooth/direct_test_mode/src/dtm.c @@ -37,7 +37,6 @@ #include #include -#include #if NRF54L_ERRATA_20_PRESENT #include #endif /* NRF54L_ERRATA_20_PRESENT */ diff --git a/samples/bluetooth/direct_test_mode/src/dtm_hw.c b/samples/bluetooth/direct_test_mode/src/dtm_hw.c index 85dec3b5c32..ecabe4bb20d 100644 --- a/samples/bluetooth/direct_test_mode/src/dtm_hw.c +++ b/samples/bluetooth/direct_test_mode/src/dtm_hw.c @@ -4,7 +4,7 @@ * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ -#include "nrf.h" +#include "nrfx.h" #include "dtm_hw.h" #include "dtm_hw_config.h" diff --git a/samples/crypto/psa_tls/src/main.c b/samples/crypto/psa_tls/src/main.c index e9b4f64595f..882db46708d 100644 --- a/samples/crypto/psa_tls/src/main.c +++ b/samples/crypto/psa_tls/src/main.c @@ -4,7 +4,7 @@ * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ -#include +#include #include #include #include diff --git a/samples/crypto/psa_tls/src/non-secure/psa_tls_credentials_client.c b/samples/crypto/psa_tls/src/non-secure/psa_tls_credentials_client.c index 7e863289530..f3e4ede373d 100644 --- a/samples/crypto/psa_tls/src/non-secure/psa_tls_credentials_client.c +++ b/samples/crypto/psa_tls/src/non-secure/psa_tls_credentials_client.c @@ -7,7 +7,7 @@ #include LOG_MODULE_REGISTER(psa_tls_credentials_client_non_secure); -#include +#include #include #include #include diff --git a/samples/crypto/psa_tls/src/non-secure/psa_tls_credentials_server.c b/samples/crypto/psa_tls/src/non-secure/psa_tls_credentials_server.c index 8397231cea9..6867710ee50 100644 --- a/samples/crypto/psa_tls/src/non-secure/psa_tls_credentials_server.c +++ b/samples/crypto/psa_tls/src/non-secure/psa_tls_credentials_server.c @@ -7,7 +7,7 @@ #include LOG_MODULE_REGISTER(psa_tls_credentials_server_non_secure); -#include +#include #include #include #include diff --git a/samples/crypto/psa_tls/src/psa_dtls_functions_client.c b/samples/crypto/psa_tls/src/psa_dtls_functions_client.c index 6a4c40d4c77..167777717d4 100644 --- a/samples/crypto/psa_tls/src/psa_dtls_functions_client.c +++ b/samples/crypto/psa_tls/src/psa_dtls_functions_client.c @@ -7,7 +7,7 @@ #include LOG_MODULE_REGISTER(psa_dtls_client); -#include +#include #include #include #include diff --git a/samples/crypto/psa_tls/src/psa_dtls_functions_server.c b/samples/crypto/psa_tls/src/psa_dtls_functions_server.c index 59fe44f4fb3..58e938f6ea2 100644 --- a/samples/crypto/psa_tls/src/psa_dtls_functions_server.c +++ b/samples/crypto/psa_tls/src/psa_dtls_functions_server.c @@ -7,7 +7,7 @@ #include LOG_MODULE_REGISTER(psa_dtls_server); -#include +#include #include #include #include diff --git a/samples/crypto/psa_tls/src/psa_tls_common.c b/samples/crypto/psa_tls/src/psa_tls_common.c index 5beeaec059e..bffd2da414f 100644 --- a/samples/crypto/psa_tls/src/psa_tls_common.c +++ b/samples/crypto/psa_tls/src/psa_tls_common.c @@ -4,7 +4,7 @@ * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ -#include +#include #include #include #include diff --git a/samples/crypto/psa_tls/src/psa_tls_functions_client.c b/samples/crypto/psa_tls/src/psa_tls_functions_client.c index bf003656d52..ee8b8031c3d 100644 --- a/samples/crypto/psa_tls/src/psa_tls_functions_client.c +++ b/samples/crypto/psa_tls/src/psa_tls_functions_client.c @@ -7,7 +7,7 @@ #include LOG_MODULE_REGISTER(psa_tls_client); -#include +#include #include #include #include diff --git a/samples/crypto/psa_tls/src/psa_tls_functions_server.c b/samples/crypto/psa_tls/src/psa_tls_functions_server.c index e0a556f1e5c..3ea0030cd46 100644 --- a/samples/crypto/psa_tls/src/psa_tls_functions_server.c +++ b/samples/crypto/psa_tls/src/psa_tls_functions_server.c @@ -7,7 +7,7 @@ #include LOG_MODULE_REGISTER(psa_tls_server); -#include +#include #include #include #include diff --git a/samples/crypto/psa_tls/src/secure/psa_tls_credentials_client.c b/samples/crypto/psa_tls/src/secure/psa_tls_credentials_client.c index 3f4a1b9a03c..d7c7255130a 100644 --- a/samples/crypto/psa_tls/src/secure/psa_tls_credentials_client.c +++ b/samples/crypto/psa_tls/src/secure/psa_tls_credentials_client.c @@ -7,7 +7,7 @@ #include LOG_MODULE_REGISTER(psa_tls_credentials_client_secure); -#include +#include #include #include #include diff --git a/samples/crypto/psa_tls/src/secure/psa_tls_credentials_server.c b/samples/crypto/psa_tls/src/secure/psa_tls_credentials_server.c index 24a14b9ca90..f1b77f4da9d 100644 --- a/samples/crypto/psa_tls/src/secure/psa_tls_credentials_server.c +++ b/samples/crypto/psa_tls/src/secure/psa_tls_credentials_server.c @@ -7,7 +7,7 @@ #include LOG_MODULE_REGISTER(psa_tls_credentials_server_secure); -#include +#include #include #include #include diff --git a/samples/esb/esb_monitor/src/main.c b/samples/esb/esb_monitor/src/main.c index 860192e122d..d4f5a07e4c9 100644 --- a/samples/esb/esb_monitor/src/main.c +++ b/samples/esb/esb_monitor/src/main.c @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include @@ -18,7 +18,6 @@ #if defined(CONFIG_CLOCK_CONTROL_NRF2) #include #endif -#include #if NRF54L_ERRATA_20_PRESENT #include #endif /* NRF54L_ERRATA_20_PRESENT */ diff --git a/samples/esb/esb_prx/src/main.c b/samples/esb/esb_prx/src/main.c index 52271ee3587..27a387a8503 100644 --- a/samples/esb/esb_prx/src/main.c +++ b/samples/esb/esb_prx/src/main.c @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include @@ -19,7 +19,6 @@ #if defined(CONFIG_CLOCK_CONTROL_NRF2) #include #endif -#include #if NRF54L_ERRATA_20_PRESENT #include #endif /* NRF54L_ERRATA_20_PRESENT */ diff --git a/samples/esb/esb_ptx/src/main.c b/samples/esb/esb_ptx/src/main.c index 9a1af01e29e..9effc6bde52 100644 --- a/samples/esb/esb_ptx/src/main.c +++ b/samples/esb/esb_ptx/src/main.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include #include @@ -19,7 +19,6 @@ #if defined(CONFIG_CLOCK_CONTROL_NRF2) #include #endif -#include #if NRF54L_ERRATA_20_PRESENT #include #endif /* NRF54L_ERRATA_20_PRESENT */ diff --git a/samples/nrf5340/empty_app_core/README.rst b/samples/nrf5340/empty_app_core/README.rst index a1fd28b87ff..f38ee44743f 100644 --- a/samples/nrf5340/empty_app_core/README.rst +++ b/samples/nrf5340/empty_app_core/README.rst @@ -55,7 +55,6 @@ Dependencies This sample has the following `nrfx`_ dependencies: -* ``nrfx/nrf.h`` * ``nrfx/nrfx.h`` In addition, it uses the following Zephyr libraries: diff --git a/samples/nrf5340/empty_app_core/src/main.c b/samples/nrf5340/empty_app_core/src/main.c index 458d5f0d866..754f6d567c7 100644 --- a/samples/nrf5340/empty_app_core/src/main.c +++ b/samples/nrf5340/empty_app_core/src/main.c @@ -7,7 +7,6 @@ #include #include #include -#include #include #define LFXO_NODE DT_NODELABEL(lfxo) diff --git a/samples/peripheral/radio_test/src/main.c b/samples/peripheral/radio_test/src/main.c index 501ed6622cb..1becef74d6c 100644 --- a/samples/peripheral/radio_test/src/main.c +++ b/samples/peripheral/radio_test/src/main.c @@ -14,7 +14,7 @@ #if defined(CONFIG_CLOCK_CONTROL_NRF2) #include #endif -#include +#include #if NRF54L_ERRATA_20_PRESENT #include #endif /* NRF54L_ERRATA_20_PRESENT */ diff --git a/samples/peripheral/radio_test/src/radio_test.c b/samples/peripheral/radio_test/src/radio_test.c index 3f19ab7dac5..f933ef9a1a4 100644 --- a/samples/peripheral/radio_test/src/radio_test.c +++ b/samples/peripheral/radio_test/src/radio_test.c @@ -28,7 +28,6 @@ #include "fem_al/fem_al.h" #endif /* CONFIG_FEM */ -#include #if NRF54H_ERRATA_216_PRESENT #include #endif /* NRF54H_ERRATA_216_PRESENT */ diff --git a/soc/nordic/nrf71/soc.c b/soc/nordic/nrf71/soc.c index 5ebc2290bce..309888a77d1 100644 --- a/soc/nordic/nrf71/soc.c +++ b/soc/nordic/nrf71/soc.c @@ -29,10 +29,10 @@ #include #include #endif + +#include #include -#include -#include #include #include diff --git a/subsys/bootloader/bl_crypto/bl_crypto_cc310_common.c b/subsys/bootloader/bl_crypto/bl_crypto_cc310_common.c index 281ca2dc12f..9846c5540d6 100644 --- a/subsys/bootloader/bl_crypto/bl_crypto_cc310_common.c +++ b/subsys/bootloader/bl_crypto/bl_crypto_cc310_common.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include diff --git a/subsys/bootloader/bl_storage/bl_storage.c b/subsys/bootloader/bl_storage/bl_storage.c index cc03d5e6c54..0d4b3d3058d 100644 --- a/subsys/bootloader/bl_storage/bl_storage.c +++ b/subsys/bootloader/bl_storage/bl_storage.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #if !defined(CONFIG_BUILD_WITH_TFM) #include diff --git a/subsys/esb/esb.c b/subsys/esb/esb.c index e3c2c0478e8..6c59d4290f1 100644 --- a/subsys/esb/esb.c +++ b/subsys/esb/esb.c @@ -4,11 +4,10 @@ * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ #include -#include +#include #include #include #include -#include #include #include diff --git a/subsys/mpsl/clock_ctrl/mpsl_clock_ctrl.c b/subsys/mpsl/clock_ctrl/mpsl_clock_ctrl.c index 99d072cb803..7fbec7a9924 100644 --- a/subsys/mpsl/clock_ctrl/mpsl_clock_ctrl.c +++ b/subsys/mpsl/clock_ctrl/mpsl_clock_ctrl.c @@ -15,6 +15,7 @@ #include #include "mpsl_clock_ctrl.h" +#include "nrf_errno.h" LOG_MODULE_REGISTER(mpsl_clock_ctrl, CONFIG_MPSL_LOG_LEVEL); diff --git a/subsys/nfc/lib/platform.c b/subsys/nfc/lib/platform.c index 0fde277662c..d16d5c0c30a 100644 --- a/subsys/nfc/lib/platform.c +++ b/subsys/nfc/lib/platform.c @@ -18,8 +18,6 @@ #include #include -#include - #include #include #include diff --git a/subsys/nrf_security/src/drivers/cracen/common/include/security/cracen.h b/subsys/nrf_security/src/drivers/cracen/common/include/security/cracen.h index 8096193eb88..0a0c8a37467 100644 --- a/subsys/nrf_security/src/drivers/cracen/common/include/security/cracen.h +++ b/subsys/nrf_security/src/drivers/cracen/common/include/security/cracen.h @@ -16,7 +16,7 @@ #include #include -#include +#include #include diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/lib_kmu.c b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/lib_kmu.c index a6fc0028b12..d3633722c4b 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/lib_kmu.c +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/lib_kmu.c @@ -10,7 +10,7 @@ #include -#include +#include #if defined(CONFIG_SOC_SERIES_NRF54LX) #include diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/hw.h b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/hw.h index d736cf2c6af..036832f8dcd 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/hw.h +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/hw.h @@ -8,7 +8,7 @@ #define HW_HEADER_FILE #include -#include +#include #include #include #include diff --git a/subsys/nrf_security/src/utils/nrf_security_core.c b/subsys/nrf_security/src/utils/nrf_security_core.c index 3031c24367f..7bc25f3e5a7 100644 --- a/subsys/nrf_security/src/utils/nrf_security_core.c +++ b/subsys/nrf_security/src/utils/nrf_security_core.c @@ -9,7 +9,7 @@ #if defined(CONFIG_MULTITHREADING) && !defined(__NRF_TFM__) #include #else -#include +#include #endif #if defined(CONFIG_MULTITHREADING) && !defined(__NRF_TFM__) From 9455f53b81dd93517f5b05344a3054f8633c44b0 Mon Sep 17 00:00:00 2001 From: Marcin Szymczyk Date: Thu, 23 Oct 2025 10:13:41 +0200 Subject: [PATCH 11/72] samples: bluetooth: align to nrfx 4.0 `nrfx_grtc_syscounter_get()` does not take a pointer anymore. Signed-off-by: Marcin Szymczyk --- .../conn_time_sync/src/controller_time_nrf54.c | 11 +---------- .../iso_time_sync/src/controller_time_nrf54.c | 11 +---------- 2 files changed, 2 insertions(+), 20 deletions(-) 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 2d5d42e3a45..0f4ea039c9f 100644 --- a/samples/bluetooth/conn_time_sync/src/controller_time_nrf54.c +++ b/samples/bluetooth/conn_time_sync/src/controller_time_nrf54.c @@ -31,16 +31,7 @@ int controller_time_init(void) uint64_t controller_time_us_get(void) { - int ret; - uint64_t current_time_us; - - ret = nrfx_grtc_syscounter_get(¤t_time_us); - if (ret != NRFX_SUCCESS) { - printk("Failed obtaining system time (ret: %d)\n", ret - NRFX_ERROR_BASE_NUM); - return 0; - } - - return current_time_us; + return nrfx_grtc_syscounter_get(); } void controller_time_trigger_set(uint64_t timestamp_us) 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 cef75738556..b4049880b85 100644 --- a/samples/bluetooth/iso_time_sync/src/controller_time_nrf54.c +++ b/samples/bluetooth/iso_time_sync/src/controller_time_nrf54.c @@ -31,16 +31,7 @@ int controller_time_init(void) uint64_t controller_time_us_get(void) { - int ret; - uint64_t current_time_us; - - ret = nrfx_grtc_syscounter_get(¤t_time_us); - if (ret != NRFX_SUCCESS) { - printk("Failed obtaining system time (ret: %d)\n", ret - NRFX_ERROR_BASE_NUM); - return 0; - } - - return current_time_us; + return nrfx_grtc_syscounter_get(); } void controller_time_trigger_set(uint64_t timestamp_us) From be4e5b200d65b54dbe2c402ed9bc06a38b93d24e Mon Sep 17 00:00:00 2001 From: Marcin Szymczyk Date: Tue, 28 Oct 2025 18:16:17 +0100 Subject: [PATCH 12/72] tests: bluetooth: replace deprecated API Replace deprecated nrfx_clock call with new one. Signed-off-by: Marcin Szymczyk --- tests/bluetooth/iso/src/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/bluetooth/iso/src/main.c b/tests/bluetooth/iso/src/main.c index c808abfcf8a..5600328f1a8 100644 --- a/tests/bluetooth/iso/src/main.c +++ b/tests/bluetooth/iso/src/main.c @@ -23,8 +23,10 @@ static int hfclock_config_and_start(void) return ret; } + nrf_clock_hfclk_t clk_src; + nrfx_clock_hfclk_start(); - while (!nrfx_clock_hfclk_is_running()) { + while (!nrfx_clock_hfclk_running_check(&clk_src)) { } return 0; From c533a41ae9dc2be28588c66f9ea32110f9d80bba Mon Sep 17 00:00:00 2001 From: Jakub Zymelka Date: Fri, 17 Oct 2025 14:58:16 +0200 Subject: [PATCH 13/72] application: nrf5340_audio: Align to new I2S driver Rename I2S0 symbol from Kconfig. Align audio_i2s module to the new nrfx I2S driver. Signed-off-by: Jakub Zymelka --- applications/nrf5340_audio/Kconfig.defaults | 2 +- applications/nrf5340_audio/src/modules/audio_i2s.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/applications/nrf5340_audio/Kconfig.defaults b/applications/nrf5340_audio/Kconfig.defaults index 86398aa1965..342725b2fe2 100644 --- a/applications/nrf5340_audio/Kconfig.defaults +++ b/applications/nrf5340_audio/Kconfig.defaults @@ -48,7 +48,7 @@ config REGULATOR config CONTIN_ARRAY default y -config NRFX_I2S0 +config NRFX_I2S default y config PCM_MIX diff --git a/applications/nrf5340_audio/src/modules/audio_i2s.c b/applications/nrf5340_audio/src/modules/audio_i2s.c index 1182342b852..bf09c8790de 100644 --- a/applications/nrf5340_audio/src/modules/audio_i2s.c +++ b/applications/nrf5340_audio/src/modules/audio_i2s.c @@ -36,7 +36,7 @@ PINCTRL_DT_DEFINE(I2S_NL); #error "Current AUDIO_SAMPLE_RATE_HZ setting not supported" #endif -static nrfx_i2s_t i2s_inst = NRFX_I2S_INSTANCE(0); +static nrfx_i2s_t i2s_inst = NRFX_I2S_INSTANCE(NRF_I2S0); static nrfx_i2s_config_t cfg = { /* Pins are configured by pinctrl. */ @@ -150,7 +150,7 @@ void audio_i2s_init(void) ret = pinctrl_apply_state(PINCTRL_DT_DEV_CONFIG_GET(I2S_NL), PINCTRL_STATE_DEFAULT); __ASSERT_NO_MSG(ret == 0); - IRQ_CONNECT(DT_IRQN(I2S_NL), DT_IRQ(I2S_NL, priority), nrfx_isr, nrfx_i2s_0_irq_handler, 0); + IRQ_CONNECT(DT_IRQN(I2S_NL), DT_IRQ(I2S_NL, priority), nrfx_i2s_irq_handler, &i2s_inst, 0); irq_enable(DT_IRQN(I2S_NL)); ret = nrfx_i2s_init(&i2s_inst, &cfg, i2s_comp_handler); From a558c352d7236896d37aac99923a5a0f07e03061 Mon Sep 17 00:00:00 2001 From: Jakub Zymelka Date: Fri, 17 Oct 2025 15:11:11 +0200 Subject: [PATCH 14/72] tests: drivers: nrfx_integration_test: remove deleted I2S configs Removed instance specific I2S config symbols. Signed-off-by: Jakub Zymelka --- tests/drivers/nrfx_integration_test/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/drivers/nrfx_integration_test/Kconfig b/tests/drivers/nrfx_integration_test/Kconfig index b7dc66e9391..2ce6f1a3145 100644 --- a/tests/drivers/nrfx_integration_test/Kconfig +++ b/tests/drivers/nrfx_integration_test/Kconfig @@ -25,7 +25,6 @@ config NRFX_ALL_DRIVERS select NRFX_GPIOTE130 if HAS_HW_NRF_GPIOTE130 select NRFX_GPIOTE131 if HAS_HW_NRF_GPIOTE131 select NRFX_GPPI - select NRFX_I2S if HAS_HW_NRF_I2S select NRFX_IPC if HAS_HW_NRF_IPC select NRFX_LPCOMP if HAS_HW_NRF_LPCOMP select NRFX_NFCT if HAS_HW_NRF_NFCT From 753fe21bec165f1aea1e6940e4763738f9dc98fe Mon Sep 17 00:00:00 2001 From: Jakub Zymelka Date: Mon, 20 Oct 2025 16:49:26 +0200 Subject: [PATCH 15/72] tests: drivers: nrfx_integration_test: remove deleted PDM configs Removed instance specific PDM config symbols. Signed-off-by: Jakub Zymelka --- tests/drivers/nrfx_integration_test/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/drivers/nrfx_integration_test/Kconfig b/tests/drivers/nrfx_integration_test/Kconfig index 2ce6f1a3145..2b96e484260 100644 --- a/tests/drivers/nrfx_integration_test/Kconfig +++ b/tests/drivers/nrfx_integration_test/Kconfig @@ -32,7 +32,6 @@ config NRFX_ALL_DRIVERS || $(dt_has_compat,$(DT_COMPAT_NORDIC_NRF52_FLASH_CONTROLLER)) \ || $(dt_has_compat,$(DT_COMPAT_NORDIC_NRF53_FLASH_CONTROLLER)) \ || $(dt_has_compat,$(DT_COMPAT_NORDIC_NRF91_FLASH_CONTROLLER)) - select NRFX_PDM if HAS_HW_NRF_PDM select NRFX_POWER if HAS_HW_NRF_POWER select NRFX_PWM0 if HAS_HW_NRF_PWM0 select NRFX_PWM1 if HAS_HW_NRF_PWM1 From 7ca05bbc45b000762c6567655ad991e531396fb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20Laso=C5=84czyk?= Date: Fri, 24 Oct 2025 12:52:37 +0200 Subject: [PATCH 16/72] tests: drivers: nrfx_integration_test: remove deleted QDEC configs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removed instance specific QDEC config symbols. Signed-off-by: Karol Lasończyk --- tests/drivers/nrfx_integration_test/Kconfig | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/drivers/nrfx_integration_test/Kconfig b/tests/drivers/nrfx_integration_test/Kconfig index 2b96e484260..702432f336e 100644 --- a/tests/drivers/nrfx_integration_test/Kconfig +++ b/tests/drivers/nrfx_integration_test/Kconfig @@ -37,12 +37,6 @@ config NRFX_ALL_DRIVERS select NRFX_PWM1 if HAS_HW_NRF_PWM1 select NRFX_PWM2 if HAS_HW_NRF_PWM2 select NRFX_PWM3 if HAS_HW_NRF_PWM3 - select NRFX_QDEC0 if HAS_HW_NRF_QDEC0 - select NRFX_QDEC1 if HAS_HW_NRF_QDEC1 - select NRFX_QDEC20 if HAS_HW_NRF_QDEC20 - select NRFX_QDEC21 if HAS_HW_NRF_QDEC21 - select NRFX_QDEC130 if HAS_HW_NRF_QDEC130 - select NRFX_QDEC131 if HAS_HW_NRF_QDEC131 select NRFX_QSPI if HAS_HW_NRF_QSPI select NRFX_RNG if HAS_HW_NRF_RNG select NRFX_RTC0 if HAS_HW_NRF_RTC0 From 5b8cd8d016ab703b72b0267b100eb9961ea936c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Tue, 30 Sep 2025 13:03:12 +0200 Subject: [PATCH 17/72] tests: drivers: nrfx_integration_test: remove WDT configs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removed instance specific WDT config symbols. Signed-off-by: Michał Stasiak --- tests/drivers/nrfx_integration_test/Kconfig | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/drivers/nrfx_integration_test/Kconfig b/tests/drivers/nrfx_integration_test/Kconfig index 702432f336e..4dad9893770 100644 --- a/tests/drivers/nrfx_integration_test/Kconfig +++ b/tests/drivers/nrfx_integration_test/Kconfig @@ -104,11 +104,6 @@ config NRFX_ALL_DRIVERS select NRFX_UARTE137 if HAS_HW_NRF_UARTE137 select NRFX_USBD if HAS_HW_NRF_USBD select NRFX_USBREG if HAS_HW_NRF_USBREG - select NRFX_WDT0 if HAS_HW_NRF_WDT0 - select NRFX_WDT1 if HAS_HW_NRF_WDT1 - select NRFX_WDT30 if HAS_HW_NRF_WDT30 - select NRFX_WDT31 if HAS_HW_NRF_WDT31 - select NRFX_WDT130 if HAS_HW_NRF_WDT130 select NRFX_PRS_BOX_0 source "Kconfig.zephyr" From 4cc16a30fa5e77752147698f26199efad149e7d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Mon, 20 Oct 2025 14:33:02 +0200 Subject: [PATCH 18/72] applications: remove UARTE instance config symbols MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No longer needed Signed-off-by: Michał Stasiak --- applications/connectivity_bridge/prj.conf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/applications/connectivity_bridge/prj.conf b/applications/connectivity_bridge/prj.conf index c53cf031329..647d2f03e02 100644 --- a/applications/connectivity_bridge/prj.conf +++ b/applications/connectivity_bridge/prj.conf @@ -71,8 +71,7 @@ CONFIG_UART_1_NRF_HW_ASYNC=y CONFIG_UART_0_NRF_HW_ASYNC_TIMER=1 CONFIG_UART_1_NRF_HW_ASYNC_TIMER=2 CONFIG_UART_USE_RUNTIME_CONFIGURE=y -CONFIG_NRFX_UARTE0=y -CONFIG_NRFX_UARTE1=y +CONFIG_NRFX_UARTE=y CONFIG_NRFX_TIMER1=y CONFIG_NRFX_TIMER2=y CONFIG_NRFX_PPI=y From 887d12417b10d150f65ddf2b2d0567bc5dfffc43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Mon, 20 Oct 2025 14:33:36 +0200 Subject: [PATCH 19/72] modules: remove UARTE instance config symbols MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No longer needed Signed-off-by: Michał Stasiak --- modules/trusted-firmware-m/Kconfig | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/trusted-firmware-m/Kconfig b/modules/trusted-firmware-m/Kconfig index 5a419af856b..1b6271d7949 100644 --- a/modules/trusted-firmware-m/Kconfig +++ b/modules/trusted-firmware-m/Kconfig @@ -394,43 +394,43 @@ config TFM_SECURE_UART0 bool "TF-M logging will use UART0 instance" depends on $(dt_nodelabel_has_prop,uart0,pinctrl-names) select NRF_UARTE0_SECURE - select TFM_SECURE_UART_SHARE_INSTANCE if NRFX_UARTE0 || HAS_HW_NRF_UARTE0 + select TFM_SECURE_UART_SHARE_INSTANCE if HAS_HW_NRF_UARTE0 config TFM_SECURE_UART1 bool "TF-M logging will use UART1 instance" depends on $(dt_nodelabel_has_prop,uart1,pinctrl-names) select NRF_UARTE1_SECURE - select TFM_SECURE_UART_SHARE_INSTANCE if NRFX_UARTE1 || HAS_HW_NRF_UARTE1 + select TFM_SECURE_UART_SHARE_INSTANCE if HAS_HW_NRF_UARTE1 config TFM_SECURE_UART00 bool "TF-M logging will use UART00 instance" depends on $(dt_nodelabel_has_prop,uart00,pinctrl-names) select NRF_UARTE00_SECURE - select TFM_SECURE_UART_SHARE_INSTANCE if NRFX_UARTE00 || HAS_HW_NRF_UARTE00 + select TFM_SECURE_UART_SHARE_INSTANCE if HAS_HW_NRF_UARTE00 config TFM_SECURE_UART20 bool "TF-M logging will use UART20 instance" depends on $(dt_nodelabel_has_prop,uart20,pinctrl-names) select NRF_UARTE20_SECURE - select TFM_SECURE_UART_SHARE_INSTANCE if NRFX_UARTE20 || HAS_HW_NRF_UARTE20 + select TFM_SECURE_UART_SHARE_INSTANCE if HAS_HW_NRF_UARTE20 config TFM_SECURE_UART21 bool "TF-M logging will use UART21 instance" depends on $(dt_nodelabel_has_prop,uart21,pinctrl-names) select NRF_UARTE21_SECURE - select TFM_SECURE_UART_SHARE_INSTANCE if NRFX_UARTE21 || HAS_HW_NRF_UARTE21 + select TFM_SECURE_UART_SHARE_INSTANCE if HAS_HW_NRF_UARTE21 config TFM_SECURE_UART22 bool "TF-M logging will use UART22 instance" depends on $(dt_nodelabel_has_prop,uart22,pinctrl-names) select NRF_UARTE22_SECURE - select TFM_SECURE_UART_SHARE_INSTANCE if NRFX_UARTE22 || HAS_HW_NRF_UARTE22 + select TFM_SECURE_UART_SHARE_INSTANCE if HAS_HW_NRF_UARTE22 config TFM_SECURE_UART30 bool "TF-M logging will use UART30 instance" depends on $(dt_nodelabel_has_prop,uart30,pinctrl-names) select NRF_UARTE30_SECURE - select TFM_SECURE_UART_SHARE_INSTANCE if NRFX_UARTE30 || HAS_HW_NRF_UARTE30 + select TFM_SECURE_UART_SHARE_INSTANCE if HAS_HW_NRF_UARTE30 endchoice From a6eae63f6062977f6b1decfd566acb69f6fdf365 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Mon, 20 Oct 2025 14:33:48 +0200 Subject: [PATCH 20/72] samples: remove UARTE instance config symbols MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No longer needed Signed-off-by: Michał Stasiak --- .../central_uart/boards/nrf54h20dk_nrf54h20_cpuapp.conf | 3 --- .../central_uart/boards/nrf54l15dk_nrf54l05_cpuapp.conf | 8 -------- .../central_uart/boards/nrf54l15dk_nrf54l10_cpuapp.conf | 8 -------- .../central_uart/boards/nrf54l15dk_nrf54l15_cpuapp.conf | 8 -------- .../boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf | 8 -------- .../boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf | 8 -------- samples/bluetooth/central_uart/prj.conf | 2 +- .../direct_test_mode/sysbuild/remote_shell/prj.conf | 2 +- .../boards/nrf54h20dk_nrf54h20_cpuapp.conf | 3 --- .../boards/nrf54h20dk_nrf54h20_cpurad.conf | 8 -------- .../boards/nrf54l15dk_nrf54l05_cpuapp.conf | 8 -------- .../boards/nrf54l15dk_nrf54l10_cpuapp.conf | 8 -------- .../boards/nrf54l15dk_nrf54l15_cpuapp.conf | 8 -------- .../boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf | 8 -------- .../boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf | 8 -------- .../peripheral_uart/boards/thingy53_nrf5340_cpuapp.conf | 3 +-- .../boards/thingy53_nrf5340_cpuapp_ns.conf | 3 +-- samples/bluetooth/peripheral_uart/prj.conf | 2 +- samples/bluetooth/peripheral_uart/prj_cdc.conf | 3 +-- samples/bluetooth/peripheral_uart/prj_minimal.conf | 2 +- samples/nrf5340/remote_shell/prj_uart.conf | 2 +- .../openthread/cli/boards/nrf54l15dk_nrf54l10_cpuapp.conf | 3 --- .../openthread/cli/boards/nrf54l15dk_nrf54l15_cpuapp.conf | 3 --- .../cli/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf | 8 -------- .../remote_shell/boards/nrf5340dk_nrf5340_cpuapp.conf | 2 +- .../peripheral/radio_test/sysbuild/remote_shell/prj.conf | 2 +- 26 files changed, 10 insertions(+), 121 deletions(-) delete mode 100644 samples/bluetooth/central_uart/boards/nrf54l15dk_nrf54l05_cpuapp.conf delete mode 100644 samples/bluetooth/central_uart/boards/nrf54l15dk_nrf54l10_cpuapp.conf delete mode 100644 samples/bluetooth/central_uart/boards/nrf54l15dk_nrf54l15_cpuapp.conf delete mode 100644 samples/bluetooth/central_uart/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf delete mode 100644 samples/bluetooth/central_uart/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf delete mode 100644 samples/bluetooth/peripheral_uart/boards/nrf54h20dk_nrf54h20_cpurad.conf delete mode 100644 samples/bluetooth/peripheral_uart/boards/nrf54l15dk_nrf54l05_cpuapp.conf delete mode 100644 samples/bluetooth/peripheral_uart/boards/nrf54l15dk_nrf54l10_cpuapp.conf delete mode 100644 samples/bluetooth/peripheral_uart/boards/nrf54l15dk_nrf54l15_cpuapp.conf delete mode 100644 samples/bluetooth/peripheral_uart/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf delete mode 100644 samples/bluetooth/peripheral_uart/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf delete mode 100644 samples/openthread/cli/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf diff --git a/samples/bluetooth/central_uart/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/samples/bluetooth/central_uart/boards/nrf54h20dk_nrf54h20_cpuapp.conf index f33f5c19a38..34ef10dbc92 100644 --- a/samples/bluetooth/central_uart/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ b/samples/bluetooth/central_uart/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -4,9 +4,6 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -# Disable the unsupported driver -CONFIG_NRFX_UARTE0=n - # Don't get entropy from HCI on nRF54H20 devices CONFIG_BT_HOST_CRYPTO_PRNG=y CONFIG_ENTROPY_BT_HCI=n diff --git a/samples/bluetooth/central_uart/boards/nrf54l15dk_nrf54l05_cpuapp.conf b/samples/bluetooth/central_uart/boards/nrf54l15dk_nrf54l05_cpuapp.conf deleted file mode 100644 index f75b773c2b7..00000000000 --- a/samples/bluetooth/central_uart/boards/nrf54l15dk_nrf54l05_cpuapp.conf +++ /dev/null @@ -1,8 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# Disable the unsupported driver -CONFIG_NRFX_UARTE0=n diff --git a/samples/bluetooth/central_uart/boards/nrf54l15dk_nrf54l10_cpuapp.conf b/samples/bluetooth/central_uart/boards/nrf54l15dk_nrf54l10_cpuapp.conf deleted file mode 100644 index f75b773c2b7..00000000000 --- a/samples/bluetooth/central_uart/boards/nrf54l15dk_nrf54l10_cpuapp.conf +++ /dev/null @@ -1,8 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# Disable the unsupported driver -CONFIG_NRFX_UARTE0=n diff --git a/samples/bluetooth/central_uart/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/samples/bluetooth/central_uart/boards/nrf54l15dk_nrf54l15_cpuapp.conf deleted file mode 100644 index f75b773c2b7..00000000000 --- a/samples/bluetooth/central_uart/boards/nrf54l15dk_nrf54l15_cpuapp.conf +++ /dev/null @@ -1,8 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# Disable the unsupported driver -CONFIG_NRFX_UARTE0=n diff --git a/samples/bluetooth/central_uart/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf b/samples/bluetooth/central_uart/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf deleted file mode 100644 index f5ed71dc154..00000000000 --- a/samples/bluetooth/central_uart/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf +++ /dev/null @@ -1,8 +0,0 @@ -# -# Copyright (c) 2025 Nordic Semiconductor -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# Disable the unspupported UART0 driver -CONFIG_NRFX_UARTE0=n diff --git a/samples/bluetooth/central_uart/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf b/samples/bluetooth/central_uart/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf deleted file mode 100644 index f5ed71dc154..00000000000 --- a/samples/bluetooth/central_uart/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf +++ /dev/null @@ -1,8 +0,0 @@ -# -# Copyright (c) 2025 Nordic Semiconductor -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# Disable the unspupported UART0 driver -CONFIG_NRFX_UARTE0=n diff --git a/samples/bluetooth/central_uart/prj.conf b/samples/bluetooth/central_uart/prj.conf index 5c38e44ff61..64392200036 100644 --- a/samples/bluetooth/central_uart/prj.conf +++ b/samples/bluetooth/central_uart/prj.conf @@ -6,7 +6,7 @@ # Enable the UART driver CONFIG_UART_ASYNC_API=y -CONFIG_NRFX_UARTE0=y +CONFIG_NRFX_UARTE=y CONFIG_SERIAL=y CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y diff --git a/samples/bluetooth/direct_test_mode/sysbuild/remote_shell/prj.conf b/samples/bluetooth/direct_test_mode/sysbuild/remote_shell/prj.conf index 016bdd4d3aa..a64fa066a3a 100644 --- a/samples/bluetooth/direct_test_mode/sysbuild/remote_shell/prj.conf +++ b/samples/bluetooth/direct_test_mode/sysbuild/remote_shell/prj.conf @@ -14,7 +14,7 @@ CONFIG_MBOX=y CONFIG_IPC_SERVICE=y CONFIG_IPC_SERVICE_BACKEND_RPMSG=y -CONFIG_NRFX_UARTE0=y +CONFIG_NRFX_UARTE=y CONFIG_HEAP_MEM_POOL_SIZE=4096 diff --git a/samples/bluetooth/peripheral_uart/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/samples/bluetooth/peripheral_uart/boards/nrf54h20dk_nrf54h20_cpuapp.conf index e0b1b25fda8..34ef10dbc92 100644 --- a/samples/bluetooth/peripheral_uart/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ b/samples/bluetooth/peripheral_uart/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -4,9 +4,6 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -# Disable the unspupported UART0 driver -CONFIG_NRFX_UARTE0=n - # Don't get entropy from HCI on nRF54H20 devices CONFIG_BT_HOST_CRYPTO_PRNG=y CONFIG_ENTROPY_BT_HCI=n diff --git a/samples/bluetooth/peripheral_uart/boards/nrf54h20dk_nrf54h20_cpurad.conf b/samples/bluetooth/peripheral_uart/boards/nrf54h20dk_nrf54h20_cpurad.conf deleted file mode 100644 index 0623953b424..00000000000 --- a/samples/bluetooth/peripheral_uart/boards/nrf54h20dk_nrf54h20_cpurad.conf +++ /dev/null @@ -1,8 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# Disable the unspupported UART0 driver -CONFIG_NRFX_UARTE0=n diff --git a/samples/bluetooth/peripheral_uart/boards/nrf54l15dk_nrf54l05_cpuapp.conf b/samples/bluetooth/peripheral_uart/boards/nrf54l15dk_nrf54l05_cpuapp.conf deleted file mode 100644 index 0623953b424..00000000000 --- a/samples/bluetooth/peripheral_uart/boards/nrf54l15dk_nrf54l05_cpuapp.conf +++ /dev/null @@ -1,8 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# Disable the unspupported UART0 driver -CONFIG_NRFX_UARTE0=n diff --git a/samples/bluetooth/peripheral_uart/boards/nrf54l15dk_nrf54l10_cpuapp.conf b/samples/bluetooth/peripheral_uart/boards/nrf54l15dk_nrf54l10_cpuapp.conf deleted file mode 100644 index 0623953b424..00000000000 --- a/samples/bluetooth/peripheral_uart/boards/nrf54l15dk_nrf54l10_cpuapp.conf +++ /dev/null @@ -1,8 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# Disable the unspupported UART0 driver -CONFIG_NRFX_UARTE0=n diff --git a/samples/bluetooth/peripheral_uart/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/samples/bluetooth/peripheral_uart/boards/nrf54l15dk_nrf54l15_cpuapp.conf deleted file mode 100644 index 0623953b424..00000000000 --- a/samples/bluetooth/peripheral_uart/boards/nrf54l15dk_nrf54l15_cpuapp.conf +++ /dev/null @@ -1,8 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# Disable the unspupported UART0 driver -CONFIG_NRFX_UARTE0=n diff --git a/samples/bluetooth/peripheral_uart/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf b/samples/bluetooth/peripheral_uart/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf deleted file mode 100644 index f5ed71dc154..00000000000 --- a/samples/bluetooth/peripheral_uart/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf +++ /dev/null @@ -1,8 +0,0 @@ -# -# Copyright (c) 2025 Nordic Semiconductor -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# Disable the unspupported UART0 driver -CONFIG_NRFX_UARTE0=n diff --git a/samples/bluetooth/peripheral_uart/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf b/samples/bluetooth/peripheral_uart/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf deleted file mode 100644 index f5ed71dc154..00000000000 --- a/samples/bluetooth/peripheral_uart/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf +++ /dev/null @@ -1,8 +0,0 @@ -# -# Copyright (c) 2025 Nordic Semiconductor -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# Disable the unspupported UART0 driver -CONFIG_NRFX_UARTE0=n diff --git a/samples/bluetooth/peripheral_uart/boards/thingy53_nrf5340_cpuapp.conf b/samples/bluetooth/peripheral_uart/boards/thingy53_nrf5340_cpuapp.conf index 4a243f5d691..d922b6309b1 100644 --- a/samples/bluetooth/peripheral_uart/boards/thingy53_nrf5340_cpuapp.conf +++ b/samples/bluetooth/peripheral_uart/boards/thingy53_nrf5340_cpuapp.conf @@ -23,6 +23,5 @@ CONFIG_LOG_BACKEND_UART=y CONFIG_UART_ASYNC_ADAPTER=y CONFIG_UART_INTERRUPT_DRIVEN=y -# Disable the UARTE0 enabled in default project configuration -CONFIG_NRFX_UARTE0=n +# Disable the UARTE enabled in default project configuration CONFIG_UART_NRFX=n diff --git a/samples/bluetooth/peripheral_uart/boards/thingy53_nrf5340_cpuapp_ns.conf b/samples/bluetooth/peripheral_uart/boards/thingy53_nrf5340_cpuapp_ns.conf index 4a243f5d691..d922b6309b1 100644 --- a/samples/bluetooth/peripheral_uart/boards/thingy53_nrf5340_cpuapp_ns.conf +++ b/samples/bluetooth/peripheral_uart/boards/thingy53_nrf5340_cpuapp_ns.conf @@ -23,6 +23,5 @@ CONFIG_LOG_BACKEND_UART=y CONFIG_UART_ASYNC_ADAPTER=y CONFIG_UART_INTERRUPT_DRIVEN=y -# Disable the UARTE0 enabled in default project configuration -CONFIG_NRFX_UARTE0=n +# Disable the UARTE enabled in default project configuration CONFIG_UART_NRFX=n diff --git a/samples/bluetooth/peripheral_uart/prj.conf b/samples/bluetooth/peripheral_uart/prj.conf index 8fc51eaae3b..7b3e3086ae7 100644 --- a/samples/bluetooth/peripheral_uart/prj.conf +++ b/samples/bluetooth/peripheral_uart/prj.conf @@ -6,7 +6,7 @@ # Enable the UART driver CONFIG_UART_ASYNC_API=y -CONFIG_NRFX_UARTE0=y +CONFIG_NRFX_UARTE=y CONFIG_SERIAL=y CONFIG_GPIO=y diff --git a/samples/bluetooth/peripheral_uart/prj_cdc.conf b/samples/bluetooth/peripheral_uart/prj_cdc.conf index 3a02a3fc5ba..1b47a85dce6 100644 --- a/samples/bluetooth/peripheral_uart/prj_cdc.conf +++ b/samples/bluetooth/peripheral_uart/prj_cdc.conf @@ -13,6 +13,5 @@ CONFIG_USB_DEVICE_STACK_NEXT=y CONFIG_CDC_ACM_SERIAL_INITIALIZE_AT_BOOT=y CONFIG_USBD_CDC_ACM_LOG_LEVEL_OFF=y -# Disable the UARTE0 enabled in default project configuration -CONFIG_NRFX_UARTE0=n +# Disable the UARTE enabled in default project configuration CONFIG_UART_NRFX=n diff --git a/samples/bluetooth/peripheral_uart/prj_minimal.conf b/samples/bluetooth/peripheral_uart/prj_minimal.conf index 56cea63ed63..553111922b5 100644 --- a/samples/bluetooth/peripheral_uart/prj_minimal.conf +++ b/samples/bluetooth/peripheral_uart/prj_minimal.conf @@ -6,7 +6,7 @@ # Enable the UART driver CONFIG_UART_ASYNC_API=y -CONFIG_NRFX_UARTE0=y +CONFIG_NRFX_UARTE=y CONFIG_SERIAL=y CONFIG_HEAP_MEM_POOL_SIZE=1536 diff --git a/samples/nrf5340/remote_shell/prj_uart.conf b/samples/nrf5340/remote_shell/prj_uart.conf index 0b2e39d1777..aaa3684d91a 100644 --- a/samples/nrf5340/remote_shell/prj_uart.conf +++ b/samples/nrf5340/remote_shell/prj_uart.conf @@ -16,7 +16,7 @@ CONFIG_IPC_SERVICE_BACKEND_RPMSG=y CONFIG_MBOX=y CONFIG_MBOX_NRFX_IPC=y -CONFIG_NRFX_UARTE0=y +CONFIG_NRFX_UARTE=y CONFIG_HEAP_MEM_POOL_SIZE=4096 diff --git a/samples/openthread/cli/boards/nrf54l15dk_nrf54l10_cpuapp.conf b/samples/openthread/cli/boards/nrf54l15dk_nrf54l10_cpuapp.conf index b64e3785e2d..e43841f88e6 100644 --- a/samples/openthread/cli/boards/nrf54l15dk_nrf54l10_cpuapp.conf +++ b/samples/openthread/cli/boards/nrf54l15dk_nrf54l10_cpuapp.conf @@ -4,9 +4,6 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -# Disable the unsupported driver -CONFIG_NRFX_UARTE0=n - # Increase Main and shell stack sizes to avoid stack overflow # while using CRACEN CONFIG_MAIN_STACK_SIZE=6144 diff --git a/samples/openthread/cli/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/samples/openthread/cli/boards/nrf54l15dk_nrf54l15_cpuapp.conf index b64e3785e2d..e43841f88e6 100644 --- a/samples/openthread/cli/boards/nrf54l15dk_nrf54l15_cpuapp.conf +++ b/samples/openthread/cli/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -4,9 +4,6 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -# Disable the unsupported driver -CONFIG_NRFX_UARTE0=n - # Increase Main and shell stack sizes to avoid stack overflow # while using CRACEN CONFIG_MAIN_STACK_SIZE=6144 diff --git a/samples/openthread/cli/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf b/samples/openthread/cli/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf deleted file mode 100644 index f75b773c2b7..00000000000 --- a/samples/openthread/cli/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf +++ /dev/null @@ -1,8 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# Disable the unsupported driver -CONFIG_NRFX_UARTE0=n diff --git a/samples/peripheral/802154_phy_test/sysbuild/remote_shell/boards/nrf5340dk_nrf5340_cpuapp.conf b/samples/peripheral/802154_phy_test/sysbuild/remote_shell/boards/nrf5340dk_nrf5340_cpuapp.conf index 1ee1cd1b541..efb9b6b32ba 100644 --- a/samples/peripheral/802154_phy_test/sysbuild/remote_shell/boards/nrf5340dk_nrf5340_cpuapp.conf +++ b/samples/peripheral/802154_phy_test/sysbuild/remote_shell/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -5,4 +5,4 @@ # CONFIG_SOC_NRF53_CPUNET_ENABLE=y -CONFIG_NRFX_UARTE0=y +CONFIG_NRFX_UARTE=y diff --git a/samples/peripheral/radio_test/sysbuild/remote_shell/prj.conf b/samples/peripheral/radio_test/sysbuild/remote_shell/prj.conf index b3ed0a176d7..b7f49de08b9 100644 --- a/samples/peripheral/radio_test/sysbuild/remote_shell/prj.conf +++ b/samples/peripheral/radio_test/sysbuild/remote_shell/prj.conf @@ -14,7 +14,7 @@ CONFIG_MBOX=y CONFIG_IPC_SERVICE=y CONFIG_IPC_SERVICE_BACKEND_RPMSG=y -CONFIG_NRFX_UARTE0=y +CONFIG_NRFX_UARTE=y CONFIG_HEAP_MEM_POOL_SIZE=4096 From 984f89b0a133acdaed5bcadb47b3cfc95ad5862d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Mon, 20 Oct 2025 14:34:06 +0200 Subject: [PATCH 21/72] tests: remove UARTE instance config symbols MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No longer needed Signed-off-by: Michał Stasiak --- tests/drivers/nrfx_integration_test/Kconfig | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/tests/drivers/nrfx_integration_test/Kconfig b/tests/drivers/nrfx_integration_test/Kconfig index 4dad9893770..06b351b9491 100644 --- a/tests/drivers/nrfx_integration_test/Kconfig +++ b/tests/drivers/nrfx_integration_test/Kconfig @@ -84,24 +84,6 @@ config NRFX_ALL_DRIVERS select NRFX_TWIS2 if HAS_HW_NRF_TWIS2 select NRFX_TWIS3 if HAS_HW_NRF_TWIS3 select NRFX_UART0 if HAS_HW_NRF_UART0 - select NRFX_UARTE0 if HAS_HW_NRF_UARTE0 - select NRFX_UARTE1 if HAS_HW_NRF_UARTE1 - select NRFX_UARTE2 if HAS_HW_NRF_UARTE2 - select NRFX_UARTE3 if HAS_HW_NRF_UARTE3 - select NRFX_UARTE00 if HAS_HW_NRF_UARTE00 - select NRFX_UARTE20 if HAS_HW_NRF_UARTE20 - select NRFX_UARTE21 if HAS_HW_NRF_UARTE21 - select NRFX_UARTE22 if HAS_HW_NRF_UARTE22 - select NRFX_UARTE30 if HAS_HW_NRF_UARTE30 - select NRFX_UARTE120 if HAS_HW_NRF_UARTE120 - select NRFX_UARTE130 if HAS_HW_NRF_UARTE130 - select NRFX_UARTE131 if HAS_HW_NRF_UARTE131 - select NRFX_UARTE132 if HAS_HW_NRF_UARTE132 - select NRFX_UARTE133 if HAS_HW_NRF_UARTE133 - select NRFX_UARTE134 if HAS_HW_NRF_UARTE134 - select NRFX_UARTE135 if HAS_HW_NRF_UARTE135 - select NRFX_UARTE136 if HAS_HW_NRF_UARTE136 - select NRFX_UARTE137 if HAS_HW_NRF_UARTE137 select NRFX_USBD if HAS_HW_NRF_USBD select NRFX_USBREG if HAS_HW_NRF_USBREG select NRFX_PRS_BOX_0 From 62d950c75187bf1dc2e4b9a17b6a441bfb12b32a Mon Sep 17 00:00:00 2001 From: Marcin Szymczyk Date: Wed, 29 Oct 2025 20:58:23 +0100 Subject: [PATCH 22/72] boards: align to relocation of nrfx_coredep It is in lib, not in soc. Signed-off-by: Marcin Szymczyk --- soc/nordic/nrf71/soc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soc/nordic/nrf71/soc.c b/soc/nordic/nrf71/soc.c index 309888a77d1..6d592d8acb4 100644 --- a/soc/nordic/nrf71/soc.c +++ b/soc/nordic/nrf71/soc.c @@ -31,7 +31,7 @@ #endif #include -#include +#include #include #include From 243b01c0ac0f7cef4d3a7761582d0f1e420ba804 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bainczyk?= Date: Wed, 1 Oct 2025 13:24:03 +0200 Subject: [PATCH 23/72] tests: drivers: nrfx_integration_test: remove PWM configs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove PWM configs due to pwm_nrfx rework. Signed-off-by: Michał Bainczyk --- tests/drivers/nrfx_integration_test/Kconfig | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/drivers/nrfx_integration_test/Kconfig b/tests/drivers/nrfx_integration_test/Kconfig index 06b351b9491..5666960f05d 100644 --- a/tests/drivers/nrfx_integration_test/Kconfig +++ b/tests/drivers/nrfx_integration_test/Kconfig @@ -33,10 +33,6 @@ config NRFX_ALL_DRIVERS || $(dt_has_compat,$(DT_COMPAT_NORDIC_NRF53_FLASH_CONTROLLER)) \ || $(dt_has_compat,$(DT_COMPAT_NORDIC_NRF91_FLASH_CONTROLLER)) select NRFX_POWER if HAS_HW_NRF_POWER - select NRFX_PWM0 if HAS_HW_NRF_PWM0 - select NRFX_PWM1 if HAS_HW_NRF_PWM1 - select NRFX_PWM2 if HAS_HW_NRF_PWM2 - select NRFX_PWM3 if HAS_HW_NRF_PWM3 select NRFX_QSPI if HAS_HW_NRF_QSPI select NRFX_RNG if HAS_HW_NRF_RNG select NRFX_RTC0 if HAS_HW_NRF_RTC0 From 7d8a4e78cf9bf23281e23e5633dbd526054798ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bainczyk?= Date: Mon, 6 Oct 2025 08:56:12 +0200 Subject: [PATCH 24/72] applications: Align to changes in nrfx_timer driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Align connectivity_bridge, nrf5340_audio and serial_lte_modem to changes in nrfx_timer driver. Signed-off-by: Michał Bainczyk --- applications/connectivity_bridge/prj.conf | 3 +-- applications/nrf5340_audio/src/audio/Kconfig.defaults | 2 +- applications/nrf5340_audio/src/modules/audio_sync_timer.c | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/applications/connectivity_bridge/prj.conf b/applications/connectivity_bridge/prj.conf index 647d2f03e02..f60c50be99c 100644 --- a/applications/connectivity_bridge/prj.conf +++ b/applications/connectivity_bridge/prj.conf @@ -72,8 +72,7 @@ CONFIG_UART_0_NRF_HW_ASYNC_TIMER=1 CONFIG_UART_1_NRF_HW_ASYNC_TIMER=2 CONFIG_UART_USE_RUNTIME_CONFIGURE=y CONFIG_NRFX_UARTE=y -CONFIG_NRFX_TIMER1=y -CONFIG_NRFX_TIMER2=y +CONFIG_NRFX_TIMER=y CONFIG_NRFX_PPI=y CONFIG_HW_ID_LIBRARY=y diff --git a/applications/nrf5340_audio/src/audio/Kconfig.defaults b/applications/nrf5340_audio/src/audio/Kconfig.defaults index 809aad94e4d..c89b8d23622 100644 --- a/applications/nrf5340_audio/src/audio/Kconfig.defaults +++ b/applications/nrf5340_audio/src/audio/Kconfig.defaults @@ -5,7 +5,7 @@ # # Audio sync timer -config NRFX_TIMER1 +config NRFX_TIMER default y # Audio sync timer diff --git a/applications/nrf5340_audio/src/modules/audio_sync_timer.c b/applications/nrf5340_audio/src/modules/audio_sync_timer.c index 840b729410f..56f5663a03f 100644 --- a/applications/nrf5340_audio/src/modules/audio_sync_timer.c +++ b/applications/nrf5340_audio/src/modules/audio_sync_timer.c @@ -28,8 +28,8 @@ LOG_MODULE_REGISTER(audio_sync_timer, CONFIG_AUDIO_SYNC_TIMER_LOG_LEVEL); #define AUDIO_SYNC_HF_TIMER_CURR_TIME_CAPTURE_CHANNEL 1 #define AUDIO_SYNC_HF_TIMER_CURR_TIME_CAPTURE NRF_TIMER_TASK_CAPTURE1 -static const nrfx_timer_t audio_sync_hf_timer_instance = - NRFX_TIMER_INSTANCE(AUDIO_SYNC_HF_TIMER_INSTANCE_NUMBER); +static nrfx_timer_t audio_sync_hf_timer_instance = + NRFX_TIMER_INSTANCE(NRF_TIMER_INST_GET(AUDIO_SYNC_HF_TIMER_INSTANCE_NUMBER)); static uint8_t dppi_channel_i2s_frame_start; From fc45e086abe6af1a3050ea2f507c2a8dea6d38f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bainczyk?= Date: Mon, 6 Oct 2025 10:23:16 +0200 Subject: [PATCH 25/72] samples: Align to changes in nrfx_timer driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Align bluetooth, peripheral and wifi samples to changes in nrfx_timer driver. Signed-off-by: Michał Bainczyk --- .../boards/nrf52833dk_nrf52833.conf | 2 +- .../boards/nrf52840dk_nrf52840.conf | 2 +- .../nrf5340_audio_dk_nrf5340_cpuapp.conf | 2 +- .../boards/nrf5340dk_nrf5340_cpuapp.conf | 2 +- .../src/controller_time_nrf52.c | 2 +- .../src/controller_time_nrf53_app.c | 2 +- .../boards/nrf54h20dk_nrf54h20_cpurad.conf | 6 +--- .../boards/nrf54l15dk_nrf54l05_cpuapp.conf | 6 +--- .../boards/nrf54l15dk_nrf54l10_cpuapp.conf | 6 +--- .../boards/nrf54l15dk_nrf54l15_cpuapp.conf | 6 +--- .../boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf | 6 +--- .../boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf | 6 +--- samples/bluetooth/direct_test_mode/prj.conf | 3 +- .../bluetooth/direct_test_mode/prj_hci.conf | 3 +- .../direct_test_mode/prj_usb_5340.conf | 3 +- .../direct_test_mode/prj_usb_54h20.conf | 6 +--- .../direct_test_mode/socs/nrf52840.conf | 2 +- samples/bluetooth/direct_test_mode/src/dtm.c | 30 +++++-------------- .../boards/nrf52833dk_nrf52833.conf | 2 +- .../boards/nrf52840dk_nrf52840.conf | 2 +- .../nrf5340_audio_dk_nrf5340_cpuapp.conf | 2 +- .../boards/nrf5340dk_nrf5340_cpuapp.conf | 2 +- .../iso_time_sync/src/controller_time_nrf52.c | 2 +- .../src/controller_time_nrf53_app.c | 2 +- .../boards/nrf21540dk_nrf52840.conf | 2 +- .../boards/nrf52833dk_nrf52833.conf | 2 +- .../boards/nrf52840dk_nrf52840.conf | 2 +- .../boards/nrf5340dk_nrf5340_cpunet.conf | 2 +- .../boards/nrf54l15dk_nrf54l15_cpuapp.conf | 2 +- .../boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf | 2 +- .../802154_phy_test/src/periph_proc.c | 2 +- .../lpuart/boards/nrf21540dk_nrf52840.conf | 2 +- .../lpuart/boards/nrf52833dk_nrf52833.conf | 2 +- .../lpuart/boards/nrf52840dk_nrf52840.conf | 2 +- .../lpuart/boards/nrf52dk_nrf52832.conf | 2 +- .../boards/nrf5340dk_nrf5340_cpuapp.conf | 2 +- .../lpuart/boards/nrf9160dk_nrf9160_ns.conf | 2 +- .../boards/nrf54h20dk_nrf54h20_cpurad.conf | 5 +--- .../boards/nrf54l15dk_nrf54l05_cpuapp.conf | 5 +--- .../boards/nrf54l15dk_nrf54l10_cpuapp.conf | 5 +--- .../boards/nrf54l15dk_nrf54l15_cpuapp.conf | 5 +--- .../boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf | 5 +--- .../boards/nrf54ls05dk_nrf54ls05b_cpuapp.conf | 5 +--- .../boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf | 5 +--- samples/peripheral/radio_test/prj.conf | 2 +- samples/peripheral/radio_test/prj_usb.conf | 2 +- .../peripheral/radio_test/src/radio_test.c | 9 ++---- .../boards/nrf54l15dk_nrf54l15_cpuapp.conf | 5 +--- .../wifi/radio_test/single_domain/prj.conf | 2 +- .../wifi/radio_test/single_domain/sample.yaml | 2 +- 50 files changed, 58 insertions(+), 132 deletions(-) diff --git a/samples/bluetooth/conn_time_sync/boards/nrf52833dk_nrf52833.conf b/samples/bluetooth/conn_time_sync/boards/nrf52833dk_nrf52833.conf index 7487f343e31..ec772c7e06d 100644 --- a/samples/bluetooth/conn_time_sync/boards/nrf52833dk_nrf52833.conf +++ b/samples/bluetooth/conn_time_sync/boards/nrf52833dk_nrf52833.conf @@ -4,6 +4,6 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -CONFIG_NRFX_TIMER1=y +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 7487f343e31..ec772c7e06d 100644 --- a/samples/bluetooth/conn_time_sync/boards/nrf52840dk_nrf52840.conf +++ b/samples/bluetooth/conn_time_sync/boards/nrf52840dk_nrf52840.conf @@ -4,6 +4,6 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -CONFIG_NRFX_TIMER1=y +CONFIG_NRFX_TIMER=y CONFIG_NRFX_RTC2=y CONFIG_NRFX_PPI=y diff --git a/samples/bluetooth/conn_time_sync/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf b/samples/bluetooth/conn_time_sync/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf index 6ff372a50e0..2b01820c8e1 100644 --- a/samples/bluetooth/conn_time_sync/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf +++ b/samples/bluetooth/conn_time_sync/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf @@ -4,6 +4,6 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -CONFIG_NRFX_TIMER0=y +CONFIG_NRFX_TIMER=y CONFIG_NRFX_RTC0=y CONFIG_NRFX_GPPI=y diff --git a/samples/bluetooth/conn_time_sync/boards/nrf5340dk_nrf5340_cpuapp.conf b/samples/bluetooth/conn_time_sync/boards/nrf5340dk_nrf5340_cpuapp.conf index 6ff372a50e0..2b01820c8e1 100644 --- a/samples/bluetooth/conn_time_sync/boards/nrf5340dk_nrf5340_cpuapp.conf +++ b/samples/bluetooth/conn_time_sync/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -4,6 +4,6 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -CONFIG_NRFX_TIMER0=y +CONFIG_NRFX_TIMER=y CONFIG_NRFX_RTC0=y CONFIG_NRFX_GPPI=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 3777f060ac3..c853d36bb21 100644 --- a/samples/bluetooth/conn_time_sync/src/controller_time_nrf52.c +++ b/samples/bluetooth/conn_time_sync/src/controller_time_nrf52.c @@ -22,7 +22,7 @@ #include "conn_time_sync.h" static const nrfx_rtc_t app_rtc_instance = NRFX_RTC_INSTANCE(2); -static const nrfx_timer_t app_timer_instance = NRFX_TIMER_INSTANCE(1); +static nrfx_timer_t app_timer_instance = NRFX_TIMER_INSTANCE(NRF_TIMER1); static uint8_t ppi_chan_on_rtc_match; static volatile uint32_t num_rtc_overflows; 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 c8670fb7edb..145d5d7e217 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 @@ -23,7 +23,7 @@ #include "conn_time_sync.h" static const nrfx_rtc_t app_rtc_instance = NRFX_RTC_INSTANCE(0); -static const nrfx_timer_t app_timer_instance = NRFX_TIMER_INSTANCE(0); +static nrfx_timer_t app_timer_instance = NRFX_TIMER_INSTANCE(NRF_TIMER0); static uint8_t ppi_chan_on_rtc_match; static volatile uint32_t num_rtc_overflows; diff --git a/samples/bluetooth/direct_test_mode/boards/nrf54h20dk_nrf54h20_cpurad.conf b/samples/bluetooth/direct_test_mode/boards/nrf54h20dk_nrf54h20_cpurad.conf index bb6c166bfa7..37eb7ad983f 100644 --- a/samples/bluetooth/direct_test_mode/boards/nrf54h20dk_nrf54h20_cpurad.conf +++ b/samples/bluetooth/direct_test_mode/boards/nrf54h20dk_nrf54h20_cpurad.conf @@ -4,12 +4,8 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -# Disable the unsupported driver -CONFIG_NRFX_TIMER0=n -CONFIG_NRFX_TIMER2=n - # Use necessary peripherals -CONFIG_NRFX_TIMER020=y +CONFIG_NRFX_TIMER=y CONFIG_MAIN_STACK_SIZE=2048 CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 diff --git a/samples/bluetooth/direct_test_mode/boards/nrf54l15dk_nrf54l05_cpuapp.conf b/samples/bluetooth/direct_test_mode/boards/nrf54l15dk_nrf54l05_cpuapp.conf index b84b86adca2..2ed8ce18c12 100644 --- a/samples/bluetooth/direct_test_mode/boards/nrf54l15dk_nrf54l05_cpuapp.conf +++ b/samples/bluetooth/direct_test_mode/boards/nrf54l15dk_nrf54l05_cpuapp.conf @@ -4,9 +4,5 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -# Disable the unsupported driver -CONFIG_NRFX_TIMER0=n -CONFIG_NRFX_TIMER2=n - # Use necessary peripherals -CONFIG_NRFX_TIMER10=y +CONFIG_NRFX_TIMER=y diff --git a/samples/bluetooth/direct_test_mode/boards/nrf54l15dk_nrf54l10_cpuapp.conf b/samples/bluetooth/direct_test_mode/boards/nrf54l15dk_nrf54l10_cpuapp.conf index b84b86adca2..2ed8ce18c12 100644 --- a/samples/bluetooth/direct_test_mode/boards/nrf54l15dk_nrf54l10_cpuapp.conf +++ b/samples/bluetooth/direct_test_mode/boards/nrf54l15dk_nrf54l10_cpuapp.conf @@ -4,9 +4,5 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -# Disable the unsupported driver -CONFIG_NRFX_TIMER0=n -CONFIG_NRFX_TIMER2=n - # Use necessary peripherals -CONFIG_NRFX_TIMER10=y +CONFIG_NRFX_TIMER=y diff --git a/samples/bluetooth/direct_test_mode/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/samples/bluetooth/direct_test_mode/boards/nrf54l15dk_nrf54l15_cpuapp.conf index b84b86adca2..2ed8ce18c12 100644 --- a/samples/bluetooth/direct_test_mode/boards/nrf54l15dk_nrf54l15_cpuapp.conf +++ b/samples/bluetooth/direct_test_mode/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -4,9 +4,5 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -# Disable the unsupported driver -CONFIG_NRFX_TIMER0=n -CONFIG_NRFX_TIMER2=n - # Use necessary peripherals -CONFIG_NRFX_TIMER10=y +CONFIG_NRFX_TIMER=y diff --git a/samples/bluetooth/direct_test_mode/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf b/samples/bluetooth/direct_test_mode/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf index 5fd3a86602c..435d40c9bf6 100644 --- a/samples/bluetooth/direct_test_mode/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf +++ b/samples/bluetooth/direct_test_mode/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf @@ -4,9 +4,5 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -# Disable the unsupported driver -CONFIG_NRFX_TIMER0=n -CONFIG_NRFX_TIMER2=n - # Use necessary peripherals -CONFIG_NRFX_TIMER10=y +CONFIG_NRFX_TIMER=y diff --git a/samples/bluetooth/direct_test_mode/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf b/samples/bluetooth/direct_test_mode/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf index 5fd3a86602c..435d40c9bf6 100644 --- a/samples/bluetooth/direct_test_mode/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf +++ b/samples/bluetooth/direct_test_mode/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf @@ -4,9 +4,5 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -# Disable the unsupported driver -CONFIG_NRFX_TIMER0=n -CONFIG_NRFX_TIMER2=n - # Use necessary peripherals -CONFIG_NRFX_TIMER10=y +CONFIG_NRFX_TIMER=y diff --git a/samples/bluetooth/direct_test_mode/prj.conf b/samples/bluetooth/direct_test_mode/prj.conf index b3760fccb43..53d90a4e90a 100644 --- a/samples/bluetooth/direct_test_mode/prj.conf +++ b/samples/bluetooth/direct_test_mode/prj.conf @@ -20,8 +20,7 @@ CONFIG_USE_SEGGER_RTT=y CONFIG_LOG_BACKEND_RTT=y # Use necessary peripherals -CONFIG_NRFX_TIMER0=y -CONFIG_NRFX_TIMER2=y +CONFIG_NRFX_TIMER=y CONFIG_NRFX_GPPI=y CONFIG_CLOCK_CONTROL=y diff --git a/samples/bluetooth/direct_test_mode/prj_hci.conf b/samples/bluetooth/direct_test_mode/prj_hci.conf index 4e380a1ad8b..1bc634d9443 100644 --- a/samples/bluetooth/direct_test_mode/prj_hci.conf +++ b/samples/bluetooth/direct_test_mode/prj_hci.conf @@ -20,8 +20,7 @@ CONFIG_USE_SEGGER_RTT=y CONFIG_LOG_BACKEND_RTT=y # Use necessary peripherals -CONFIG_NRFX_TIMER0=y -CONFIG_NRFX_TIMER2=y +CONFIG_NRFX_TIMER=y CONFIG_NRFX_GPPI=y CONFIG_CLOCK_CONTROL=y diff --git a/samples/bluetooth/direct_test_mode/prj_usb_5340.conf b/samples/bluetooth/direct_test_mode/prj_usb_5340.conf index 2a5a9610ab1..e434cb9a309 100644 --- a/samples/bluetooth/direct_test_mode/prj_usb_5340.conf +++ b/samples/bluetooth/direct_test_mode/prj_usb_5340.conf @@ -20,8 +20,7 @@ CONFIG_USE_SEGGER_RTT=y CONFIG_LOG_BACKEND_RTT=y # Use necessary peripherals -CONFIG_NRFX_TIMER0=y -CONFIG_NRFX_TIMER2=y +CONFIG_NRFX_TIMER=y CONFIG_NRFX_GPPI=y CONFIG_CLOCK_CONTROL=y diff --git a/samples/bluetooth/direct_test_mode/prj_usb_54h20.conf b/samples/bluetooth/direct_test_mode/prj_usb_54h20.conf index 244cefcb1da..df30f78ab4a 100644 --- a/samples/bluetooth/direct_test_mode/prj_usb_54h20.conf +++ b/samples/bluetooth/direct_test_mode/prj_usb_54h20.conf @@ -28,11 +28,7 @@ CONFIG_UART_LINE_CTRL=y CONFIG_DTM_USB=y CONFIG_SERIAL=y -# Disable the unsupported driver -CONFIG_NRFX_TIMER0=n -CONFIG_NRFX_TIMER2=n - # Use necessary peripherals -CONFIG_NRFX_TIMER020=y +CONFIG_NRFX_TIMER=y CONFIG_NRFX_GPPI=y CONFIG_CLOCK_CONTROL=y diff --git a/samples/bluetooth/direct_test_mode/socs/nrf52840.conf b/samples/bluetooth/direct_test_mode/socs/nrf52840.conf index 6917a91860d..05bb47d563f 100644 --- a/samples/bluetooth/direct_test_mode/socs/nrf52840.conf +++ b/samples/bluetooth/direct_test_mode/socs/nrf52840.conf @@ -5,4 +5,4 @@ # # Use an additional timer for Anomaly 172 -CONFIG_NRFX_TIMER3=y +CONFIG_NRFX_TIMER=y diff --git a/samples/bluetooth/direct_test_mode/src/dtm.c b/samples/bluetooth/direct_test_mode/src/dtm.c index 79ce90ce6bc..056f048bf2b 100644 --- a/samples/bluetooth/direct_test_mode/src/dtm.c +++ b/samples/bluetooth/direct_test_mode/src/dtm.c @@ -69,9 +69,6 @@ #define DEFAULT_TIMER_IRQ NRFX_CONCAT_3(TIMER, \ DEFAULT_TIMER_INSTANCE, \ _IRQn) -#define DEFAULT_TIMER_IRQ_HANDLER NRFX_CONCAT_3(nrfx_timer_, \ - DEFAULT_TIMER_INSTANCE, \ - _irq_handler) /* Note that the timer instance 1 can be used in the communication module. */ @@ -83,19 +80,6 @@ #define ANOMALY_172_TIMER_IRQ NRFX_CONCAT_3(TIMER, \ ANOMALY_172_TIMER_INSTANCE, \ _IRQn) -#define ANOMALY_172_TIMER_IRQ_HANDLER NRFX_CONCAT_3(nrfx_timer_, \ - ANOMALY_172_TIMER_INSTANCE, \ - _irq_handler) -#endif /* NRF52_ERRATA_172_PRESENT */ - -/* Helper macro for labeling timer instances. */ -#define NRFX_TIMER_CONFIG_LABEL(_num) NRFX_CONCAT_3(CONFIG_, NRFX_TIMER, _num) - -BUILD_ASSERT(NRFX_TIMER_CONFIG_LABEL(DEFAULT_TIMER_INSTANCE) == 1, - "Core DTM timer needs additional KConfig configuration"); -#if NRF52_ERRATA_172_PRESENT -BUILD_ASSERT(NRFX_TIMER_CONFIG_LABEL(ANOMALY_172_TIMER_INSTANCE) == 1, - "Anomaly DTM timer needs additional KConfig configuration"); #endif /* NRF52_ERRATA_172_PRESENT */ #define DTM_EGU_EVENT NRF_EGU_EVENT_TRIGGERED0 @@ -399,11 +383,11 @@ static struct dtm_instance { uint32_t address; /* Timer to be used for scheduling TX packets. */ - const nrfx_timer_t timer; + nrfx_timer_t timer; #if NRF52_ERRATA_172_PRESENT /* Timer to be used to handle Anomaly 172. */ - const nrfx_timer_t anomaly_timer; + nrfx_timer_t anomaly_timer; /* Enable or disable the workaround for Errata 172. */ bool anomaly_172_wa_enabled; @@ -435,9 +419,9 @@ static struct dtm_instance { .state = STATE_UNINITIALIZED, .packet_hdr_plen = NRF_RADIO_PREAMBLE_LENGTH_8BIT, .address = DTM_RADIO_ADDRESS, - .timer = NRFX_TIMER_INSTANCE(DEFAULT_TIMER_INSTANCE), + .timer = NRFX_TIMER_INSTANCE(NRF_TIMER_INST_GET(DEFAULT_TIMER_INSTANCE)), #if NRF52_ERRATA_172_PRESENT - .anomaly_timer = NRFX_TIMER_INSTANCE(ANOMALY_172_TIMER_INSTANCE), + .anomaly_timer = NRFX_TIMER_INSTANCE(NRF_TIMER_INST_GET(ANOMALY_172_TIMER_INSTANCE)), #endif /* NRF52_ERRATA_172_PRESENT */ .radio_mode = NRF_RADIO_MODE_BLE_1MBIT, .txpower = 0, @@ -825,7 +809,7 @@ static int timer_init(void) } IRQ_CONNECT(DEFAULT_TIMER_IRQ, CONFIG_DTM_TIMER_IRQ_PRIORITY, - DEFAULT_TIMER_IRQ_HANDLER, NULL, 0); + nrfx_timer_irq_handler, &dtm_inst.timer, 0); return 0; } @@ -849,8 +833,8 @@ static int anomaly_timer_init(void) IRQ_CONNECT(ANOMALY_172_TIMER_IRQ, CONFIG_ANOMALY_172_TIMER_IRQ_PRIORITY, - ANOMALY_172_TIMER_IRQ_HANDLER, - NULL, 0); + nrfx_timer_irq_handler, + &dtm_inst.anomaly_timer, 0); nrfx_timer_compare(&dtm_inst.anomaly_timer, NRF_TIMER_CC_CHANNEL0, diff --git a/samples/bluetooth/iso_time_sync/boards/nrf52833dk_nrf52833.conf b/samples/bluetooth/iso_time_sync/boards/nrf52833dk_nrf52833.conf index 7487f343e31..ec772c7e06d 100644 --- a/samples/bluetooth/iso_time_sync/boards/nrf52833dk_nrf52833.conf +++ b/samples/bluetooth/iso_time_sync/boards/nrf52833dk_nrf52833.conf @@ -4,6 +4,6 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -CONFIG_NRFX_TIMER1=y +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 7487f343e31..ec772c7e06d 100644 --- a/samples/bluetooth/iso_time_sync/boards/nrf52840dk_nrf52840.conf +++ b/samples/bluetooth/iso_time_sync/boards/nrf52840dk_nrf52840.conf @@ -4,6 +4,6 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -CONFIG_NRFX_TIMER1=y +CONFIG_NRFX_TIMER=y CONFIG_NRFX_RTC2=y CONFIG_NRFX_PPI=y diff --git a/samples/bluetooth/iso_time_sync/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf b/samples/bluetooth/iso_time_sync/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf index 6ff372a50e0..2b01820c8e1 100644 --- a/samples/bluetooth/iso_time_sync/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf +++ b/samples/bluetooth/iso_time_sync/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf @@ -4,6 +4,6 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -CONFIG_NRFX_TIMER0=y +CONFIG_NRFX_TIMER=y CONFIG_NRFX_RTC0=y CONFIG_NRFX_GPPI=y diff --git a/samples/bluetooth/iso_time_sync/boards/nrf5340dk_nrf5340_cpuapp.conf b/samples/bluetooth/iso_time_sync/boards/nrf5340dk_nrf5340_cpuapp.conf index 6ff372a50e0..2b01820c8e1 100644 --- a/samples/bluetooth/iso_time_sync/boards/nrf5340dk_nrf5340_cpuapp.conf +++ b/samples/bluetooth/iso_time_sync/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -4,6 +4,6 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -CONFIG_NRFX_TIMER0=y +CONFIG_NRFX_TIMER=y CONFIG_NRFX_RTC0=y CONFIG_NRFX_GPPI=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 df16edd08c4..7980bc71178 100644 --- a/samples/bluetooth/iso_time_sync/src/controller_time_nrf52.c +++ b/samples/bluetooth/iso_time_sync/src/controller_time_nrf52.c @@ -22,7 +22,7 @@ #include "iso_time_sync.h" static const nrfx_rtc_t app_rtc_instance = NRFX_RTC_INSTANCE(2); -static const nrfx_timer_t app_timer_instance = NRFX_TIMER_INSTANCE(1); +static nrfx_timer_t app_timer_instance = NRFX_TIMER_INSTANCE(NRF_TIMER1); static uint8_t ppi_chan_on_rtc_match; static volatile uint32_t num_rtc_overflows; 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 655960018d3..b44b4b74c8f 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 @@ -23,7 +23,7 @@ #include "iso_time_sync.h" static const nrfx_rtc_t app_rtc_instance = NRFX_RTC_INSTANCE(0); -static const nrfx_timer_t app_timer_instance = NRFX_TIMER_INSTANCE(0); +static nrfx_timer_t app_timer_instance = NRFX_TIMER_INSTANCE(NRF_TIMER0); static uint8_t ppi_chan_on_rtc_match; static volatile uint32_t num_rtc_overflows; diff --git a/samples/peripheral/802154_phy_test/boards/nrf21540dk_nrf52840.conf b/samples/peripheral/802154_phy_test/boards/nrf21540dk_nrf52840.conf index e3cd4d4acf2..e0f0a459850 100644 --- a/samples/peripheral/802154_phy_test/boards/nrf21540dk_nrf52840.conf +++ b/samples/peripheral/802154_phy_test/boards/nrf21540dk_nrf52840.conf @@ -9,7 +9,7 @@ CONFIG_SHELL_PROMPT_UART=">" # nrfx drivers configuration: CONFIG_NRFX_POWER=y # enable DC/DC support CONFIG_NRFX_RNG=y # enable RNG -CONFIG_NRFX_TIMER2=y # enable TIMER2 +CONFIG_NRFX_TIMER=y # enable TIMER support # Allow sharing the RTC between IEEE 802.15.4 and Zephyr CONFIG_NRF_RTC_TIMER_USER_CHAN_COUNT=3 diff --git a/samples/peripheral/802154_phy_test/boards/nrf52833dk_nrf52833.conf b/samples/peripheral/802154_phy_test/boards/nrf52833dk_nrf52833.conf index e3cd4d4acf2..e0f0a459850 100644 --- a/samples/peripheral/802154_phy_test/boards/nrf52833dk_nrf52833.conf +++ b/samples/peripheral/802154_phy_test/boards/nrf52833dk_nrf52833.conf @@ -9,7 +9,7 @@ CONFIG_SHELL_PROMPT_UART=">" # nrfx drivers configuration: CONFIG_NRFX_POWER=y # enable DC/DC support CONFIG_NRFX_RNG=y # enable RNG -CONFIG_NRFX_TIMER2=y # enable TIMER2 +CONFIG_NRFX_TIMER=y # enable TIMER support # Allow sharing the RTC between IEEE 802.15.4 and Zephyr CONFIG_NRF_RTC_TIMER_USER_CHAN_COUNT=3 diff --git a/samples/peripheral/802154_phy_test/boards/nrf52840dk_nrf52840.conf b/samples/peripheral/802154_phy_test/boards/nrf52840dk_nrf52840.conf index e3cd4d4acf2..e0f0a459850 100644 --- a/samples/peripheral/802154_phy_test/boards/nrf52840dk_nrf52840.conf +++ b/samples/peripheral/802154_phy_test/boards/nrf52840dk_nrf52840.conf @@ -9,7 +9,7 @@ CONFIG_SHELL_PROMPT_UART=">" # nrfx drivers configuration: CONFIG_NRFX_POWER=y # enable DC/DC support CONFIG_NRFX_RNG=y # enable RNG -CONFIG_NRFX_TIMER2=y # enable TIMER2 +CONFIG_NRFX_TIMER=y # enable TIMER support # Allow sharing the RTC between IEEE 802.15.4 and Zephyr CONFIG_NRF_RTC_TIMER_USER_CHAN_COUNT=3 diff --git a/samples/peripheral/802154_phy_test/boards/nrf5340dk_nrf5340_cpunet.conf b/samples/peripheral/802154_phy_test/boards/nrf5340dk_nrf5340_cpunet.conf index 172e945c837..1286f0b26dd 100644 --- a/samples/peripheral/802154_phy_test/boards/nrf5340dk_nrf5340_cpunet.conf +++ b/samples/peripheral/802154_phy_test/boards/nrf5340dk_nrf5340_cpunet.conf @@ -28,7 +28,7 @@ CONFIG_NRF_RTC_TIMER_USER_CHAN_COUNT=2 # nrfx drivers configuration: CONFIG_NRFX_POWER=y # enable DC/DC support CONFIG_NRFX_RNG=y # enable RNG -CONFIG_NRFX_TIMER2=y # enable TIMER2 +CONFIG_NRFX_TIMER=y # enable TIMER support # Set temperature sensor update period in ms CONFIG_NRF_802154_TEMPERATURE_UPDATE_PERIOD=10000 diff --git a/samples/peripheral/802154_phy_test/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/samples/peripheral/802154_phy_test/boards/nrf54l15dk_nrf54l15_cpuapp.conf index c75ea20e506..2cb954e3967 100644 --- a/samples/peripheral/802154_phy_test/boards/nrf54l15dk_nrf54l15_cpuapp.conf +++ b/samples/peripheral/802154_phy_test/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -10,7 +10,7 @@ CONFIG_SHELL_PROMPT_UART=">" CONFIG_PTT_CACHE_MGMT=n # nrfx drivers configuration: -CONFIG_NRFX_TIMER20=y # enable TIMER2 +CONFIG_NRFX_TIMER=y # enable TIMER support # enable DPPIC CONFIG_NRFX_GPPI=y diff --git a/samples/peripheral/802154_phy_test/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf b/samples/peripheral/802154_phy_test/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf index 12575d4b771..dc9958a7379 100644 --- a/samples/peripheral/802154_phy_test/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf +++ b/samples/peripheral/802154_phy_test/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf @@ -9,7 +9,7 @@ CONFIG_SHELL_PROMPT_UART=">" # currently unsupported for nRF54LM20 CONFIG_PTT_CACHE_MGMT=n # nrfx drivers configuration: -CONFIG_NRFX_TIMER20=y # enable TIMER2 +CONFIG_NRFX_TIMER=y # enable TIMER support # enable DPPIC CONFIG_NRFX_GPPI=y diff --git a/samples/peripheral/802154_phy_test/src/periph_proc.c b/samples/peripheral/802154_phy_test/src/periph_proc.c index df2c67f4ead..e035f4e9498 100644 --- a/samples/peripheral/802154_phy_test/src/periph_proc.c +++ b/samples/peripheral/802154_phy_test/src/periph_proc.c @@ -49,7 +49,7 @@ LOG_MODULE_REGISTER(periph); #define PTT_CLK_TIMER 20 #endif -static nrfx_timer_t clk_timer = NRFX_TIMER_INSTANCE(PTT_CLK_TIMER); +static nrfx_timer_t clk_timer = NRFX_TIMER_INSTANCE(NRF_TIMER_INST_GET(PTT_CLK_TIMER)); #define GPIOTE_NODE(gpio_node) DT_PHANDLE(gpio_node, gpiote_instance) #define GPIOTE_INST_AND_COMMA(gpio_node) \ diff --git a/samples/peripheral/lpuart/boards/nrf21540dk_nrf52840.conf b/samples/peripheral/lpuart/boards/nrf21540dk_nrf52840.conf index aebd0c7cf01..e351a335beb 100644 --- a/samples/peripheral/lpuart/boards/nrf21540dk_nrf52840.conf +++ b/samples/peripheral/lpuart/boards/nrf21540dk_nrf52840.conf @@ -8,4 +8,4 @@ CONFIG_UART_1_INTERRUPT_DRIVEN=n CONFIG_UART_1_NRF_HW_ASYNC=y CONFIG_UART_1_NRF_HW_ASYNC_TIMER=2 CONFIG_UART_1_NRF_ASYNC_LOW_POWER=y -CONFIG_NRFX_TIMER2=y +CONFIG_NRFX_TIMER=y diff --git a/samples/peripheral/lpuart/boards/nrf52833dk_nrf52833.conf b/samples/peripheral/lpuart/boards/nrf52833dk_nrf52833.conf index aebd0c7cf01..e351a335beb 100644 --- a/samples/peripheral/lpuart/boards/nrf52833dk_nrf52833.conf +++ b/samples/peripheral/lpuart/boards/nrf52833dk_nrf52833.conf @@ -8,4 +8,4 @@ CONFIG_UART_1_INTERRUPT_DRIVEN=n CONFIG_UART_1_NRF_HW_ASYNC=y CONFIG_UART_1_NRF_HW_ASYNC_TIMER=2 CONFIG_UART_1_NRF_ASYNC_LOW_POWER=y -CONFIG_NRFX_TIMER2=y +CONFIG_NRFX_TIMER=y diff --git a/samples/peripheral/lpuart/boards/nrf52840dk_nrf52840.conf b/samples/peripheral/lpuart/boards/nrf52840dk_nrf52840.conf index aebd0c7cf01..e351a335beb 100644 --- a/samples/peripheral/lpuart/boards/nrf52840dk_nrf52840.conf +++ b/samples/peripheral/lpuart/boards/nrf52840dk_nrf52840.conf @@ -8,4 +8,4 @@ CONFIG_UART_1_INTERRUPT_DRIVEN=n CONFIG_UART_1_NRF_HW_ASYNC=y CONFIG_UART_1_NRF_HW_ASYNC_TIMER=2 CONFIG_UART_1_NRF_ASYNC_LOW_POWER=y -CONFIG_NRFX_TIMER2=y +CONFIG_NRFX_TIMER=y diff --git a/samples/peripheral/lpuart/boards/nrf52dk_nrf52832.conf b/samples/peripheral/lpuart/boards/nrf52dk_nrf52832.conf index 3a05f5e6885..b3415fa2d41 100644 --- a/samples/peripheral/lpuart/boards/nrf52dk_nrf52832.conf +++ b/samples/peripheral/lpuart/boards/nrf52dk_nrf52832.conf @@ -8,4 +8,4 @@ CONFIG_UART_0_ASYNC=y CONFIG_UART_0_INTERRUPT_DRIVEN=n CONFIG_UART_0_NRF_HW_ASYNC=y CONFIG_UART_0_NRF_HW_ASYNC_TIMER=2 -CONFIG_NRFX_TIMER2=y +CONFIG_NRFX_TIMER=y diff --git a/samples/peripheral/lpuart/boards/nrf5340dk_nrf5340_cpuapp.conf b/samples/peripheral/lpuart/boards/nrf5340dk_nrf5340_cpuapp.conf index aebd0c7cf01..e351a335beb 100644 --- a/samples/peripheral/lpuart/boards/nrf5340dk_nrf5340_cpuapp.conf +++ b/samples/peripheral/lpuart/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -8,4 +8,4 @@ CONFIG_UART_1_INTERRUPT_DRIVEN=n CONFIG_UART_1_NRF_HW_ASYNC=y CONFIG_UART_1_NRF_HW_ASYNC_TIMER=2 CONFIG_UART_1_NRF_ASYNC_LOW_POWER=y -CONFIG_NRFX_TIMER2=y +CONFIG_NRFX_TIMER=y diff --git a/samples/peripheral/lpuart/boards/nrf9160dk_nrf9160_ns.conf b/samples/peripheral/lpuart/boards/nrf9160dk_nrf9160_ns.conf index aebd0c7cf01..e351a335beb 100644 --- a/samples/peripheral/lpuart/boards/nrf9160dk_nrf9160_ns.conf +++ b/samples/peripheral/lpuart/boards/nrf9160dk_nrf9160_ns.conf @@ -8,4 +8,4 @@ CONFIG_UART_1_INTERRUPT_DRIVEN=n CONFIG_UART_1_NRF_HW_ASYNC=y CONFIG_UART_1_NRF_HW_ASYNC_TIMER=2 CONFIG_UART_1_NRF_ASYNC_LOW_POWER=y -CONFIG_NRFX_TIMER2=y +CONFIG_NRFX_TIMER=y diff --git a/samples/peripheral/radio_test/boards/nrf54h20dk_nrf54h20_cpurad.conf b/samples/peripheral/radio_test/boards/nrf54h20dk_nrf54h20_cpurad.conf index 40e6dcdd55f..250488c2a44 100644 --- a/samples/peripheral/radio_test/boards/nrf54h20dk_nrf54h20_cpurad.conf +++ b/samples/peripheral/radio_test/boards/nrf54h20dk_nrf54h20_cpurad.conf @@ -4,14 +4,11 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -# Disable the unsupported driver -CONFIG_NRFX_TIMER0=n - CONFIG_CONSOLE_HANDLER=y CONFIG_SHELL=y CONFIG_DYNAMIC_INTERRUPTS=y -CONFIG_NRFX_TIMER020=y +CONFIG_NRFX_TIMER=y CONFIG_ENTROPY_GENERATOR=y diff --git a/samples/peripheral/radio_test/boards/nrf54l15dk_nrf54l05_cpuapp.conf b/samples/peripheral/radio_test/boards/nrf54l15dk_nrf54l05_cpuapp.conf index 0e189be2079..e26b03e78fc 100644 --- a/samples/peripheral/radio_test/boards/nrf54l15dk_nrf54l05_cpuapp.conf +++ b/samples/peripheral/radio_test/boards/nrf54l15dk_nrf54l05_cpuapp.conf @@ -4,8 +4,5 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -# Disable the unsupported driver -CONFIG_NRFX_TIMER0=n - # Enable the necessary drivers -CONFIG_NRFX_TIMER10=y +CONFIG_NRFX_TIMER=y diff --git a/samples/peripheral/radio_test/boards/nrf54l15dk_nrf54l10_cpuapp.conf b/samples/peripheral/radio_test/boards/nrf54l15dk_nrf54l10_cpuapp.conf index 0e189be2079..e26b03e78fc 100644 --- a/samples/peripheral/radio_test/boards/nrf54l15dk_nrf54l10_cpuapp.conf +++ b/samples/peripheral/radio_test/boards/nrf54l15dk_nrf54l10_cpuapp.conf @@ -4,8 +4,5 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -# Disable the unsupported driver -CONFIG_NRFX_TIMER0=n - # Enable the necessary drivers -CONFIG_NRFX_TIMER10=y +CONFIG_NRFX_TIMER=y diff --git a/samples/peripheral/radio_test/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/samples/peripheral/radio_test/boards/nrf54l15dk_nrf54l15_cpuapp.conf index 0e189be2079..e26b03e78fc 100644 --- a/samples/peripheral/radio_test/boards/nrf54l15dk_nrf54l15_cpuapp.conf +++ b/samples/peripheral/radio_test/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -4,8 +4,5 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -# Disable the unsupported driver -CONFIG_NRFX_TIMER0=n - # Enable the necessary drivers -CONFIG_NRFX_TIMER10=y +CONFIG_NRFX_TIMER=y diff --git a/samples/peripheral/radio_test/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf b/samples/peripheral/radio_test/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf index 6784ff29ee8..7aa6da92bb5 100644 --- a/samples/peripheral/radio_test/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf +++ b/samples/peripheral/radio_test/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf @@ -4,8 +4,5 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -# Disable the unsupported driver -CONFIG_NRFX_TIMER0=n - # Enable the necessary drivers -CONFIG_NRFX_TIMER10=y +CONFIG_NRFX_TIMER=y diff --git a/samples/peripheral/radio_test/boards/nrf54ls05dk_nrf54ls05b_cpuapp.conf b/samples/peripheral/radio_test/boards/nrf54ls05dk_nrf54ls05b_cpuapp.conf index 6784ff29ee8..7aa6da92bb5 100644 --- a/samples/peripheral/radio_test/boards/nrf54ls05dk_nrf54ls05b_cpuapp.conf +++ b/samples/peripheral/radio_test/boards/nrf54ls05dk_nrf54ls05b_cpuapp.conf @@ -4,8 +4,5 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -# Disable the unsupported driver -CONFIG_NRFX_TIMER0=n - # Enable the necessary drivers -CONFIG_NRFX_TIMER10=y +CONFIG_NRFX_TIMER=y diff --git a/samples/peripheral/radio_test/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf b/samples/peripheral/radio_test/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf index 6784ff29ee8..7aa6da92bb5 100644 --- a/samples/peripheral/radio_test/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf +++ b/samples/peripheral/radio_test/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf @@ -4,8 +4,5 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -# Disable the unsupported driver -CONFIG_NRFX_TIMER0=n - # Enable the necessary drivers -CONFIG_NRFX_TIMER10=y +CONFIG_NRFX_TIMER=y diff --git a/samples/peripheral/radio_test/prj.conf b/samples/peripheral/radio_test/prj.conf index 5ab2bf8a375..47c3de4f119 100644 --- a/samples/peripheral/radio_test/prj.conf +++ b/samples/peripheral/radio_test/prj.conf @@ -9,7 +9,7 @@ CONFIG_SHELL=y CONFIG_DYNAMIC_INTERRUPTS=y -CONFIG_NRFX_TIMER0=y +CONFIG_NRFX_TIMER=y CONFIG_NRFX_GPPI=y CONFIG_CLOCK_CONTROL=y diff --git a/samples/peripheral/radio_test/prj_usb.conf b/samples/peripheral/radio_test/prj_usb.conf index 92fcd71d21b..90c0229c9cb 100644 --- a/samples/peripheral/radio_test/prj_usb.conf +++ b/samples/peripheral/radio_test/prj_usb.conf @@ -9,7 +9,7 @@ CONFIG_SHELL=y CONFIG_DYNAMIC_INTERRUPTS=y -CONFIG_NRFX_TIMER0=y +CONFIG_NRFX_TIMER=y CONFIG_CLOCK_CONTROL=y CONFIG_ENTROPY_GENERATOR=y diff --git a/samples/peripheral/radio_test/src/radio_test.c b/samples/peripheral/radio_test/src/radio_test.c index f933ef9a1a4..d58320bf2b6 100644 --- a/samples/peripheral/radio_test/src/radio_test.c +++ b/samples/peripheral/radio_test/src/radio_test.c @@ -75,10 +75,6 @@ #define RADIO_TEST_EVENT_END NRF_RADIO_EVENT_END #endif /* defined(CONFIG_SOC_SERIES_NRF54HX) */ -#define RADIO_TEST_TIMER_IRQ_HANDLER NRFX_CONCAT_3(nrfx_timer_, \ - RADIO_TEST_TIMER_INSTANCE, \ - _irq_handler) - #define ENDPOINT_EGU_RADIO_TX BIT(1) #define ENDPOINT_EGU_RADIO_RX BIT(2) #define ENDPOINT_TIMER_RADIO_TX BIT(3) @@ -100,7 +96,8 @@ static uint32_t rx_packet_cnt; static uint8_t current_channel; /* Timer used for channel sweeps and tx with duty cycle. */ -static const nrfx_timer_t timer = NRFX_TIMER_INSTANCE(RADIO_TEST_TIMER_INSTANCE); +static nrfx_timer_t timer = + NRFX_TIMER_INSTANCE(NRF_TIMER_INST_GET(RADIO_TEST_TIMER_INSTANCE)); static bool sweep_processing; @@ -1304,7 +1301,7 @@ int radio_test_init(struct radio_test_config *config) timer_init(config); IRQ_CONNECT(RADIO_TEST_TIMER_IRQn, IRQ_PRIO_LOWEST, - RADIO_TEST_TIMER_IRQ_HANDLER, NULL, 0); + nrfx_timer_irq_handler, &timer, 0); irq_connect_dynamic(RADIO_TEST_RADIO_IRQn, IRQ_PRIO_LOWEST, radio_handler, config, 0); irq_enable(RADIO_TEST_RADIO_IRQn); diff --git a/samples/wifi/radio_test/single_domain/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/samples/wifi/radio_test/single_domain/boards/nrf54l15dk_nrf54l15_cpuapp.conf index e029d65ce7b..5f2279d8b7a 100644 --- a/samples/wifi/radio_test/single_domain/boards/nrf54l15dk_nrf54l15_cpuapp.conf +++ b/samples/wifi/radio_test/single_domain/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -4,9 +4,6 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -# Disable the unsupported driver -CONFIG_NRFX_TIMER0=n - # Enable the necessary drivers -CONFIG_NRFX_TIMER10=y +CONFIG_NRFX_TIMER=y CONFIG_NRFX_GPPI=y diff --git a/samples/wifi/radio_test/single_domain/prj.conf b/samples/wifi/radio_test/single_domain/prj.conf index 02db2cd7edb..d278a2a58f1 100644 --- a/samples/wifi/radio_test/single_domain/prj.conf +++ b/samples/wifi/radio_test/single_domain/prj.conf @@ -43,7 +43,7 @@ CONFIG_SHELL=y CONFIG_DYNAMIC_INTERRUPTS=y -CONFIG_NRFX_TIMER0=y +CONFIG_NRFX_TIMER=y CONFIG_CLOCK_CONTROL=y CONFIG_ENTROPY_GENERATOR=y diff --git a/samples/wifi/radio_test/single_domain/sample.yaml b/samples/wifi/radio_test/single_domain/sample.yaml index 81aab84130a..fe822ab3bcb 100644 --- a/samples/wifi/radio_test/single_domain/sample.yaml +++ b/samples/wifi/radio_test/single_domain/sample.yaml @@ -36,7 +36,7 @@ tests: build_only: true extra_args: - single_domain_SHIELD="nrf7002eb2" - - CONFIG_NRFX_TIMER10=y + - CONFIG_NRFX_TIMER=y - CONFIG_NRFX_GPPI=y integration_platforms: - nrf54lm20dk/nrf54lm20a/cpuapp From af3a6d6275d79f5ffd49c86dbc3d7cbdf4e0ed90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bainczyk?= Date: Wed, 22 Oct 2025 15:46:12 +0200 Subject: [PATCH 26/72] tests: Align to changes in nrfx_timer driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Align tests to extracted control block in nrfx_timer driver. Signed-off-by: Michał Bainczyk --- tests/drivers/audio/pdm_loopback/src/main.c | 8 +++---- .../drivers/audio/pdm_loopback/testcase.yaml | 24 +++++++++---------- tests/drivers/nrfx_integration_test/Kconfig | 16 ++++--------- .../subsys/debug/cpu_load/src/test_cpu_load.c | 2 +- tests/subsys/debug/cpu_load/testcase.yaml | 2 +- 5 files changed, 22 insertions(+), 30 deletions(-) diff --git a/tests/drivers/audio/pdm_loopback/src/main.c b/tests/drivers/audio/pdm_loopback/src/main.c index 2f480c84e0a..20c0addd66b 100644 --- a/tests/drivers/audio/pdm_loopback/src/main.c +++ b/tests/drivers/audio/pdm_loopback/src/main.c @@ -49,10 +49,10 @@ static const nrfx_gpiote_t gpiote_instance = NRFX_GPIOTE_INSTANCE( static struct pcm_stream_cfg stream_config, stream_config_dummy; static struct dmic_cfg pdm_cfg, pdm_cfg_dummy; -#if CONFIG_NRFX_TIMER00 -static const nrfx_timer_t timer_instance = NRFX_TIMER_INSTANCE(00); -#elif CONFIG_NRFX_TIMER130 -static const nrfx_timer_t timer_instance = NRFX_TIMER_INSTANCE(130); +#if defined(NRF_TIMER00) +static nrfx_timer_t timer_instance = NRFX_TIMER_INSTANCE(NRF_TIMER00); +#elif defined(NRF_TIMER130) +static nrfx_timer_t timer_instance = NRFX_TIMER_INSTANCE(NRF_TIMER130); #else #error "No timer instance found" #endif diff --git a/tests/drivers/audio/pdm_loopback/testcase.yaml b/tests/drivers/audio/pdm_loopback/testcase.yaml index 79e842fc7ac..11acd2c8793 100644 --- a/tests/drivers/audio/pdm_loopback/testcase.yaml +++ b/tests/drivers/audio/pdm_loopback/testcase.yaml @@ -15,12 +15,12 @@ tests: - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: - nrf54lm20dk/nrf54lm20a/cpuapp - extra_args: CONFIG_NRFX_TIMER00=y + extra_args: CONFIG_NRFX_TIMER=y drivers.audio.pdm_loopback.nrf54lm20.1000khz: platform_allow: - nrf54lm20dk/nrf54lm20a/cpuapp extra_args: - - CONFIG_NRFX_TIMER00=y + - CONFIG_NRFX_TIMER=y - CONFIG_TEST_PDM_SAMPLING_RATE=20000 drivers.audio.pdm_loopback.nrf54l.1280khz: platform_allow: @@ -30,7 +30,7 @@ tests: integration_platforms: - nrf54lm20dk/nrf54lm20a/cpuapp extra_args: - - CONFIG_NRFX_TIMER00=y + - CONFIG_NRFX_TIMER=y - CONFIG_TEST_PDM_SAMPLING_RATE=16000 - CONFIG_TEST_PDM_EXPECTED_FREQUENCY=1280000 drivers.audio.pdm_loopback.nrf54l.1600khz: @@ -41,21 +41,21 @@ tests: integration_platforms: - nrf54lm20dk/nrf54lm20a/cpuapp extra_args: - - CONFIG_NRFX_TIMER00=y + - CONFIG_NRFX_TIMER=y - CONFIG_TEST_PDM_SAMPLING_RATE=32000 - CONFIG_TEST_PDM_EXPECTED_FREQUENCY=1600000 drivers.audio.pdm_loopback.nrf54lm20.aclk.1000khz: platform_allow: - nrf54lm20dk/nrf54lm20a/cpuapp extra_args: - - CONFIG_NRFX_TIMER00=y + - CONFIG_NRFX_TIMER=y - CONFIG_TEST_PDM_SAMPLING_RATE=20000 - EXTRA_DTC_OVERLAY_FILE="boards/nrf54l_aclk.overlay" drivers.audio.pdm_loopback.nrf54lm20.aclk.1280khz: platform_allow: - nrf54lm20dk/nrf54lm20a/cpuapp extra_args: - - CONFIG_NRFX_TIMER00=y + - CONFIG_NRFX_TIMER=y - CONFIG_TEST_PDM_SAMPLING_RATE=16000 - CONFIG_TEST_PDM_EXPECTED_FREQUENCY=1280000 - EXTRA_DTC_OVERLAY_FILE="boards/nrf54l_aclk.overlay" @@ -63,7 +63,7 @@ tests: platform_allow: - nrf54lm20dk/nrf54lm20a/cpuapp extra_args: - - CONFIG_NRFX_TIMER00=y + - CONFIG_NRFX_TIMER=y - CONFIG_TEST_PDM_SAMPLING_RATE=32000 - CONFIG_TEST_PDM_EXPECTED_FREQUENCY=1600000 - EXTRA_DTC_OVERLAY_FILE="boards/nrf54l_aclk.overlay" @@ -71,14 +71,14 @@ tests: platform_allow: - nrf54h20dk/nrf54h20/cpuapp extra_args: - - CONFIG_NRFX_TIMER130=y + - CONFIG_NRFX_TIMER=y - CONFIG_TEST_PDM_SAMPLING_TIME=10 - CONFIG_TEST_USE_DMM=y drivers.audio.pdm_loopback.nrf54h20.1600khz: platform_allow: - nrf54h20dk/nrf54h20/cpuapp extra_args: - - CONFIG_NRFX_TIMER130=y + - CONFIG_NRFX_TIMER=y - CONFIG_TEST_PDM_SAMPLING_RATE=16000 - CONFIG_TEST_PDM_EXPECTED_FREQUENCY=1600000 - CONFIG_TEST_PDM_SAMPLING_TIME=10 @@ -87,7 +87,7 @@ tests: platform_allow: - nrf54h20dk/nrf54h20/cpuapp extra_args: - - CONFIG_NRFX_TIMER130=y + - CONFIG_NRFX_TIMER=y - CONFIG_TEST_PDM_SAMPLING_RATE=44100 - CONFIG_TEST_PDM_EXPECTED_FREQUENCY=1411200 - CONFIG_TEST_PDM_SAMPLING_TIME=10 @@ -98,7 +98,7 @@ tests: platform_allow: - nrf54h20dk/nrf54h20/cpuapp extra_args: - - CONFIG_NRFX_TIMER130=y + - CONFIG_NRFX_TIMER=y - CONFIG_TEST_PDM_SAMPLING_RATE=48000 - CONFIG_TEST_PDM_EXPECTED_FREQUENCY=1536000 - CONFIG_TEST_PDM_SAMPLING_TIME=10 @@ -109,5 +109,5 @@ tests: platform_allow: - nrf54h20dk/nrf54h20/cpuapp extra_args: - - CONFIG_NRFX_TIMER130=y + - CONFIG_NRFX_TIMER=y - CONFIG_TEST_PDM_SAMPLING_TIME=10 diff --git a/tests/drivers/nrfx_integration_test/Kconfig b/tests/drivers/nrfx_integration_test/Kconfig index 5666960f05d..897cafac7ec 100644 --- a/tests/drivers/nrfx_integration_test/Kconfig +++ b/tests/drivers/nrfx_integration_test/Kconfig @@ -44,18 +44,10 @@ config NRFX_ALL_DRIVERS select NRFX_SPI2 if HAS_HW_NRF_SPI2 select NRFX_SYSTICK if CPU_CORTEX_M_HAS_SYSTICK select NRFX_TEMP if HAS_HW_NRF_TEMP - select NRFX_TIMER0 if HAS_HW_NRF_TIMER0 - select NRFX_TIMER1 if HAS_HW_NRF_TIMER1 - select NRFX_TIMER2 if HAS_HW_NRF_TIMER2 - select NRFX_TIMER3 if HAS_HW_NRF_TIMER3 - select NRFX_TIMER4 if HAS_HW_NRF_TIMER4 - select NRFX_TIMER00 if HAS_HW_NRF_TIMER00 - select NRFX_TIMER10 if HAS_HW_NRF_TIMER10 - select NRFX_TIMER20 if HAS_HW_NRF_TIMER20 - select NRFX_TIMER21 if HAS_HW_NRF_TIMER21 - select NRFX_TIMER22 if HAS_HW_NRF_TIMER22 - select NRFX_TIMER23 if HAS_HW_NRF_TIMER23 - select NRFX_TIMER24 if HAS_HW_NRF_TIMER24 + select NRFX_TIMER if HAS_HW_NRF_TIMER0 || HAS_HW_NRF_TIMER1 || HAS_HW_NRF_TIMER2 \ + || HAS_HW_NRF_TIMER3 || HAS_HW_NRF_TIMER4 || HAS_HW_NRF_TIMER00 \ + || HAS_HW_NRF_TIMER10 || HAS_HW_NRF_TIMER20 || HAS_HW_NRF_TIMER21 \ + || HAS_HW_NRF_TIMER22 || HAS_HW_NRF_TIMER23 || HAS_HW_NRF_TIMER24 select NRFX_TWI0 if HAS_HW_NRF_TWI0 select NRFX_TWI1 if HAS_HW_NRF_TWI1 select NRFX_TWIM0 if HAS_HW_NRF_TWIM0 diff --git a/tests/subsys/debug/cpu_load/src/test_cpu_load.c b/tests/subsys/debug/cpu_load/src/test_cpu_load.c index 15c260c594e..d922ff93df6 100644 --- a/tests/subsys/debug/cpu_load/src/test_cpu_load.c +++ b/tests/subsys/debug/cpu_load/src/test_cpu_load.c @@ -23,7 +23,7 @@ static void timer_handler(nrf_timer_event_t event_type, void *context) static int dppi_shared_resources_init(void) { nrfx_err_t err; - static nrfx_timer_t timer = NRFX_TIMER_INSTANCE(1); + static nrfx_timer_t timer = NRFX_TIMER_INSTANCE(NRF_TIMER1); uint32_t base_frequency = NRF_TIMER_BASE_FREQUENCY_GET(timer.p_reg); nrfx_timer_config_t config = NRFX_TIMER_DEFAULT_CONFIG(base_frequency); uint8_t ch; diff --git a/tests/subsys/debug/cpu_load/testcase.yaml b/tests/subsys/debug/cpu_load/testcase.yaml index 7575c7f2d1f..fdcc2a3951f 100644 --- a/tests/subsys/debug/cpu_load/testcase.yaml +++ b/tests/subsys/debug/cpu_load/testcase.yaml @@ -28,4 +28,4 @@ tests: - ci_tests_subsys_debug extra_configs: - CONFIG_NRF_CPU_LOAD_USE_SHARED_DPPI_CHANNELS=y - - CONFIG_NRFX_TIMER1=y + - CONFIG_NRFX_TIMER=y From bafe457d544d83510f8fc68e49ab6ae306a197ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bainczyk?= Date: Mon, 27 Oct 2025 12:29:38 +0100 Subject: [PATCH 27/72] debug: cpu_load: align to changes in nrfx_timer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Align to changes in nrfx_timer driver. Signed-off-by: Michał Bainczyk --- subsys/debug/cpu_load/Kconfig | 20 ++++++++++---------- subsys/debug/cpu_load/cpu_load.c | 3 ++- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/subsys/debug/cpu_load/Kconfig b/subsys/debug/cpu_load/Kconfig index fe81ebcf0a6..a2d6ff058c9 100644 --- a/subsys/debug/cpu_load/Kconfig +++ b/subsys/debug/cpu_load/Kconfig @@ -74,52 +74,52 @@ choice config NRF_CPU_LOAD_TIMER_0 depends on $(dt_nodelabel_has_compat,timer0,$(DT_COMPAT_NORDIC_NRF_TIMER)) bool "Timer 0" - select NRFX_TIMER0 + select NRFX_TIMER config NRF_CPU_LOAD_TIMER_1 depends on $(dt_nodelabel_has_compat,timer1,$(DT_COMPAT_NORDIC_NRF_TIMER)) bool "Timer 1" - select NRFX_TIMER1 + select NRFX_TIMER config NRF_CPU_LOAD_TIMER_2 depends on $(dt_nodelabel_has_compat,timer2,$(DT_COMPAT_NORDIC_NRF_TIMER)) bool "Timer 2" - select NRFX_TIMER2 + select NRFX_TIMER config NRF_CPU_LOAD_TIMER_3 depends on $(dt_nodelabel_has_compat,timer3,$(DT_COMPAT_NORDIC_NRF_TIMER)) bool "Timer 3" - select NRFX_TIMER3 + select NRFX_TIMER config NRF_CPU_LOAD_TIMER_4 depends on $(dt_nodelabel_has_compat,timer4,$(DT_COMPAT_NORDIC_NRF_TIMER)) bool "Timer 4" - select NRFX_TIMER4 + select NRFX_TIMER config NRF_CPU_LOAD_TIMER_20 depends on $(dt_nodelabel_has_compat,timer20,$(DT_COMPAT_NORDIC_NRF_TIMER)) bool "Timer 20" - select NRFX_TIMER20 + select NRFX_TIMER config NRF_CPU_LOAD_TIMER_21 depends on $(dt_nodelabel_has_compat,timer21,$(DT_COMPAT_NORDIC_NRF_TIMER)) bool "Timer 21" - select NRFX_TIMER21 + select NRFX_TIMER config NRF_CPU_LOAD_TIMER_22 depends on $(dt_nodelabel_has_compat,timer22,$(DT_COMPAT_NORDIC_NRF_TIMER)) bool "Timer 22" - select NRFX_TIMER22 + select NRFX_TIMER config NRF_CPU_LOAD_TIMER_23 depends on $(dt_nodelabel_has_compat,timer23,$(DT_COMPAT_NORDIC_NRF_TIMER)) bool "Timer 23" - select NRFX_TIMER23 + select NRFX_TIMER config NRF_CPU_LOAD_TIMER_24 depends on $(dt_nodelabel_has_compat,timer24,$(DT_COMPAT_NORDIC_NRF_TIMER)) bool "Timer 24" - select NRFX_TIMER24 + select NRFX_TIMER endchoice diff --git a/subsys/debug/cpu_load/cpu_load.c b/subsys/debug/cpu_load/cpu_load.c index ec42011b36e..0642e808a37 100644 --- a/subsys/debug/cpu_load/cpu_load.c +++ b/subsys/debug/cpu_load/cpu_load.c @@ -29,7 +29,8 @@ LOG_MODULE_REGISTER(cpu_load, CONFIG_NRF_CPU_LOAD_LOG_LEVEL); #define CPU_LOAD_LOG_INTERVAL 0 #endif -static nrfx_timer_t timer = NRFX_TIMER_INSTANCE(CONFIG_NRF_CPU_LOAD_TIMER_INSTANCE); +static nrfx_timer_t timer = + NRFX_TIMER_INSTANCE(NRF_TIMER_INST_GET(CONFIG_NRF_CPU_LOAD_TIMER_INSTANCE)); static bool ready; static struct k_work_delayable cpu_load_log; static uint32_t cycle_ref; From 9e97057d9f1eb47bdc6b35a013787d8cba59168e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bainczyk?= Date: Mon, 27 Oct 2025 12:30:48 +0100 Subject: [PATCH 28/72] esb: Align to changes in nrfx_timer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Align to changes in nrfx_timer. Signed-off-by: Michał Bainczyk --- subsys/esb/Kconfig | 18 +++++++++--------- subsys/esb/esb.c | 5 +++-- subsys/esb/esb_peripherals.h | 2 +- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/subsys/esb/Kconfig b/subsys/esb/Kconfig index 9ddcbfd4b4d..6472d1b065d 100644 --- a/subsys/esb/Kconfig +++ b/subsys/esb/Kconfig @@ -70,47 +70,47 @@ choice ESB_SYS_TIMER config ESB_SYS_TIMER0 bool "TIMER0" depends on $(dt_nodelabel_has_compat,timer0,$(DT_COMPAT_NORDIC_NRF_TIMER)) - select NRFX_TIMER0 + select NRFX_TIMER config ESB_SYS_TIMER1 bool "TIMER1" depends on $(dt_nodelabel_has_compat,timer1,$(DT_COMPAT_NORDIC_NRF_TIMER)) - select NRFX_TIMER1 + select NRFX_TIMER config ESB_SYS_TIMER2 bool "TIMER2" depends on $(dt_nodelabel_has_compat,timer2,$(DT_COMPAT_NORDIC_NRF_TIMER)) - select NRFX_TIMER2 + select NRFX_TIMER config ESB_SYS_TIMER3 bool "TIMER3" depends on $(dt_nodelabel_has_compat,timer3,$(DT_COMPAT_NORDIC_NRF_TIMER)) - select NRFX_TIMER3 + select NRFX_TIMER config ESB_SYS_TIMER4 bool "TIMER4" depends on $(dt_nodelabel_has_compat,timer4,$(DT_COMPAT_NORDIC_NRF_TIMER)) - select NRFX_TIMER4 + select NRFX_TIMER config ESB_SYS_TIMER10 bool "TIMER10" depends on $(dt_nodelabel_has_compat,timer10,$(DT_COMPAT_NORDIC_NRF_TIMER)) - select NRFX_TIMER10 + select NRFX_TIMER config ESB_SYS_TIMER020 bool "TIMER020" depends on $(dt_nodelabel_has_compat,timer020,$(DT_COMPAT_NORDIC_NRF_TIMER)) - select NRFX_TIMER020 + select NRFX_TIMER config ESB_SYS_TIMER021 bool "TIMER021" depends on $(dt_nodelabel_has_compat,timer021,$(DT_COMPAT_NORDIC_NRF_TIMER)) - select NRFX_TIMER021 + select NRFX_TIMER config ESB_SYS_TIMER022 bool "TIMER022" depends on $(dt_nodelabel_has_compat,timer022,$(DT_COMPAT_NORDIC_NRF_TIMER)) - select NRFX_TIMER022 + select NRFX_TIMER endchoice diff --git a/subsys/esb/esb.c b/subsys/esb/esb.c index 6c59d4290f1..4dda6ca6f03 100644 --- a/subsys/esb/esb.c +++ b/subsys/esb/esb.c @@ -239,7 +239,8 @@ struct esb_address { atomic_t rf_channel_flags; /* Flags for setting the channel. */ }; -static nrfx_timer_t esb_timer = ESB_NRFX_TIMER_INSTANCE; +static nrfx_timer_t esb_timer = NRFX_TIMER_INSTANCE(ESB_NRFX_TIMER_INSTANCE_REG); +NRFX_INSTANCE_IRQ_HANDLER_DEFINE(timer, ESB_TIMER_INSTANCE_NO, &esb_timer); static struct esb_config esb_cfg; static volatile enum esb_state esb_state = ESB_STATE_UNINITIALIZED; @@ -1948,7 +1949,7 @@ static void evt_dynamic_irq_handler(const void *args) static void timer_dynamic_irq_handler(const void *args) { ARG_UNUSED(args); - ESB_TIMER_IRQ_HANDLER(); + nrfx_timer_irq_handler(&esb_timer); ISR_DIRECT_PM(); } diff --git a/subsys/esb/esb_peripherals.h b/subsys/esb/esb_peripherals.h index 6f195bcd902..b45ab755c78 100644 --- a/subsys/esb/esb_peripherals.h +++ b/subsys/esb/esb_peripherals.h @@ -104,7 +104,7 @@ extern "C" { NRFX_CONCAT_2(NRF_TIMER, ESB_TIMER_INSTANCE_NO) /** ESB nrfx timer instance. */ -#define ESB_NRFX_TIMER_INSTANCE NRFX_TIMER_INSTANCE(ESB_TIMER_INSTANCE_NO) +#define ESB_NRFX_TIMER_INSTANCE_REG NRF_TIMER_INST_GET(ESB_TIMER_INSTANCE_NO) /** ESB EGU events and tasks configuration. */ #define ESB_EGU_EVENT NRF_EGU_EVENT_TRIGGERED6 From 443ef05780d4270817d926e19a23532661e183a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bainczyk?= Date: Mon, 27 Oct 2025 12:31:20 +0100 Subject: [PATCH 29/72] nfc: Align to changes in nrfx_timer driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Align to changes in nrfx_timer driver. Signed-off-by: Michał Bainczyk --- subsys/nfc/lib/platform.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/subsys/nfc/lib/platform.c b/subsys/nfc/lib/platform.c index d16d5c0c30a..a2e42853684 100644 --- a/subsys/nfc/lib/platform.c +++ b/subsys/nfc/lib/platform.c @@ -45,9 +45,6 @@ LOG_MODULE_REGISTER(nfc_platform, CONFIG_NFC_PLATFORM_LOG_LEVEL); #define NFC_TIMER_IRQn NRFX_CONCAT_3(TIMER, \ NRFX_NFCT_CONFIG_TIMER_INSTANCE_ID, \ _IRQn) -#define nfc_timer_irq_handler NRFX_CONCAT_3(nrfx_timer_, \ - NRFX_NFCT_CONFIG_TIMER_INSTANCE_ID, \ - _irq_handler) #endif /* NFC_PLATFORM_USE_TIMER_WORKAROUND */ #if IS_ENABLED(CONFIG_CLOCK_CONTROL_NRF) @@ -123,7 +120,7 @@ nrfx_err_t nfc_platform_setup(nfc_lib_cb_resolve_t nfc_lib_cb_resolve, uint8_t * #if NFC_PLATFORM_USE_TIMER_WORKAROUND IRQ_CONNECT(NFC_TIMER_IRQn, DT_IRQ(NFCT, priority), - nfc_timer_irq_handler, NULL, 0); + nrfx_nfct_workaround_timer_handler, NULL, 0); #endif /* NFC_PLATFORM_USE_TIMER_WORKAROUND */ *p_irq_priority = DT_IRQ(NFCT, priority); From 92f8cce05185d032ebcd8ded9c6e561ef8fb949b Mon Sep 17 00:00:00 2001 From: Adam Kondraciuk Date: Fri, 17 Oct 2025 16:04:33 +0200 Subject: [PATCH 30/72] tests: i2c: Align tests to I2C API changes Align TWIM and TWIS tests to standard instanation changes in I2C API. Signed-off-by: Adam Kondraciuk --- .../fem/common/include/mpsl_fem_twi_drv.h | 2 +- subsys/mpsl/fem/common/mpsl_fem_twi_drv.c | 33 ++++++++----------- .../boards/nrf52840dk_nrf52840.conf | 1 - .../boards/nrf5340dk_nrf5340_cpuapp.conf | 1 - .../boards/nrf54h20dk_nrf54h20_cpuapp.conf | 1 - .../boards/nrf54l15dk_nrf54l15_cpuapp.conf | 1 - tests/benchmarks/i2c_endless/prj.conf | 1 + tests/benchmarks/i2c_endless/src/main.c | 23 ++++++------- .../boards/nrf54ls05dk_nrf54ls05b_cpuapp.conf | 1 - .../boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf | 1 - .../nrf54lv10dk_nrf54lv10a_cpuapp_ns.conf | 1 - .../boards/nrf7120pdk_nrf7120_cpuapp.conf | 1 - .../zephyr/boards/nrf/i2c/i2c_slave/prj.conf | 1 + 13 files changed, 27 insertions(+), 41 deletions(-) delete mode 100644 tests/benchmarks/i2c_endless/boards/nrf52840dk_nrf52840.conf delete mode 100644 tests/benchmarks/i2c_endless/boards/nrf5340dk_nrf5340_cpuapp.conf delete mode 100644 tests/benchmarks/i2c_endless/boards/nrf54h20dk_nrf54h20_cpuapp.conf delete mode 100644 tests/benchmarks/i2c_endless/boards/nrf54l15dk_nrf54l15_cpuapp.conf delete mode 100644 tests/zephyr/boards/nrf/i2c/i2c_slave/boards/nrf54ls05dk_nrf54ls05b_cpuapp.conf delete mode 100644 tests/zephyr/boards/nrf/i2c/i2c_slave/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf delete mode 100644 tests/zephyr/boards/nrf/i2c/i2c_slave/boards/nrf7120pdk_nrf7120_cpuapp.conf diff --git a/subsys/mpsl/fem/common/include/mpsl_fem_twi_drv.h b/subsys/mpsl/fem/common/include/mpsl_fem_twi_drv.h index a61800ab801..db01f405f23 100644 --- a/subsys/mpsl/fem/common/include/mpsl_fem_twi_drv.h +++ b/subsys/mpsl/fem/common/include/mpsl_fem_twi_drv.h @@ -14,7 +14,7 @@ /** @brief Structure representing an I2C bus driver for a Front-End Module. */ typedef struct { const struct device *dev; - nrfx_twim_evt_handler_t nrfx_twim_callback_saved; + nrfx_twim_event_handler_t nrfx_twim_callback_saved; void *nrfx_twim_callback_ctx_saved; mpsl_fem_twi_async_xfer_write_cb_t fem_twi_async_xfwr_write_cb; void *fem_twi_async_xfwr_write_cb_ctx; diff --git a/subsys/mpsl/fem/common/mpsl_fem_twi_drv.c b/subsys/mpsl/fem/common/mpsl_fem_twi_drv.c index dfd8f94fdd1..6f5fc418637 100644 --- a/subsys/mpsl/fem/common/mpsl_fem_twi_drv.c +++ b/subsys/mpsl/fem/common/mpsl_fem_twi_drv.c @@ -28,33 +28,34 @@ static int32_t mpsl_fem_twi_drv_impl_xfer_write(void *p_instance, uint8_t slave_ } static inline void mpsl_fem_twi_drv_nrfx_twim_callback_replace(mpsl_fem_twi_drv_t *drv, - nrfx_twim_evt_handler_t callback) + nrfx_twim_event_handler_t callback) { const struct i2c_nrfx_twim_common_config *config = drv->dev->config; - nrfx_err_t err; + int err; - nrfx_twim_callback_get(&config->twim, &drv->nrfx_twim_callback_saved, + nrfx_twim_callback_get(config->twim, &drv->nrfx_twim_callback_saved, &drv->nrfx_twim_callback_ctx_saved); - err = nrfx_twim_callback_set(&config->twim, callback, drv); + err = nrfx_twim_callback_set(config->twim, callback, drv); - __ASSERT_NO_MSG(err == NRFX_SUCCESS); + __ASSERT_NO_MSG(err >= 0); (void)err; } static inline void mpsl_fem_twi_drv_nrfx_twim_callback_restore(mpsl_fem_twi_drv_t *drv) { const struct i2c_nrfx_twim_common_config *config = drv->dev->config; - nrfx_err_t err; + int err; - err = nrfx_twim_callback_set(&config->twim, drv->nrfx_twim_callback_saved, + err = nrfx_twim_callback_set(config->twim, drv->nrfx_twim_callback_saved, drv->nrfx_twim_callback_ctx_saved); - __ASSERT_NO_MSG(err == NRFX_SUCCESS); + __ASSERT_NO_MSG(err >= 0); (void)err; } -static void mpsl_fem_twi_drv_nrfx_twim_evt_handler(nrfx_twim_evt_t const *p_event, void *p_context) +static void mpsl_fem_twi_drv_nrfx_twim_evt_handler(nrfx_twim_event_t const *p_event, + void *p_context) { mpsl_fem_twi_drv_t *drv = (mpsl_fem_twi_drv_t *)p_context; int32_t res = 0; @@ -91,26 +92,20 @@ static int32_t mpsl_fem_twi_drv_impl_xfer_write_async(void *p_instance, uint8_t .p_primary_buf = (uint8_t *)p_data, .primary_length = data_length, }; - nrfx_err_t err; - int32_t ret = 0; + int err; drv->fem_twi_async_xfwr_write_cb = p_callback; drv->fem_twi_async_xfwr_write_cb_ctx = p_context; mpsl_fem_twi_drv_nrfx_twim_callback_replace(drv, mpsl_fem_twi_drv_nrfx_twim_evt_handler); - err = nrfx_twim_xfer(&config->twim, &cur_xfer, 0); + err = nrfx_twim_xfer(config->twim, &cur_xfer, 0); - if (err != NRFX_SUCCESS) { + if (err < 0) { mpsl_fem_twi_drv_nrfx_twim_callback_restore(drv); - if (err == NRFX_ERROR_BUSY) { - ret = -EBUSY; - } else { - ret = -EIO; - } } - return ret; + return err; } static uint32_t mpsl_fem_twi_drv_frequency_hz_get(mpsl_fem_twi_drv_t *drv) diff --git a/tests/benchmarks/i2c_endless/boards/nrf52840dk_nrf52840.conf b/tests/benchmarks/i2c_endless/boards/nrf52840dk_nrf52840.conf deleted file mode 100644 index e79ad7a8126..00000000000 --- a/tests/benchmarks/i2c_endless/boards/nrf52840dk_nrf52840.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_NRFX_TWIS1=y diff --git a/tests/benchmarks/i2c_endless/boards/nrf5340dk_nrf5340_cpuapp.conf b/tests/benchmarks/i2c_endless/boards/nrf5340dk_nrf5340_cpuapp.conf deleted file mode 100644 index a7bedf1f04b..00000000000 --- a/tests/benchmarks/i2c_endless/boards/nrf5340dk_nrf5340_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_NRFX_TWIS2=y diff --git a/tests/benchmarks/i2c_endless/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/tests/benchmarks/i2c_endless/boards/nrf54h20dk_nrf54h20_cpuapp.conf deleted file mode 100644 index 157e0a11f72..00000000000 --- a/tests/benchmarks/i2c_endless/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_NRFX_TWIS131=y diff --git a/tests/benchmarks/i2c_endless/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/tests/benchmarks/i2c_endless/boards/nrf54l15dk_nrf54l15_cpuapp.conf deleted file mode 100644 index b01af3b36a7..00000000000 --- a/tests/benchmarks/i2c_endless/boards/nrf54l15dk_nrf54l15_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_NRFX_TWIS22=y diff --git a/tests/benchmarks/i2c_endless/prj.conf b/tests/benchmarks/i2c_endless/prj.conf index b672296b367..d40ef838da6 100644 --- a/tests/benchmarks/i2c_endless/prj.conf +++ b/tests/benchmarks/i2c_endless/prj.conf @@ -1,2 +1,3 @@ CONFIG_I2C=y CONFIG_LOG=y +CONFIG_NRFX_TWIS=y diff --git a/tests/benchmarks/i2c_endless/src/main.c b/tests/benchmarks/i2c_endless/src/main.c index 71e6a6a861e..b6ac2f9631b 100644 --- a/tests/benchmarks/i2c_endless/src/main.c +++ b/tests/benchmarks/i2c_endless/src/main.c @@ -15,15 +15,10 @@ LOG_MODULE_REGISTER(app, LOG_LEVEL_INF); #include #include -#if CONFIG_NRFX_TWIS1 -#define I2C_S_INSTANCE 1 -#elif CONFIG_NRFX_TWIS2 -#define I2C_S_INSTANCE 2 -#elif CONFIG_NRFX_TWIS22 -#define I2C_S_INSTANCE 22 -#elif CONFIG_NRFX_TWIS131 -#define I2C_S_INSTANCE 131 -#else +#define I2C_S_INST_IDX 0 + +#define DT_DRV_COMPAT nordic_nrf_twis +#if !DT_NODE_HAS_STATUS_OKAY(DT_DRV_INST(I2C_S_INST_IDX)) #error "TWIS instance not enabled or not supported" #endif @@ -49,7 +44,9 @@ static uint8_t i2c_twim_buffer[DATA_FIELD_LEN]; static uint8_t previous_data[DATA_FIELD_LEN]; #else /* ROLE */ -static const nrfx_twis_t twis = NRFX_TWIS_INSTANCE(I2C_S_INSTANCE); +static nrfx_twis_t twis = { + .p_reg = (NRF_TWIS_Type *)DT_INST_REG_ADDR(I2C_S_INST_IDX) +}; static uint8_t i2c_twis_buffer[DATA_FIELD_LEN] TWIS_MEMORY_SECTION; static uint8_t previous; @@ -94,7 +91,7 @@ void twis_verify_data(void) counter++; } -void i2s_slave_handler(nrfx_twis_evt_t const *p_event) +void i2s_slave_handler(nrfx_twis_event_t const *p_event) { switch (p_event->type) { case NRFX_TWIS_EVT_READ_REQ: @@ -134,8 +131,8 @@ void twis_setup(void) LOG_ERR("pinctrl_apply_state() returned %d", ret); } - IRQ_CONNECT(DT_IRQN(NODE_TWIS), DT_IRQ(NODE_TWIS, priority), - NRFX_TWIS_INST_HANDLER_GET(I2C_S_INSTANCE), NULL, 0); + IRQ_CONNECT(DT_INST_IRQN(I2C_S_INST_IDX), DT_INST_IRQ(I2C_S_INST_IDX, priority), + nrfx_twis_irq_handler, &twis, 0); nrfx_twis_enable(&twis); } diff --git a/tests/zephyr/boards/nrf/i2c/i2c_slave/boards/nrf54ls05dk_nrf54ls05b_cpuapp.conf b/tests/zephyr/boards/nrf/i2c/i2c_slave/boards/nrf54ls05dk_nrf54ls05b_cpuapp.conf deleted file mode 100644 index b01af3b36a7..00000000000 --- a/tests/zephyr/boards/nrf/i2c/i2c_slave/boards/nrf54ls05dk_nrf54ls05b_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_NRFX_TWIS22=y diff --git a/tests/zephyr/boards/nrf/i2c/i2c_slave/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf b/tests/zephyr/boards/nrf/i2c/i2c_slave/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf deleted file mode 100644 index 0e2680a7f26..00000000000 --- a/tests/zephyr/boards/nrf/i2c/i2c_slave/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_NRFX_TWIS21=y diff --git a/tests/zephyr/boards/nrf/i2c/i2c_slave/boards/nrf54lv10dk_nrf54lv10a_cpuapp_ns.conf b/tests/zephyr/boards/nrf/i2c/i2c_slave/boards/nrf54lv10dk_nrf54lv10a_cpuapp_ns.conf index 2754c3dd5e2..ad133879254 100644 --- a/tests/zephyr/boards/nrf/i2c/i2c_slave/boards/nrf54lv10dk_nrf54lv10a_cpuapp_ns.conf +++ b/tests/zephyr/boards/nrf/i2c/i2c_slave/boards/nrf54lv10dk_nrf54lv10a_cpuapp_ns.conf @@ -1,2 +1 @@ -CONFIG_NRFX_TWIS21=y CONFIG_TFM_LOG_LEVEL_SILENCE=y diff --git a/tests/zephyr/boards/nrf/i2c/i2c_slave/boards/nrf7120pdk_nrf7120_cpuapp.conf b/tests/zephyr/boards/nrf/i2c/i2c_slave/boards/nrf7120pdk_nrf7120_cpuapp.conf deleted file mode 100644 index b01af3b36a7..00000000000 --- a/tests/zephyr/boards/nrf/i2c/i2c_slave/boards/nrf7120pdk_nrf7120_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_NRFX_TWIS22=y diff --git a/tests/zephyr/boards/nrf/i2c/i2c_slave/prj.conf b/tests/zephyr/boards/nrf/i2c/i2c_slave/prj.conf index 4b19609ecfb..e96142fe744 100644 --- a/tests/zephyr/boards/nrf/i2c/i2c_slave/prj.conf +++ b/tests/zephyr/boards/nrf/i2c/i2c_slave/prj.conf @@ -1,2 +1,3 @@ CONFIG_I2C=y CONFIG_ZTEST=y +CONFIG_NRFX_TWIS=y From ae0a58ad0dd4f2566f41576e29a22eff5cef07aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Mon, 27 Oct 2025 14:32:53 +0100 Subject: [PATCH 31/72] soc: nrf54ls05b: add config indicating MPU presense MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MPU is not present on nRF54LS05B. Signed-off-by: Michał Stasiak --- soc/nordic/nrf54l/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/soc/nordic/nrf54l/Kconfig b/soc/nordic/nrf54l/Kconfig index c0167a6b38a..97e2e297f5f 100644 --- a/soc/nordic/nrf54l/Kconfig +++ b/soc/nordic/nrf54l/Kconfig @@ -16,3 +16,4 @@ config SOC_NRF54LV10A_ENGA_CPUFLPR config SOC_NRF54LS05B_ENGA_CPUAPP select SOC_NRF54L_CPUAPP_COMMON + select CPU_HAS_ARM_MPU From 6a46d45735174e41ee47f4c8e8e2f535f97829f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Tue, 28 Oct 2025 08:23:50 +0100 Subject: [PATCH 32/72] mpsl: hwres: dppi: Align to use NRFX_GPPI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nrfx_dppi is deprecated and gppi shall be used. Signed-off-by: Krzysztof Chruściński --- subsys/mpsl/hwres/mpsl_hwres.c | 82 +++++++++++++++------------------- 1 file changed, 37 insertions(+), 45 deletions(-) diff --git a/subsys/mpsl/hwres/mpsl_hwres.c b/subsys/mpsl/hwres/mpsl_hwres.c index dd8486ec52e..c86d955a95b 100644 --- a/subsys/mpsl/hwres/mpsl_hwres.c +++ b/subsys/mpsl/hwres/mpsl_hwres.c @@ -5,25 +5,26 @@ */ #include -#if defined(DPPI_PRESENT) -#include -#endif -#if defined(LUMOS_XXAA) -#include -#endif - -#if defined(DPPI_PRESENT) +#include -bool mpsl_hwres_dppi_channel_alloc(NRF_DPPIC_Type *p_dppic, uint8_t *p_dppi_ch) +#if defined(DPPI_PRESENT) || defined(LUMOS_XXAA) +static bool mpsl_hwres_channel_alloc(uint32_t node_id, uint8_t *p_ch) { - nrfx_dppi_t dppi = {0}; - nrfx_err_t err = nrfx_dppi_periph_get((uintptr_t)p_dppic, &dppi); + int ch = nrfx_gppi_channel_alloc(node_id, NULL); - if (err != NRFX_SUCCESS) { + if (ch < 0) { return false; } + *p_ch = (uint8_t)ch; + return true; +} +#endif - return (nrfx_dppi_channel_alloc(&dppi, p_dppi_ch) == NRFX_SUCCESS); +#if defined(DPPI_PRESENT) + +bool mpsl_hwres_dppi_channel_alloc(NRF_DPPIC_Type *p_dppic, uint8_t *p_dppi_ch) +{ + return mpsl_hwres_channel_alloc(nrfx_gppi_domain_id_get((uint32_t)p_dppic), p_dppi_ch); } #endif /* DPPI_PRESENT */ @@ -31,46 +32,37 @@ bool mpsl_hwres_dppi_channel_alloc(NRF_DPPIC_Type *p_dppic, uint8_t *p_dppi_ch) #if defined(PPIB_PRESENT) #if defined(LUMOS_XXAA) -static const nrfx_ppib_interconnect_t *nrfx_ppib_interconnect_find_by_ptr(NRF_PPIB_Type *p_ppib) +#include +static uint32_t ppib_get_domain(NRF_PPIB_Type *p_ppib) { - static const nrfx_ppib_interconnect_t interconnects[] = { -#if NRFX_CHECK(NRFX_PPIB00_ENABLED) && NRFX_CHECK(NRFX_PPIB10_ENABLED) - NRFX_PPIB_INTERCONNECT_INSTANCE(00, 10), -#endif -#if NRFX_CHECK(NRFX_PPIB11_ENABLED) && NRFX_CHECK(NRFX_PPIB21_ENABLED) - NRFX_PPIB_INTERCONNECT_INSTANCE(11, 21), -#endif -#if NRFX_CHECK(NRFX_PPIB22_ENABLED) && NRFX_CHECK(NRFX_PPIB30_ENABLED) - NRFX_PPIB_INTERCONNECT_INSTANCE(22, 30), -#endif -#if NRFX_CHECK(NRFX_PPIB01_ENABLED) && NRFX_CHECK(NRFX_PPIB20_ENABLED) - NRFX_PPIB_INTERCONNECT_INSTANCE(01, 20), -#endif - }; - - for (size_t i = 0U; i < NRFX_ARRAY_SIZE(interconnects); ++i) { - const nrfx_ppib_interconnect_t *ith = &interconnects[i]; - - if ((ith->left.p_reg == p_ppib) || (ith->right.p_reg == p_ppib)) { - return ith; - } + switch ((uint32_t)p_ppib) { + case (uint32_t)NRF_PPIB00: + /* fall through */ + case (uint32_t)NRF_PPIB10: + return NRFX_GPPI_NODE_PPIB00_10; + case (uint32_t)NRF_PPIB11: + /* fall through */ + case (uint32_t)NRF_PPIB21: + return NRFX_GPPI_NODE_PPIB11_21; + case (uint32_t)NRF_PPIB01: + /* fall through */ + case (uint32_t)NRF_PPIB20: + return NRFX_GPPI_NODE_PPIB01_20; + case (uint32_t)NRF_PPIB22: + /* fall through */ + case (uint32_t)NRF_PPIB30: + return NRFX_GPPI_NODE_PPIB22_30; + default: + __ASSERT_NO_MSG("Unexpected PPIB"); + return 0; } - - return NULL; } #endif bool mpsl_hwres_ppib_channel_alloc(NRF_PPIB_Type *p_ppib, uint8_t *p_ppib_ch) { #if defined(LUMOS_XXAA) - const nrfx_ppib_interconnect_t *ppib_interconnect = - nrfx_ppib_interconnect_find_by_ptr(p_ppib); - - if (ppib_interconnect == NULL) { - return false; - } - - return (nrfx_ppib_channel_alloc(ppib_interconnect, p_ppib_ch) == NRFX_SUCCESS); + return mpsl_hwres_channel_alloc(ppib_get_domain(p_ppib), p_ppib_ch); #else (void)p_ppib; (void)p_ppib_ch; From 8e8579a5e53678271373576b8d7b7ddb7cd8072e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Tue, 28 Oct 2025 09:10:23 +0100 Subject: [PATCH 33/72] lib: fem_al: Use GPPI instead of nrfx_dppi MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nrfx_dppi is deprecated. Use GPPI helper instead. Signed-off-by: Krzysztof Chruściński --- lib/fem_al/fem_al.c | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/lib/fem_al/fem_al.c b/lib/fem_al/fem_al.c index 719430348be..b12882f81be 100644 --- a/lib/fem_al/fem_al.c +++ b/lib/fem_al/fem_al.c @@ -10,7 +10,7 @@ #include #include #ifdef DPPI_PRESENT -#include +#include #endif #include @@ -29,9 +29,9 @@ #ifdef DPPI_PRESENT #if defined(NRF53_SERIES) -#define RADIO_DOMAIN_NRFX_DPPI_INSTANCE NRFX_DPPI_INSTANCE(0) +#define RADIO_DOMAIN_NRF_DPPI (uint32_t)NRF_DPPIC #elif defined(NRF54L_SERIES) -#define RADIO_DOMAIN_NRFX_DPPI_INSTANCE NRFX_DPPI_INSTANCE(10) +#define RADIO_DOMAIN_NRF_DPPI (uint32_t)NRF_DPPIC10 #else #error Unsupported SoC type. #endif @@ -357,25 +357,23 @@ int8_t fem_default_tx_output_power_get(void) } #if defined(DPPI_PRESENT) -static nrfx_err_t radio_domain_nrfx_dppi_channel_alloc(uint8_t *channel) +static int radio_domain_nrfx_dppi_channel_alloc(uint8_t *channel) { - nrfx_err_t err; - nrfx_dppi_t radio_domain_nrfx_dppi = RADIO_DOMAIN_NRFX_DPPI_INSTANCE; + int ch; - err = nrfx_dppi_channel_alloc(&radio_domain_nrfx_dppi, channel); + ch = nrfx_gppi_channel_alloc(nrfx_gppi_domain_id_get(RADIO_DOMAIN_NRF_DPPI), channel); + if (ch < 0) { + return ch; + } + + *channel = (uint8_t)ch; - return err; + return 0; } static void radio_domain_nrfx_dppi_channel_enable(uint8_t channel) { - nrfx_err_t err; - nrfx_dppi_t radio_domain_nrfx_dppi = RADIO_DOMAIN_NRFX_DPPI_INSTANCE; - - err = nrfx_dppi_channel_enable(&radio_domain_nrfx_dppi, channel); - - __ASSERT_NO_MSG(err == NRFX_SUCCESS); - (void)err; + nrfx_gppi_channels_enable(nrfx_gppi_domain_id_get(RADIO_DOMAIN_NRF_DPPI), BIT(channel)); } #endif @@ -389,11 +387,11 @@ int fem_init(NRF_TIMER_Type *timer_instance, uint8_t compare_channel_mask) fem_activate_event.event.timer.compare_channel_mask = compare_channel_mask; #if defined(DPPI_PRESENT) - nrfx_err_t err; + int err; uint8_t fem_dppi_ch; err = radio_domain_nrfx_dppi_channel_alloc(&fem_dppi_ch); - if (err != NRFX_SUCCESS) { + if (err < 0) { printk("radio_domain_nrfx_dppi_channel_alloc failed with: %d\n", err); return -ENODEV; } From af2129aef0f287eec5e61f64649f183291aa6a7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Tue, 28 Oct 2025 11:57:46 +0100 Subject: [PATCH 34/72] debug: ppi_trace: Adapt to use new GPPI API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adapt module to use GPPI API. Signed-off-by: Krzysztof Chruściński --- include/debug/ppi_trace.h | 9 +- subsys/debug/ppi_trace/Kconfig | 10 +- subsys/debug/ppi_trace/ppi_trace.c | 199 +++++++++-------------------- 3 files changed, 67 insertions(+), 151 deletions(-) diff --git a/include/debug/ppi_trace.h b/include/debug/ppi_trace.h index 561c83cf18c..33e0c688478 100644 --- a/include/debug/ppi_trace.h +++ b/include/debug/ppi_trace.h @@ -10,10 +10,6 @@ #include #include -#if defined(DPPI_PRESENT) -#include -#endif - #ifdef __cplusplus extern "C" { #endif @@ -67,14 +63,13 @@ void *ppi_trace_pair_config(uint32_t pin, uint32_t start_evt, uint32_t stop_evt) * * @param pin Pin to use for tracing. * @param dppi_ch DPPI channel number to be traced on the pin. - * @param dppic Identifies the instance of DPPIC controller that the @c dppi_ch channel - * belongs to. + * @param p_dppi Instance of the DPPIC controller that the @c dppi_ch channel belongs to. * * @retval 0 The configuration succeeded. * @retval -ENOMEM The configuration failed, due to lack of necessary resources. * @retval -ENOTSUP The function is not supported on current hardware platform. */ -int ppi_trace_dppi_ch_trace(uint32_t pin, uint32_t dppi_ch, const nrfx_dppi_t *dppic); +int ppi_trace_dppi_ch_trace(uint32_t pin, uint32_t dppi_ch, NRF_DPPIC_Type *p_dppi); #endif /* DPPI_PRESENT */ diff --git a/subsys/debug/ppi_trace/Kconfig b/subsys/debug/ppi_trace/Kconfig index 5e601063073..e25ff0176ec 100644 --- a/subsys/debug/ppi_trace/Kconfig +++ b/subsys/debug/ppi_trace/Kconfig @@ -8,16 +8,14 @@ config PPI_TRACE bool "PPI trace" select NRFX_GPIOTE select NRFX_GPPI - select NRFX_PPI if HAS_HW_NRF_PPI - select NRFX_DPPI0 if SOC_SERIES_NRF53X - select NRFX_DPPI00 if SOC_SERIES_NRF54LX || SOC_SERIES_NRF71X - select NRFX_DPPI10 if SOC_SERIES_NRF54LX || SOC_SERIES_NRF71X - select NRFX_DPPI20 if SOC_SERIES_NRF54LX || SOC_SERIES_NRF71X - select NRFX_DPPI30 if SOC_SERIES_NRF54LX || SOC_SERIES_NRF71X help Enable PPI trace module which enables forwarding hardware events to GPIOs. +config PPI_TRACE_PIN_CNT + int "Maximum number of trace pins" + default 8 + if PPI_TRACE module = PPI_TRACE module-str = PPI trace diff --git a/subsys/debug/ppi_trace/ppi_trace.c b/subsys/debug/ppi_trace/ppi_trace.c index 56fbf3307bf..05d2c3c7146 100644 --- a/subsys/debug/ppi_trace/ppi_trace.c +++ b/subsys/debug/ppi_trace/ppi_trace.c @@ -6,9 +6,6 @@ #include #include -#ifdef DPPI_PRESENT -#include -#endif #include #include @@ -16,30 +13,6 @@ LOG_MODULE_REGISTER(ppi_trace, CONFIG_PPI_TRACE_LOG_LEVEL); -/* Handle which is used by the user to enable and disable the trace pin is - * encapsulating ppi channel(s). Bit 31 is set to indicate that handle is - * valid. Bit 30 is set to indicate that handle contains pair of PPI channels. - * - * Handle structure: - * ---------------------------------------------------------------- - * |handle_flag|pair_flag| not used | stop_ch | start_ch/main_ch | - * |-----------|---------|-----------|---------|------------------| - * | 31 | 30 | 29-16 | 15 - 8 | 7-0 | - * ---------------------------------------------------------------- - */ -#define HANDLE_FLAG BIT(31) -#define PAIR_FLAG BIT(30) - -#define HANDLE_ENCODE(value) (void *)((uint32_t)value | HANDLE_FLAG) -#define PACK_CHANNELS(start_ch, stop_ch) (PAIR_FLAG | start_ch | (stop_ch << 8)) - -#define IS_VALID_HANDLE(handle) ((uint32_t)handle & HANDLE_FLAG) -#define IS_PAIR(handle) ((uint32_t)handle & PAIR_FLAG) - -#define GET_CH(handle) ((uint32_t)handle & 0xFF) -#define GET_START_CH(handle) GET_CH(handle) -#define GET_STOP_CH(handle) (((uint32_t)handle >> 8) & 0xFF) - #define GPIOTE_NODE(gpio_node) DT_PHANDLE(gpio_node, gpiote_instance) #define INVALID_NRFX_GPIOTE_INSTANCE \ { .p_reg = NULL } @@ -54,6 +27,9 @@ typedef struct { uint8_t gpiote_channel; } ppi_trace_gpiote_pin_t; +static atomic_t alloc_cnt; +static uint32_t handle_pool[CONFIG_PPI_TRACE_PIN_CNT]; + static const nrfx_gpiote_t *get_gpiote(nrfx_gpiote_pin_t pin) { static const nrfx_gpiote_t gpiote[GPIO_COUNT] = { @@ -98,54 +74,48 @@ static bool ppi_trace_gpiote_pin_init( void *ppi_trace_config(uint32_t pin, uint32_t evt) { - uint8_t gppi_ch = UINT8_MAX; + uint32_t idx = atomic_inc(&alloc_cnt); + nrfx_gppi_handle_t *handle = (nrfx_gppi_handle_t *)&handle_pool[idx]; + ppi_trace_gpiote_pin_t ppi_trace_gpiote_pin = {}; - if (NRFX_SUCCESS != nrfx_gppi_channel_alloc(&gppi_ch)) { - LOG_ERR("Failed to allocate GPPI channel."); + /* All slots taken. */ + if (alloc_cnt > CONFIG_PPI_TRACE_PIN_CNT) { return NULL; } - ppi_trace_gpiote_pin_t ppi_trace_gpiote_pin = {}; - if (!ppi_trace_gpiote_pin_init(&ppi_trace_gpiote_pin, pin)) { - nrfx_gppi_channel_free(gppi_ch); return NULL; } uint32_t tep = nrf_gpiote_task_address_get(ppi_trace_gpiote_pin.gpiote->p_reg, nrf_gpiote_out_task_get(ppi_trace_gpiote_pin.gpiote_channel)); - nrfx_gppi_channel_endpoints_setup(gppi_ch, evt, tep); - return HANDLE_ENCODE(gppi_ch); + if (nrfx_gppi_conn_alloc(evt, tep, handle) < 0) { + LOG_ERR("Failed to allocate GPPI channel."); + return NULL; + } + return handle; } void *ppi_trace_pair_config(uint32_t pin, uint32_t start_evt, uint32_t stop_evt) { + uint32_t idx = atomic_add(&alloc_cnt, 2); + nrfx_gppi_handle_t *handle1 = (nrfx_gppi_handle_t *)&handle_pool[idx]; + nrfx_gppi_handle_t *handle2 = (nrfx_gppi_handle_t *)&handle_pool[idx + 1]; + + /* All slots taken. */ + if (alloc_cnt > CONFIG_PPI_TRACE_PIN_CNT) { + return NULL; + } + #if !defined(GPIOTE_FEATURE_SET_PRESENT) || \ !defined(GPIOTE_FEATURE_CLR_PRESENT) __ASSERT(0, "Function not supported on this platform."); return NULL; #else - uint8_t gppi_ch_start_evt = UINT8_MAX; - - if (NRFX_SUCCESS != nrfx_gppi_channel_alloc(&gppi_ch_start_evt)) { - LOG_ERR("Failed to allocate GPPI channel."); - return NULL; - } - - uint8_t gppi_ch_stop_evt = UINT8_MAX; - - if (NRFX_SUCCESS != nrfx_gppi_channel_alloc(&gppi_ch_stop_evt)) { - LOG_ERR("Failed to allocate GPPI channel."); - nrfx_gppi_channel_free(gppi_ch_start_evt); - return NULL; - } - ppi_trace_gpiote_pin_t ppi_trace_gpiote_pin = {}; if (!ppi_trace_gpiote_pin_init(&ppi_trace_gpiote_pin, pin)) { - nrfx_gppi_channel_free(gppi_ch_stop_evt); - nrfx_gppi_channel_free(gppi_ch_start_evt); return NULL; } @@ -153,119 +123,72 @@ void *ppi_trace_pair_config(uint32_t pin, uint32_t start_evt, uint32_t stop_evt) tep = nrf_gpiote_task_address_get(ppi_trace_gpiote_pin.gpiote->p_reg, nrf_gpiote_set_task_get(ppi_trace_gpiote_pin.gpiote_channel)); - nrfx_gppi_channel_endpoints_setup(gppi_ch_start_evt, start_evt, tep); + if (nrfx_gppi_conn_alloc(start_evt, tep, handle1) < 0) { + LOG_ERR("Failed to allocate GPPI channel."); + return NULL; + } tep = nrf_gpiote_task_address_get(ppi_trace_gpiote_pin.gpiote->p_reg, nrf_gpiote_clr_task_get(ppi_trace_gpiote_pin.gpiote_channel)); - nrfx_gppi_channel_endpoints_setup(gppi_ch_stop_evt, stop_evt, tep); - - return HANDLE_ENCODE(PACK_CHANNELS(gppi_ch_start_evt, gppi_ch_stop_evt)); -#endif -} - -#if defined(DPPI_PRESENT) - -static const nrfx_dppi_t *get_dppic_for_gpiote(const nrfx_gpiote_t *gpiote) -{ - /* The Device Tree does not provide information about the DPPIC controller for which - * the given GPIOTE instance can subscribe to. That's why we need to provide the - * matching DPPIC instance ourselves. - */ - -#if (!defined(DPPIC_COUNT) || (DPPIC_COUNT == 1)) - static const nrfx_dppi_t dppic = NRFX_DPPI_INSTANCE(0); - - return &dppic; -#elif defined(CONFIG_SOC_SERIES_NRF54LX) - if (gpiote->p_reg == NRF_GPIOTE20) { - static const nrfx_dppi_t dppic20 = NRFX_DPPI_INSTANCE(20); - - return &dppic20; - } else if (gpiote->p_reg == NRF_GPIOTE30) { - static const nrfx_dppi_t dppic30 = NRFX_DPPI_INSTANCE(30); - - return &dppic30; - } else { + if (nrfx_gppi_conn_alloc(stop_evt, tep, handle2) < 0) { + LOG_ERR("Failed to allocate GPPI channel."); return NULL; } -#else -#error Unsupported SoC series - return NULL; + + /* Address to aligned 32 bit variable will always have 0 on last two bits. Last bit is + * used to indicated that it is a pair. + */ + return (void *)((uintptr_t)handle1 | 0x1); #endif } -int ppi_trace_dppi_ch_trace(uint32_t pin, uint32_t dppi_ch, const nrfx_dppi_t *dppic) +#if defined(DPPI_PRESENT) +int ppi_trace_dppi_ch_trace(uint32_t pin, uint32_t dppi_ch, NRF_DPPIC_Type *p_dppi) { + nrfx_gppi_handle_t handle = 0; ppi_trace_gpiote_pin_t ppi_trace_gpiote_pin = {}; if (!ppi_trace_gpiote_pin_init(&ppi_trace_gpiote_pin, pin)) { return -ENOMEM; } - const nrfx_dppi_t *dppic_for_gpiote = get_dppic_for_gpiote(ppi_trace_gpiote_pin.gpiote); + uint32_t tep = nrf_gpiote_task_address_get(ppi_trace_gpiote_pin.gpiote->p_reg, + nrf_gpiote_out_task_get(ppi_trace_gpiote_pin.gpiote_channel)); + uint32_t dst_domain = nrfx_gppi_domain_id_get((uint32_t)ppi_trace_gpiote_pin.gpiote->p_reg); + nrfx_gppi_resource_t resource = { + .domain_id = nrfx_gppi_domain_id_get((uint32_t)p_dppi), + .channel = dppi_ch + }; - if (dppic_for_gpiote == NULL) { - LOG_ERR("For given GPIO pin, the GPIOTE has no associated DPPIC."); + if (nrfx_gppi_ext_conn_alloc(resource.domain_id, dst_domain, &handle, &resource) < 0) { + LOG_ERR("Failed to allocate GPPI channel."); return -ENOMEM; } + nrfx_gppi_ep_attach(tep, handle); + nrfx_gppi_conn_enable(handle); - if (dppic_for_gpiote->p_reg == dppic->p_reg) { - /* The GPIOTE can directly subscribe to DPPI channels of `dppic` */ - nrf_gpiote_subscribe_set(ppi_trace_gpiote_pin.gpiote->p_reg, - nrf_gpiote_out_task_get(ppi_trace_gpiote_pin.gpiote_channel), - dppi_ch); - } else { - /* Let the GPIOTE channel subscribe to a local dppi_channel_for_gpiote of - * ppi_trace_gpiote_pin.dppic first. - */ - uint8_t dppi_channel_for_gpiote = UINT8_MAX; - - if (nrfx_dppi_channel_alloc(dppic_for_gpiote, - &dppi_channel_for_gpiote) != NRFX_SUCCESS) { - return -ENOMEM; - } - - nrf_gpiote_subscribe_set(ppi_trace_gpiote_pin.gpiote->p_reg, - nrf_gpiote_out_task_get(ppi_trace_gpiote_pin.gpiote_channel), - dppi_channel_for_gpiote); - - (void)nrfx_dppi_channel_enable(dppic_for_gpiote, dppi_channel_for_gpiote); - - /* Then, let the dppi_ch channel of dppic controller passed by parameters - * trigger the local dppi_channel_for_gpiote. - */ - uint8_t gppi_ch = UINT8_MAX; - - if (NRFX_SUCCESS != nrfx_gppi_channel_alloc(&gppi_ch)) { - LOG_ERR("Failed to allocate GPPI channel."); - return -ENOMEM; - } - - if (NRFX_SUCCESS != nrfx_gppi_edge_connection_setup(gppi_ch, - dppic, dppi_ch, dppic_for_gpiote, dppi_channel_for_gpiote)) { - LOG_ERR("Failed to setup a GPPI edge connection."); - return -ENOMEM; - } - - nrfx_gppi_channels_enable(1U << gppi_ch); - } return 0; } #endif /* defined(DPPI_PRESENT) */ -static uint32_t ppi_channel_mask_get(void *handle) -{ - return IS_PAIR(handle) ? - BIT(GET_START_CH(handle)) | BIT(GET_STOP_CH(handle)) : - BIT(GET_CH(handle)); -} - void ppi_trace_enable(void *handle) { - nrfx_gppi_channels_enable(ppi_channel_mask_get(handle)); + nrfx_gppi_handle_t *handles = (nrfx_gppi_handle_t *)((uintptr_t)handle & 0x1); + + nrfx_gppi_conn_enable(handles[0]); + /* If LSB bit is set it indicates that handle is for pair of connections. */ + if ((uintptr_t)handle & 0x1) { + nrfx_gppi_conn_enable(handles[1]); + } } void ppi_trace_disable(void *handle) { - nrfx_gppi_channels_disable(ppi_channel_mask_get(handle)); + nrfx_gppi_handle_t *handles = (nrfx_gppi_handle_t *)((uintptr_t)handle & 0x1); + + nrfx_gppi_conn_disable(handles[0]); + /* If LSB bit is set it indicates that handle is for pair of connections. */ + if ((uintptr_t)handle & 0x1) { + nrfx_gppi_conn_disable(handles[1]); + } } From 6fd26869548cdb50af66f4233a2cb5274d1fd87f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Tue, 28 Oct 2025 12:38:56 +0100 Subject: [PATCH 35/72] mpsl: fem: Adapt to use GPPI API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use GPPI API instead of nrfx_ppi or nrfx_dppi. Signed-off-by: Krzysztof Chruściński --- subsys/mpsl/fem/Kconfig | 31 +++------------------- subsys/mpsl/fem/common/mpsl_fem_utils.c | 25 +++++++---------- subsys/mpsl/fem/nrf2220/mpsl_fem_nrf2220.c | 6 ----- subsys/mpsl/fem/nrf2240/mpsl_fem_nrf2240.c | 6 ----- 4 files changed, 12 insertions(+), 56 deletions(-) diff --git a/subsys/mpsl/fem/Kconfig b/subsys/mpsl/fem/Kconfig index de5134abb9b..95e173b87a5 100644 --- a/subsys/mpsl/fem/Kconfig +++ b/subsys/mpsl/fem/Kconfig @@ -80,13 +80,7 @@ config MPSL_FEM_NRF21540_GPIO select NRFX_GPIOTE select GPIO if ($(dt_nodelabel_has_prop,nrf_radio_fem,mode-gpios) || \ $(dt_nodelabel_has_prop,nrf_radio_fem,ant-sel-gpios)) - select NRFX_PPI if HAS_HW_NRF_PPI - select NRFX_DPPI if HAS_HW_NRF_DPPIC select NRFX_GPPI - select NRFX_DPPI10 if SOC_SERIES_NRF54LX - select NRFX_DPPI20 if SOC_SERIES_NRF54LX - select NRFX_PPIB11 if SOC_SERIES_NRF54LX - select NRFX_PPIB21 if SOC_SERIES_NRF54LX select MPSL_FEM_NCS_SUPPORTED_FEM_USED bool "nRF21540 front-end module in GPIO mode" help @@ -97,13 +91,7 @@ config MPSL_FEM_NRF21540_GPIO_SPI select NRFX_GPIOTE select GPIO if ($(dt_nodelabel_has_prop,nrf_radio_fem,mode-gpios) || \ $(dt_nodelabel_has_prop,nrf_radio_fem,ant-sel-gpios)) - select NRFX_PPI if HAS_HW_NRF_PPI - select NRFX_DPPI if HAS_HW_NRF_DPPIC select NRFX_GPPI - select NRFX_DPPI10 if SOC_SERIES_NRF54LX - select NRFX_DPPI20 if SOC_SERIES_NRF54LX - select NRFX_PPIB11 if SOC_SERIES_NRF54LX - select NRFX_PPIB21 if SOC_SERIES_NRF54LX select PINCTRL select MPSL_FEM_NCS_SUPPORTED_FEM_USED imply MPSL_FEM_POWER_MODEL if MPSL_FEM # Don't force the model, but make it a default @@ -114,8 +102,7 @@ config MPSL_FEM_NRF21540_GPIO_SPI config MPSL_FEM_SIMPLE_GPIO depends on MPSL_FEM_GENERIC_TWO_CTRL_PINS_SUPPORT select NRFX_GPIOTE - select NRFX_PPI if HAS_HW_NRF_PPI - select NRFX_DPPI if HAS_HW_NRF_DPPIC + select NRFX_GPPI select MPSL_FEM_NCS_SUPPORTED_FEM_USED bool "Generic front-end module with two-pin control" help @@ -127,13 +114,7 @@ config MPSL_FEM_SIMPLE_GPIO config MPSL_FEM_NRF2220 depends on MPSL_FEM_NRF2220_SUPPORT select NRFX_GPIOTE - select NRFX_PPI if SOC_SERIES_NRF52X - select NRFX_DPPI0 if SOC_SERIES_NRF53X - select NRFX_GPPI if SOC_SERIES_NRF54LX - select NRFX_DPPI10 if SOC_SERIES_NRF54LX - select NRFX_DPPI20 if SOC_SERIES_NRF54LX - select NRFX_PPIB11 if SOC_SERIES_NRF54LX - select NRFX_PPIB21 if SOC_SERIES_NRF54LX + select NRFX_GPPI select PINCTRL select MPSL_FEM_NCS_SUPPORTED_FEM_USED bool "nRF2220 front-end module" @@ -144,13 +125,7 @@ config MPSL_FEM_NRF2240 depends on MPSL_FEM_NRF2240_SUPPORT select EXPERIMENTAL select NRFX_GPIOTE - select NRFX_PPI if SOC_SERIES_NRF52X - select NRFX_DPPI0 if SOC_SERIES_NRF53X - select NRFX_GPPI if SOC_SERIES_NRF54LX - select NRFX_DPPI10 if SOC_SERIES_NRF54LX - select NRFX_DPPI20 if SOC_SERIES_NRF54LX - select NRFX_PPIB11 if SOC_SERIES_NRF54LX - select NRFX_PPIB21 if SOC_SERIES_NRF54LX + select NRFX_GPPI select PINCTRL select MPSL_FEM_NCS_SUPPORTED_FEM_USED bool "nRF2240 front-end module" diff --git a/subsys/mpsl/fem/common/mpsl_fem_utils.c b/subsys/mpsl/fem/common/mpsl_fem_utils.c index 09a7daf75aa..5773fd0da22 100644 --- a/subsys/mpsl/fem/common/mpsl_fem_utils.c +++ b/subsys/mpsl/fem/common/mpsl_fem_utils.c @@ -7,31 +7,24 @@ #include #include #include -#if IS_ENABLED(CONFIG_HAS_HW_NRF_DPPIC) -#include -#endif int mpsl_fem_utils_ppi_channel_alloc(uint8_t *ppi_channels, size_t size) { - nrfx_err_t err = NRFX_ERROR_NOT_SUPPORTED; -#ifdef DPPI_PRESENT -#if defined(NRF53_SERIES) - nrfx_dppi_t dppi = NRFX_DPPI_INSTANCE(0); -#elif defined(NRF54L_SERIES) - nrfx_dppi_t dppi = NRFX_DPPI_INSTANCE(10); + int ch; +#if defined(NRF54L_SERIES) + uint32_t domain_id = nrfx_gppi_domain_id_get((uint32_t)NRF_DPPIC10); +#elif defined(NRF53_SERIES) || defined(PPI_PRESENT) + uint32_t domain_id = 0; #else #error Unsupported SoC series -#endif #endif for (int i = 0; i < size; i++) { - IF_ENABLED(CONFIG_HAS_HW_NRF_PPI, - (err = nrfx_gppi_channel_alloc(&ppi_channels[i]);)); - IF_ENABLED(CONFIG_HAS_HW_NRF_DPPIC, - (err = nrfx_dppi_channel_alloc(&dppi, &ppi_channels[i]);)); - if (err != NRFX_SUCCESS) { - return -ENOMEM; + ch = nrfx_gppi_channel_alloc(domain_id, NULL); + if (ch < 0) { + return ch; } + ppi_channels[i] = (uint8_t)ch; } return 0; diff --git a/subsys/mpsl/fem/nrf2220/mpsl_fem_nrf2220.c b/subsys/mpsl/fem/nrf2220/mpsl_fem_nrf2220.c index 998ac77e120..00f213a5eb7 100644 --- a/subsys/mpsl/fem/nrf2220/mpsl_fem_nrf2220.c +++ b/subsys/mpsl/fem/nrf2220/mpsl_fem_nrf2220.c @@ -18,12 +18,6 @@ #include #include -#if IS_ENABLED(CONFIG_HAS_HW_NRF_PPI) -#include -#elif IS_ENABLED(CONFIG_HAS_HW_NRF_DPPIC) -#include -#endif - #include #if IS_ENABLED(CONFIG_PINCTRL) diff --git a/subsys/mpsl/fem/nrf2240/mpsl_fem_nrf2240.c b/subsys/mpsl/fem/nrf2240/mpsl_fem_nrf2240.c index 335344d70ab..79a2eefd6ea 100644 --- a/subsys/mpsl/fem/nrf2240/mpsl_fem_nrf2240.c +++ b/subsys/mpsl/fem/nrf2240/mpsl_fem_nrf2240.c @@ -18,12 +18,6 @@ #include #include -#if IS_ENABLED(CONFIG_HAS_HW_NRF_PPI) -#include -#elif IS_ENABLED(CONFIG_HAS_HW_NRF_DPPIC) -#include -#endif - #include #if IS_ENABLED(CONFIG_PINCTRL) From f420ddfe73e875fb908337fcb2b6dc283c63ea08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Tue, 28 Oct 2025 13:15:27 +0100 Subject: [PATCH 36/72] mpsl: pin_debug: Adapt to use GPPI API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nrfx_ppi and nrfx_dppi are deprecated and GPPI must be used. Align to the new GPPI API. Signed-off-by: Krzysztof Chruściński --- subsys/mpsl/pin_debug/Kconfig | 3 - subsys/mpsl/pin_debug/mpsl_pin_debug_nrf54.c | 175 ++++-------------- .../pin_debug/mpsl_pin_debug_radio_core.c | 120 ++++-------- 3 files changed, 64 insertions(+), 234 deletions(-) diff --git a/subsys/mpsl/pin_debug/Kconfig b/subsys/mpsl/pin_debug/Kconfig index 9e38c66d173..2b175452140 100644 --- a/subsys/mpsl/pin_debug/Kconfig +++ b/subsys/mpsl/pin_debug/Kconfig @@ -29,8 +29,6 @@ config MPSL_PIN_DEBUG_RADIO_CORE depends on MPSL_PIN_DEBUG select NRFX_GPIOTE select NRFX_GPPI - select NRFX_PPI if HAS_HW_NRF_PPI - select NRFX_DPPI if HAS_HW_NRF_DPPIC default y if (SOC_COMPATIBLE_NRF52X || SOC_COMPATIBLE_NRF5340_CPUNET) config MPSL_PIN_DEBUG_54X_APP_OR_RADIO_CORE @@ -38,7 +36,6 @@ config MPSL_PIN_DEBUG_54X_APP_OR_RADIO_CORE depends on MPSL_PIN_DEBUG select NRFX_GPIOTE select NRFX_GPPI - select NRFX_DPPI default y if SOC_COMPATIBLE_NRF54LX config MPSL_PIN_DEBUG_RADIO_READY_AND_DISABLED_PIN diff --git a/subsys/mpsl/pin_debug/mpsl_pin_debug_nrf54.c b/subsys/mpsl/pin_debug/mpsl_pin_debug_nrf54.c index ae9e0bc51ad..80ed7c7bc32 100644 --- a/subsys/mpsl/pin_debug/mpsl_pin_debug_nrf54.c +++ b/subsys/mpsl/pin_debug/mpsl_pin_debug_nrf54.c @@ -10,160 +10,47 @@ #include #include #include -#include #include #include #include const nrfx_gpiote_t gpiote = NRFX_GPIOTE_INSTANCE(20); -const nrfx_dppi_t dppi_radio_domain = NRFX_DPPI_INSTANCE(10); -const nrfx_dppi_t dppi_gpio_domain = NRFX_DPPI_INSTANCE(20); LOG_MODULE_REGISTER(mpsl_radio_pin_debug, CONFIG_MPSL_LOG_LEVEL); static int m_ppi_config(void) { - uint8_t gppi_chan_radio_ready; - uint8_t gppi_chan_radio_disabled; - uint8_t gppi_chan_radio_address; - uint8_t gppi_chan_radio_end; - - uint8_t dppi_chan_gpio_ready; - uint8_t dppi_chan_gpio_disabled; - uint8_t dppi_chan_gpio_address; - uint8_t dppi_chan_gpio_end; - - if (nrfx_gppi_channel_alloc(&gppi_chan_radio_ready) != - NRFX_SUCCESS) { - LOG_ERR("Failed allocating gppi_chan_radio_ready"); - return -ENOMEM; - } - - if (nrfx_gppi_channel_alloc(&gppi_chan_radio_disabled) != - NRFX_SUCCESS) { - LOG_ERR("Failed allocating gppi_chan_radio_disabled"); - return -ENOMEM; - } - - if (nrfx_gppi_channel_alloc(&gppi_chan_radio_address) != - NRFX_SUCCESS) { - LOG_ERR("Failed allocating gppi_chan_radio_address"); - return -ENOMEM; - } - - if (nrfx_gppi_channel_alloc(&gppi_chan_radio_end) != - NRFX_SUCCESS) { - LOG_ERR("Failed allocating gppi_chan_radio_end"); - return -ENOMEM; - } - - if (nrfx_dppi_channel_alloc(&dppi_gpio_domain, &dppi_chan_gpio_ready) != - NRFX_SUCCESS) { - LOG_ERR("Failed allocating dppi_chan_gpio_ready"); - return -ENOMEM; - } - - if (nrfx_dppi_channel_alloc(&dppi_gpio_domain, &dppi_chan_gpio_disabled) != - NRFX_SUCCESS) { - LOG_ERR("Failed allocating dppi_chan_gpio_disabled"); - return -ENOMEM; - } - - if (nrfx_dppi_channel_alloc(&dppi_gpio_domain, &dppi_chan_gpio_address) != - NRFX_SUCCESS) { - LOG_ERR("Failed allocating dppi_chan_gpio_address"); - return -ENOMEM; - } - - if (nrfx_dppi_channel_alloc(&dppi_gpio_domain, &dppi_chan_gpio_end) != - NRFX_SUCCESS) { - LOG_ERR("Failed allocating dppi_chan_gpio_end"); - return -ENOMEM; - } - - if (nrfx_gppi_edge_connection_setup(gppi_chan_radio_ready, - &dppi_radio_domain, - MPSL_DPPI_RADIO_PUBLISH_READY_CHANNEL_IDX, - &dppi_gpio_domain, - dppi_chan_gpio_ready) != NRFX_SUCCESS) { - LOG_ERR("Failed edge setup chan ready"); - return -ENOMEM; - } - - if (nrfx_gppi_edge_connection_setup(gppi_chan_radio_disabled, - &dppi_radio_domain, - MPSL_DPPI_RADIO_PUBLISH_DISABLED_CH_IDX, - &dppi_gpio_domain, - dppi_chan_gpio_disabled) != NRFX_SUCCESS) { - LOG_ERR("Failed edge setup chan disabled"); - return -ENOMEM; - } - - if (nrfx_gppi_edge_connection_setup(gppi_chan_radio_address, - &dppi_radio_domain, - MPSL_DPPI_RADIO_PUBLISH_ADDRESS_CHANNEL_IDX, - &dppi_gpio_domain, - dppi_chan_gpio_address) != NRFX_SUCCESS) { - LOG_ERR("Failed edge setup chan address"); - return -ENOMEM; - } - - /* Setup a PPI bridge between the radio domain and the domain of the GPIO pin. */ - if (nrfx_gppi_edge_connection_setup(gppi_chan_radio_address, - &dppi_radio_domain, - MPSL_DPPI_RADIO_PUBLISH_END_CHANNEL_IDX, - &dppi_gpio_domain, - dppi_chan_gpio_end) != NRFX_SUCCESS) { - LOG_ERR("Failed edge setup chan end"); - return -ENOMEM; - } - - nrf_gpiote_subscribe_set( - gpiote.p_reg, - nrfx_gpiote_set_task_address_get( - &gpiote, CONFIG_MPSL_PIN_DEBUG_RADIO_READY_AND_DISABLED_PIN), - dppi_chan_gpio_ready); - - nrf_gpiote_subscribe_set( - gpiote.p_reg, - nrfx_gpiote_clr_task_address_get( - &gpiote, CONFIG_MPSL_PIN_DEBUG_RADIO_READY_AND_DISABLED_PIN), - dppi_chan_gpio_disabled); - - nrf_gpiote_subscribe_set( - gpiote.p_reg, - nrfx_gpiote_set_task_address_get(&gpiote, - CONFIG_MPSL_PIN_DEBUG_RADIO_ADDRESS_AND_END_PIN), - dppi_chan_gpio_address); - - nrf_gpiote_subscribe_set( - gpiote.p_reg, - nrfx_gpiote_clr_task_address_get(&gpiote, - CONFIG_MPSL_PIN_DEBUG_RADIO_ADDRESS_AND_END_PIN), - dppi_chan_gpio_end); - - nrfx_gppi_channels_enable(NRFX_BIT(gppi_chan_radio_ready) | - NRFX_BIT(gppi_chan_radio_disabled) | - NRFX_BIT(gppi_chan_radio_address) | - NRFX_BIT(gppi_chan_radio_end)); - - if (nrfx_dppi_channel_enable(&dppi_gpio_domain, dppi_chan_gpio_ready) != NRFX_SUCCESS) { - LOG_ERR("Failed chan enable gpio_ready"); - return -ENOMEM; - } - - if (nrfx_dppi_channel_enable(&dppi_gpio_domain, dppi_chan_gpio_disabled) != NRFX_SUCCESS) { - LOG_ERR("Failed chan enable gpio_disabled"); - return -ENOMEM; - } - - if (nrfx_dppi_channel_enable(&dppi_gpio_domain, dppi_chan_gpio_address) != NRFX_SUCCESS) { - LOG_ERR("Failed chan enable gpio_address"); - return -ENOMEM; - } + uint32_t rad_domain = nrfx_gppi_domain_id_get(NRF_DPPIC10); + uint32_t dst_domain = nrfx_gppi_domain_id_get(gpiote.p_reg); + nrfx_gppi_resource_t rad_resource; + nrfx_gppi_handle_t handle; + uint32_t tep[4]; + int err; + static const uint32_t pub_ch[] = { + MPSL_DPPI_RADIO_PUBLISH_READY_CHANNEL_IDX, + MPSL_DPPI_RADIO_PUBLISH_DISABLED_CH_IDX, + MPSL_DPPI_RADIO_PUBLISH_ADDRESS_CHANNEL_IDX, + MPSL_DPPI_RADIO_PUBLISH_END_CHANNEL_IDX + }; - if (nrfx_dppi_channel_enable(&dppi_gpio_domain, dppi_chan_gpio_end) != NRFX_SUCCESS) { - LOG_ERR("Failed chan enable gpio_end"); - return -ENOMEM; + tep[0] = nrfx_gpiote_set_task_address_get(&gpiote, + CONFIG_MPSL_PIN_DEBUG_RADIO_READY_AND_DISABLED_PIN); + tep[1] = nrfx_gpiote_clr_task_address_get(&gpiote, + CONFIG_MPSL_PIN_DEBUG_RADIO_READY_AND_DISABLED_PIN); + tep[2] = nrfx_gpiote_set_task_address_get(&gpiote, + CONFIG_MPSL_PIN_DEBUG_RADIO_ADDRESS_AND_END_PIN); + tep[3] = nrfx_gpiote_clr_task_address_get(&gpiote, + CONFIG_MPSL_PIN_DEBUG_RADIO_ADDRESS_AND_END_PIN); + rad_resource.rad_domain = nrfx_gppi_domain_id_get(NRF_DPPIC10); + + for (size_t i = 0; i < ARRAY_SIZE(pub_ch); i++) { + rad_resource.channel = pub_ch[i]; + err = nrfx_gppi_ext_conn_alloc(rad_domain, dst_domain, &handle, &rad_resource); + if (err < 0) { + return err; + } + nrfx_gppi_ep_attach(handle, tep[i]); + /* Channel in radio domain is not enabled by this function. */ + nrfx_gppi_conn_enable(handle); } return 0; diff --git a/subsys/mpsl/pin_debug/mpsl_pin_debug_radio_core.c b/subsys/mpsl/pin_debug/mpsl_pin_debug_radio_core.c index dc7a627d93d..ff1aef1cc4c 100644 --- a/subsys/mpsl/pin_debug/mpsl_pin_debug_radio_core.c +++ b/subsys/mpsl/pin_debug/mpsl_pin_debug_radio_core.c @@ -20,96 +20,42 @@ LOG_MODULE_REGISTER(mpsl_radio_pin_debug, CONFIG_MPSL_LOG_LEVEL); static int m_ppi_config(void) { -#if defined(PPI_PRESENT) - uint8_t ppi_chan_radio_ready; - uint8_t ppi_chan_radio_address; - uint8_t ppi_chan_radio_end; - uint8_t ppi_chan_radio_disabled; - - if (nrfx_gppi_channel_alloc(&ppi_chan_radio_ready) != NRFX_SUCCESS) { - LOG_ERR("Failed allocating PPI chan"); - return -ENOMEM; - } - - if (nrfx_gppi_channel_alloc(&ppi_chan_radio_address) != NRFX_SUCCESS) { - LOG_ERR("Failed allocating PPI chan"); - return -ENOMEM; - } - - if (nrfx_gppi_channel_alloc(&ppi_chan_radio_end) != NRFX_SUCCESS) { - LOG_ERR("Failed allocating PPI chan"); - return -ENOMEM; - } - - if (nrfx_gppi_channel_alloc(&ppi_chan_radio_disabled) != NRFX_SUCCESS) { - LOG_ERR("Failed allocating PPI chan"); - return -ENOMEM; - } - - nrfx_gppi_channel_endpoints_setup( - ppi_chan_radio_ready, nrf_radio_event_address_get(NRF_RADIO, NRF_RADIO_EVENT_READY), - nrfx_gpiote_set_task_address_get( - &gpiote, CONFIG_MPSL_PIN_DEBUG_RADIO_READY_AND_DISABLED_PIN)); - - nrfx_gppi_channel_endpoints_setup( - ppi_chan_radio_disabled, - nrf_radio_event_address_get(NRF_RADIO, NRF_RADIO_EVENT_DISABLED), - nrfx_gpiote_clr_task_address_get( - &gpiote, CONFIG_MPSL_PIN_DEBUG_RADIO_READY_AND_DISABLED_PIN)); - - nrfx_gppi_channel_endpoints_setup( - ppi_chan_radio_address, - nrf_radio_event_address_get(NRF_RADIO, NRF_RADIO_EVENT_ADDRESS), - nrfx_gpiote_set_task_address_get(&gpiote, - CONFIG_MPSL_PIN_DEBUG_RADIO_ADDRESS_AND_END_PIN)); - - nrfx_gppi_channel_endpoints_setup( - ppi_chan_radio_end, nrf_radio_event_address_get(NRF_RADIO, NRF_RADIO_EVENT_END), - nrfx_gpiote_clr_task_address_get(&gpiote, - CONFIG_MPSL_PIN_DEBUG_RADIO_ADDRESS_AND_END_PIN)); - - if (nrfx_ppi_channel_enable(ppi_chan_radio_ready) != NRFX_SUCCESS) { - LOG_ERR("Failed enabling channel"); - return -ENOMEM; - } - if (nrfx_ppi_channel_enable(ppi_chan_radio_address) != NRFX_SUCCESS) { - LOG_ERR("Failed enabling channel"); - return -ENOMEM; - } - if (nrfx_ppi_channel_enable(ppi_chan_radio_end) != NRFX_SUCCESS) { - LOG_ERR("Failed enabling channel"); - return -ENOMEM; - } - if (nrfx_ppi_channel_enable(ppi_chan_radio_disabled) != NRFX_SUCCESS) { - LOG_ERR("Failed enabling channel"); - return -ENOMEM; - } - -#elif defined(DPPI_PRESENT) - /* Radio events are published on predefined channels. */ - - nrfx_gppi_task_endpoint_setup( - MPSL_DPPI_RADIO_PUBLISH_READY_CHANNEL_IDX, - nrfx_gpiote_set_task_address_get( - &gpiote, CONFIG_MPSL_PIN_DEBUG_RADIO_READY_AND_DISABLED_PIN)); - - nrfx_gppi_task_endpoint_setup( - MPSL_DPPI_RADIO_PUBLISH_DISABLED_CH_IDX, - nrfx_gpiote_clr_task_address_get( - &gpiote, CONFIG_MPSL_PIN_DEBUG_RADIO_READY_AND_DISABLED_PIN)); - - nrfx_gppi_task_endpoint_setup( - MPSL_DPPI_RADIO_PUBLISH_ADDRESS_CHANNEL_IDX, - nrfx_gpiote_set_task_address_get(&gpiote, - CONFIG_MPSL_PIN_DEBUG_RADIO_ADDRESS_AND_END_PIN)); + nrfx_gppi_handle_t handle[4]; + uint32_t tep[4]; + + tep[0] = nrfx_gpiote_set_task_address_get(&gpiote, + CONFIG_MPSL_PIN_DEBUG_RADIO_READY_AND_DISABLED_PIN); + tep[1] = nrfx_gpiote_clr_task_address_get(&gpiote, + CONFIG_MPSL_PIN_DEBUG_RADIO_READY_AND_DISABLED_PIN); + tep[2] = nrfx_gpiote_set_task_address_get(&gpiote, + CONFIG_MPSL_PIN_DEBUG_RADIO_ADDRESS_AND_END_PIN); + tep[3] = nrfx_gpiote_clr_task_address_get(&gpiote, + CONFIG_MPSL_PIN_DEBUG_RADIO_ADDRESS_AND_END_PIN); +#if defined(DPPI_PRESENT) + handle[0] = MPSL_DPPI_RADIO_PUBLISH_READY_CHANNEL_IDX; + handle[1] = MPSL_DPPI_RADIO_PUBLISH_DISABLED_CH_IDX; + handle[2] = MPSL_DPPI_RADIO_PUBLISH_ADDRESS_CHANNEL_IDX; + handle[3] = MPSL_DPPI_RADIO_PUBLISH_END_CHANNEL_IDX; +#else + uint32_t eep[4]; - nrfx_gppi_task_endpoint_setup( - MPSL_DPPI_RADIO_PUBLISH_END_CHANNEL_IDX, - nrfx_gpiote_clr_task_address_get(&gpiote, - CONFIG_MPSL_PIN_DEBUG_RADIO_ADDRESS_AND_END_PIN)); + eep[0] = nrf_radio_event_address_get(NRF_RADIO, NRF_RADIO_EVENT_READY); + eep[1] = nrf_radio_event_address_get(NRF_RADIO, NRF_RADIO_EVENT_DISABLED); + eep[2] = nrf_radio_event_address_get(NRF_RADIO, NRF_RADIO_EVENT_ADDRESS); + eep[3] = nrf_radio_event_address_get(NRF_RADIO, NRF_RADIO_EVENT_END); +#endif + for (size_t i = 0; ARRAY_SIZE(tep); i++) { +#if defined(DPPI_PRESENT) + nrfx_gppi_ep_attach(handle[i], tep[i]); #else -#error "Expect either PPI or DPPI to be present." + int err = nrfx_gppi_conn_alloc(eep[i], tep[i], &handle[i]); + + if (err < 0) { + return err; + } + nrfx_gppi_conn_enable(handle[i]); #endif + } return 0; } From a4d05658313a4acfbe149b866e884bde44d002fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Tue, 28 Oct 2025 13:44:56 +0100 Subject: [PATCH 37/72] debug: cpu_load: Align to the new GPPI API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Additionally, removed support for PPI resources cleanup in case of failed allocation. cpu_load is a debug feature and if allocation fails then there is something wrong with the configuration and configuration shall be fixed or cpu_load disabled. Signed-off-by: Krzysztof Chruściński --- subsys/debug/cpu_load/cpu_load.c | 145 ++++++------------ .../subsys/debug/cpu_load/src/test_cpu_load.c | 11 +- 2 files changed, 51 insertions(+), 105 deletions(-) diff --git a/subsys/debug/cpu_load/cpu_load.c b/subsys/debug/cpu_load/cpu_load.c index 0642e808a37..46e0d3bc149 100644 --- a/subsys/debug/cpu_load/cpu_load.c +++ b/subsys/debug/cpu_load/cpu_load.c @@ -34,64 +34,6 @@ static nrfx_timer_t timer = static bool ready; static struct k_work_delayable cpu_load_log; static uint32_t cycle_ref; -static uint32_t shared_ch_mask; - -#define IS_CH_SHARED(ch) \ - (IS_ENABLED(CONFIG_NRF_CPU_LOAD_USE_SHARED_DPPI_CHANNELS) && \ - (BIT(ch) & shared_ch_mask)) - - -/** @brief Allocate (D)PPI channel. */ -static nrfx_err_t ppi_alloc(uint8_t *ch, uint32_t evt) -{ -#ifdef DPPI_PRESENT - if (*PUBLISH_ADDR(evt) != 0) { - if (!IS_ENABLED(CONFIG_NRF_CPU_LOAD_USE_SHARED_DPPI_CHANNELS)) { - return NRFX_ERROR_BUSY; - } - /* Use mask of one of subscribe registers in the system, - * assuming that all subscribe registers has the same mask for - * channel id. - */ - *ch = *PUBLISH_ADDR(evt) & DPPIC_SUBSCRIBE_CHG_EN_CHIDX_Msk; - shared_ch_mask |= BIT(*ch); - return NRFX_SUCCESS; - } -#endif - return nrfx_gppi_channel_alloc(ch); -} - -static nrfx_err_t ppi_free(uint8_t ch) -{ -#ifdef DPPI_PRESENT - if (IS_CH_SHARED(ch)) { - shared_ch_mask &= ~BIT(ch); - return NRFX_SUCCESS; - } -#endif - return nrfx_gppi_channel_free(ch); -} - -static void ppi_cleanup(uint8_t ch_tick, uint8_t ch_sleep, uint8_t ch_wakeup) -{ - nrfx_err_t err = NRFX_SUCCESS; - - if (IS_ENABLED(CONFIG_NRF_CPU_LOAD_ALIGNED_CLOCKS)) { - err = ppi_free(ch_tick); - } - - if ((err == NRFX_SUCCESS) && (ch_sleep != CH_INVALID)) { - err = ppi_free(ch_sleep); - } - - if ((err == NRFX_SUCCESS) && (ch_wakeup != CH_INVALID)) { - err = ppi_free(ch_wakeup); - } - - if (err != NRFX_SUCCESS) { - LOG_ERR("PPI channel freeing failed (err:%d)", err); - } -} static void cpu_load_log_fn(struct k_work *item) { @@ -120,12 +62,43 @@ static void timer_handler(nrf_timer_event_t event_type, void *context) /*empty*/ } +static int ppi_handle_get(uint32_t evt) +{ +#ifdef DPPI_PRESENT + if (*PUBLISH_ADDR(evt) != 0) { + if (!IS_ENABLED(CONFIG_NRF_CPU_LOAD_USE_SHARED_DPPI_CHANNELS)) { + return -ENOTSUP; + } + return *PUBLISH_ADDR(evt) & DPPIC_SUBSCRIBE_CHG_EN_CHIDX_Msk; + } +#endif + return -ENOTSUP; +} +static int ppi_setup(uint32_t eep, uint32_t tep) +{ + nrfx_gppi_handle_t handle; + int err; + + err = ppi_handle_get(eep); + if (err >= 0) { + /* It works only on single domain DPPI. */ + handle = (nrfx_gppi_handle_t)err; + nrfx_gppi_ep_attach(handle, tep); + return 0; + } + + err = nrfx_gppi_conn_alloc(eep, tep, &handle); + if (err < 0) { + LOG_ERR("Failed to allocate PPI resources"); + return err; + } + + nrfx_gppi_conn_enable(handle); + return 0; +} int cpu_load_init_internal(void) { - uint8_t ch_sleep; - uint8_t ch_wakeup; - uint8_t ch_tick = 0; nrfx_err_t err; uint32_t base_frequency = NRF_TIMER_BASE_FREQUENCY_GET(timer.p_reg); nrfx_timer_config_t config = NRFX_TIMER_DEFAULT_CONFIG(base_frequency); @@ -141,57 +114,31 @@ int cpu_load_init_internal(void) #ifdef CONFIG_NRF_CPU_LOAD_ALIGNED_CLOCKS /* It's assumed that RTC1 is driving system clock. */ config.mode = NRF_TIMER_MODE_COUNTER; - err = ppi_alloc(&ch_tick, - nrf_rtc_event_address_get(NRF_RTC1, NRF_RTC_EVENT_TICK)); - if (err != NRFX_SUCCESS) { - return -ENODEV; + ret = ppi_setup(nrf_rtc_event_address_get(NRF_RTC1, NRF_RTC_EVENT_TICK), + nrfx_timer_task_address_get(&timer, NRF_TIMER_TASK_COUNT)); + if (ret < 0) { + return ret; } - nrfx_gppi_channel_endpoints_setup(ch_tick, - nrf_rtc_event_address_get(NRF_RTC1, NRF_RTC_EVENT_TICK), - nrfx_timer_task_address_get(&timer, NRF_TIMER_TASK_COUNT)); nrf_rtc_event_enable(NRF_RTC1, NRF_RTC_INT_TICK_MASK); #endif - err = ppi_alloc(&ch_sleep, - nrf_power_event_address_get(NRF_POWER, - NRF_POWER_EVENT_SLEEPENTER)); - if (err != NRFX_SUCCESS) { - ppi_cleanup(ch_tick, CH_INVALID, CH_INVALID); - return -ENODEV; + ret = ppi_setup(nrf_power_event_address_get(NRF_POWER, NRF_POWER_EVENT_SLEEPENTER), + nrfx_timer_task_address_get(&timer, NRF_TIMER_TASK_START)); + if (ret < 0) { + return ret; } - err = ppi_alloc(&ch_wakeup, - nrf_power_event_address_get(NRF_POWER, - NRF_POWER_EVENT_SLEEPEXIT)); - if (err != NRFX_SUCCESS) { - ppi_cleanup(ch_tick, ch_sleep, CH_INVALID); - return -ENODEV; + ret = ppi_setup(nrf_power_event_address_get(NRF_POWER, NRF_POWER_EVENT_SLEEPEXIT), + nrfx_timer_task_address_get(&timer, NRF_TIMER_TASK_STOP)); + if (ret < 0) { + return ret; } err = nrfx_timer_init(&timer, &config, timer_handler); if (err != NRFX_SUCCESS) { - ppi_cleanup(ch_tick, ch_sleep, ch_wakeup); return -EBUSY; } - nrfx_gppi_channel_endpoints_setup(ch_sleep, - nrf_power_event_address_get(NRF_POWER, - NRF_POWER_EVENT_SLEEPENTER), - nrfx_timer_task_address_get(&timer, NRF_TIMER_TASK_START)); - nrfx_gppi_channel_endpoints_setup(ch_wakeup, - nrf_power_event_address_get(NRF_POWER, - NRF_POWER_EVENT_SLEEPEXIT), - nrfx_timer_task_address_get(&timer, NRF_TIMER_TASK_STOP)); - - /* In case of DPPI event can only be assigned to a single channel. In - * that case, cpu load can still subscribe to the channel but should - * not control it. It may result in cpu load not working. User must - * take care of that. - */ - nrfx_gppi_channels_enable((IS_CH_SHARED(ch_sleep) ? 0 : BIT(ch_sleep)) | - (IS_CH_SHARED(ch_wakeup) ? 0 : BIT(ch_wakeup)) | - (IS_CH_SHARED(ch_tick) ? 0 : BIT(ch_tick))); - cpu_load_reset(); if (IS_ENABLED(CONFIG_NRF_CPU_LOAD_LOG_PERIODIC)) { diff --git a/tests/subsys/debug/cpu_load/src/test_cpu_load.c b/tests/subsys/debug/cpu_load/src/test_cpu_load.c index d922ff93df6..51856123258 100644 --- a/tests/subsys/debug/cpu_load/src/test_cpu_load.c +++ b/tests/subsys/debug/cpu_load/src/test_cpu_load.c @@ -13,7 +13,6 @@ #include #ifdef CONFIG_NRF_CPU_LOAD_USE_SHARED_DPPI_CHANNELS -#include static void timer_handler(nrf_timer_event_t event_type, void *context) { @@ -26,10 +25,11 @@ static int dppi_shared_resources_init(void) static nrfx_timer_t timer = NRFX_TIMER_INSTANCE(NRF_TIMER1); uint32_t base_frequency = NRF_TIMER_BASE_FREQUENCY_GET(timer.p_reg); nrfx_timer_config_t config = NRFX_TIMER_DEFAULT_CONFIG(base_frequency); - uint8_t ch; + nrfx_gppi_handle_t handle; uint32_t evt = nrf_power_event_address_get(NRF_POWER, NRF_POWER_EVENT_SLEEPENTER); uint32_t tsk = nrfx_timer_task_address_get(&timer, NRF_TIMER_TASK_COUNT); + int rv; config.frequency = NRFX_MHZ_TO_HZ(1); config.bit_width = NRF_TIMER_BIT_WIDTH_32; @@ -37,11 +37,10 @@ static int dppi_shared_resources_init(void) err = nrfx_timer_init(&timer, &config, timer_handler); zassert_equal(err, NRFX_SUCCESS, "Unexpected error:%d", err); - err = nrfx_gppi_channel_alloc(&ch); - zassert_equal(err, NRFX_SUCCESS, "Unexpected error:%d", err); + rv = nrfx_gppi_conn_alloc(evt, tsk, &handle); + zassert_equal(rv, 0); - nrfx_gppi_channel_endpoints_setup(ch, evt, tsk); - nrfx_gppi_channels_enable(BIT(ch)); + nrfx_gppi_conn_enable(handle); return 0; } From 9bdf072a7e2e480e355bd4332ada2655142481c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Tue, 28 Oct 2025 14:25:42 +0100 Subject: [PATCH 38/72] dm: Use GPPI for PPI resource allocation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nrfx_ppi and nrfx_dppi are deprecated. Signed-off-by: Krzysztof Chruściński --- subsys/dm/dm.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/subsys/dm/dm.c b/subsys/dm/dm.c index 3da230a6ba2..8d12404d452 100644 --- a/subsys/dm/dm.c +++ b/subsys/dm/dm.c @@ -23,17 +23,9 @@ #include "rpc/host/dm_rpc_host.h" #include "rpc/common/dm_rpc_common.h" -#if defined(DPPI_PRESENT) -#include - -static nrfx_dppi_t dppi = NRFX_DPPI_INSTANCE(0); - -#define gppi_channel_t uint8_t -#define gppi_channel_alloc(x) nrfx_dppi_channel_alloc(&dppi, x) -#else -#include -#define gppi_channel_t nrf_ppi_channel_t -#define gppi_channel_alloc nrfx_ppi_channel_alloc +#include +#ifdef NRFX_GPPI_MULTI_DOMAIN +#error "Not supported" #endif #include @@ -504,15 +496,15 @@ int dm_init(struct dm_init_param *init_param) nrf_dm_antenna_config_t ant_conf = NRF_DM_DEFAULT_SINGLE_ANTENNA_CONFIG; for (size_t i = 0; i < PPI_CH_COUNT; i++) { - gppi_channel_t channel; + nrfx_gppi_handle_t handle; - err = gppi_channel_alloc(&channel); - if (err != NRFX_SUCCESS) { + err = nrfx_gppi_domain_conn_alloc(0, 0, &handle); + if (err < 0) { LOG_ERR("(D)PPI channel allocation error: %08x", err); - return -ENOMEM; + return err; } - ppi_ch[i] = (uint8_t)channel; + ppi_ch[i] = (uint8_t)handle; } nrf_dm_init(&ppi_conf, &ant_conf, DM_TIMER); From cb4f90ab3db92f623ad0776984a04ae0527ec9f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Tue, 28 Oct 2025 14:29:54 +0100 Subject: [PATCH 39/72] gazell: gzll_glue: Use GPPI for PPI resource allocation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use GPPI instead of nrfx_ppi which is deprecated. Signed-off-by: Krzysztof Chruściński --- subsys/gazell/gzll_glue.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/subsys/gazell/gzll_glue.c b/subsys/gazell/gzll_glue.c index 33620949c38..5eee88d3a6a 100644 --- a/subsys/gazell/gzll_glue.c +++ b/subsys/gazell/gzll_glue.c @@ -11,8 +11,8 @@ #include #include -#include - +#include +#include #if defined(CONFIG_GAZELL_ZERO_LATENCY_IRQS) #define GAZELL_HIGH_IRQ_FLAGS IRQ_ZERO_LATENCY @@ -93,8 +93,9 @@ bool gzll_glue_init(void) { bool is_ok = true; const struct device *clkctrl = DEVICE_DT_GET_ONE(nordic_nrf_clock); - nrfx_err_t err_code; + int err; nrf_ppi_channel_t ppi_channel[3]; + nrfx_gppi_handle_t handle; uint8_t i; irq_disable(RADIO_IRQn); @@ -127,11 +128,12 @@ bool gzll_glue_init(void) } for (i = 0; i < 3; i++) { - err_code = nrfx_ppi_channel_alloc(&ppi_channel[i]); - if (err_code != NRFX_SUCCESS) { + err = nrfx_gppi_domain_conn_alloc(0, 0, &handle); + if (err < 0) { is_ok = false; break; } + ppi_channel[i] = (nrf_ppi_channel_t)handle; } if (is_ok) { From b828718f8e426ba8169e04ea9edf59bd6300e947 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Tue, 28 Oct 2025 14:43:08 +0100 Subject: [PATCH 40/72] esb: Use GPPI for allocating resources MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nrfx_ppi and nrfx_dppi are deprecated. Use GPPI for resource allocation. Signed-off-by: Krzysztof Chruściński --- subsys/esb/Kconfig | 6 +- subsys/esb/esb_dppi.c | 111 +++++++++++++---------------------- subsys/esb/esb_peripherals.h | 3 - subsys/esb/esb_ppi.c | 106 ++++++++++++--------------------- 4 files changed, 79 insertions(+), 147 deletions(-) diff --git a/subsys/esb/Kconfig b/subsys/esb/Kconfig index 6472d1b065d..ea5adf8a7ca 100644 --- a/subsys/esb/Kconfig +++ b/subsys/esb/Kconfig @@ -6,13 +6,9 @@ menuconfig ESB bool "Enhanced ShockBurst" - select NRFX_PPI if HAS_HW_NRF_PPI - select NRFX_DPPI if HAS_HW_NRF_DPPIC + select NRFX_GPPI select MPSL select MPSL_FEM_ONLY if !ESB_DYNAMIC_INTERRUPTS - select NRFX_DPPI020 if SOC_SERIES_NRF54HX - select NRFX_DPPI10 if SOC_SERIES_NRF54LX - select NRFX_DPPI0 if SOC_SERIES_NRF53X help Enable ESB functionality. diff --git a/subsys/esb/esb_dppi.c b/subsys/esb/esb_dppi.c index 2c92bdce579..4b8f87e6fdb 100644 --- a/subsys/esb/esb_dppi.c +++ b/subsys/esb/esb_dppi.c @@ -7,8 +7,8 @@ #include #include #include - -#include +#include +#include #include @@ -203,52 +203,59 @@ uint32_t esb_ppi_radio_disabled_get(void) int esb_ppi_init(void) { - nrfx_err_t err; - - nrfx_dppi_t dppi = NRFX_DPPI_INSTANCE(ESB_DPPIC_INSTANCE_NO); + int ch; + uint32_t domain_id = nrfx_gppi_domain_id_get((uint32_t)ESB_DPPIC); - err = nrfx_dppi_channel_alloc(&dppi, &radio_address_timer_stop); - if (err != NRFX_SUCCESS) { + ch = nrfx_gppi_channel_alloc(domain_id, NULL); + if (ch < 0) { goto error; } + radio_address_timer_stop = (uint8_t)ch; - err = nrfx_dppi_channel_alloc(&dppi, &timer_compare0_radio_disable); - if (err != NRFX_SUCCESS) { + ch = nrfx_gppi_channel_alloc(domain_id, NULL); + if (ch < 0) { goto error; } + timer_compare0_radio_disable = (uint8_t)ch; - err = nrfx_dppi_channel_alloc(&dppi, &timer_compare1_radio_txen); - if (err != NRFX_SUCCESS) { + ch = nrfx_gppi_channel_alloc(domain_id, NULL); + if (ch < 0) { goto error; } + timer_compare1_radio_txen = (uint8_t)ch; - err = nrfx_dppi_channel_alloc(&dppi, &disabled_phy_end_egu); - if (err != NRFX_SUCCESS) { + ch = nrfx_gppi_channel_alloc(domain_id, NULL); + if (ch < 0) { goto error; } + disabled_phy_end_egu = (uint8_t)ch; - err = nrfx_dppi_channel_alloc(&dppi, &egu_timer_start); - if (err != NRFX_SUCCESS) { + ch = nrfx_gppi_channel_alloc(domain_id, NULL); + if (ch < 0) { goto error; } + egu_timer_start = (uint8_t)ch; - err = nrfx_dppi_channel_alloc(&dppi, &egu_ramp_up); - if (err != NRFX_SUCCESS) { + ch = nrfx_gppi_channel_alloc(domain_id, NULL); + if (ch < 0) { goto error; } + egu_ramp_up = (uint8_t)ch; if (IS_ENABLED(CONFIG_ESB_NEVER_DISABLE_TX)) { - err = nrfx_dppi_channel_alloc(&dppi, &radio_end_timer_start); - if (err != NRFX_SUCCESS) { + ch = nrfx_gppi_channel_alloc(domain_id, NULL); + if (ch < 0) { goto error; } + radio_end_timer_start = (uint8_t)ch; } - err = nrfx_dppi_group_alloc(&dppi, &ramp_up_dppi_group); - if (err != NRFX_SUCCESS) { - LOG_ERR("gppi_group_alloc failed with: %d\n", err); - return -ENODEV; + ch = nrfx_gppi_group_channel_alloc(domain_id, NULL); + if (ch < 0) { + LOG_ERR("gppi_group_alloc failed with: %d\n", ch); + return ch; } + ramp_up_dppi_group = (uint8_t)ch; nrf_radio_publish_set(NRF_RADIO, NRF_RADIO_EVENT_DISABLED, disabled_phy_end_egu); if (IS_ENABLED(CONFIG_ESB_FAST_SWITCHING)) { @@ -259,7 +266,7 @@ int esb_ppi_init(void) return 0; error: - LOG_ERR("gppi_channel_alloc failed with: %d\n", err); + LOG_ERR("gppi_channel_alloc failed with: %d\n", ch); return -ENODEV; } @@ -303,62 +310,24 @@ void esb_ppi_disable_all(void) void esb_ppi_deinit(void) { - nrfx_err_t err; - nrf_dppi_channels_disable(ESB_DPPIC, BIT(disabled_phy_end_egu)); nrf_radio_publish_clear(NRF_RADIO, NRF_RADIO_EVENT_DISABLED); if (IS_ENABLED(CONFIG_ESB_FAST_SWITCHING)) { nrf_radio_publish_clear(NRF_RADIO, NRF_RADIO_EVENT_PHYEND); } - nrfx_dppi_t dppi = NRFX_DPPI_INSTANCE(ESB_DPPIC_INSTANCE_NO); - - err = nrfx_dppi_channel_free(&dppi, radio_address_timer_stop); - if (err != NRFX_SUCCESS) { - goto error; - } - - err = nrfx_dppi_channel_free(&dppi, timer_compare0_radio_disable); - if (err != NRFX_SUCCESS) { - goto error; - } - - err = nrfx_dppi_channel_free(&dppi, timer_compare1_radio_txen); - if (err != NRFX_SUCCESS) { - goto error; - } - - err = nrfx_dppi_channel_free(&dppi, disabled_phy_end_egu); - if (err != NRFX_SUCCESS) { - goto error; - } - - err = nrfx_dppi_channel_free(&dppi, egu_timer_start); - if (err != NRFX_SUCCESS) { - goto error; - } + uint32_t domain_id = nrfx_gppi_domain_id_get((uint32_t)ESB_DPPIC); - err = nrfx_dppi_channel_free(&dppi, egu_ramp_up); - if (err != NRFX_SUCCESS) { - goto error; - } + nrfx_gppi_channel_free(domain_id, radio_address_timer_stop); + nrfx_gppi_channel_free(domain_id, timer_compare0_radio_disable); + nrfx_gppi_channel_free(domain_id, timer_compare1_radio_txen); + nrfx_gppi_channel_free(domain_id, disabled_phy_end_egu); + nrfx_gppi_channel_free(domain_id, egu_timer_start); + nrfx_gppi_channel_free(domain_id, egu_ramp_up); if (IS_ENABLED(CONFIG_ESB_NEVER_DISABLE_TX)) { - err = nrfx_dppi_channel_free(&dppi, radio_end_timer_start); - if (err != NRFX_SUCCESS) { - goto error; - } - } - - err = nrfx_dppi_group_free(&dppi, ramp_up_dppi_group); - if (err != NRFX_SUCCESS) { - goto error; + nrfx_gppi_channel_free(domain_id, radio_end_timer_start); } - - return; - -/* Should not happen. */ -error: - __ASSERT(false, "Failed to free DPPI resources"); + nrfx_gppi_group_channel_free(domain_id, ramp_up_dppi_group); } diff --git a/subsys/esb/esb_peripherals.h b/subsys/esb/esb_peripherals.h index b45ab755c78..66f46806513 100644 --- a/subsys/esb/esb_peripherals.h +++ b/subsys/esb/esb_peripherals.h @@ -66,9 +66,6 @@ extern "C" { /** The ESB Radio interrupt number. */ #define ESB_RADIO_IRQ_NUMBER RADIO_IRQn - /** DPPIC instance number used by ESB. */ - #define ESB_DPPIC_INSTANCE_NO 0 - /** ESB EGU instance configuration. */ #define ESB_EGU NRF_EGU0 diff --git a/subsys/esb/esb_ppi.c b/subsys/esb/esb_ppi.c index 85ee0144512..d89ccf159c8 100644 --- a/subsys/esb/esb_ppi.c +++ b/subsys/esb/esb_ppi.c @@ -7,8 +7,8 @@ #include #include #include - -#include +#include +#include #include @@ -185,55 +185,63 @@ void esb_ppi_for_wait_for_rx_clear(void) int esb_ppi_init(void) { - nrfx_err_t err; + int ch; - err = nrfx_ppi_channel_alloc(&egu_ramp_up); - if (err != NRFX_SUCCESS) { + ch = nrfx_gppi_channel_alloc(0, NULL); + if (ch < 0) { goto error; } + egu_ramp_up = (nrf_ppi_channel_t)ch; - err = nrfx_ppi_channel_alloc(&disabled_egu); - if (err != NRFX_SUCCESS) { + ch = nrfx_gppi_channel_alloc(0, NULL); + if (ch < 0) { goto error; } + disabled_egu = (nrf_ppi_channel_t)ch; - err = nrfx_ppi_channel_alloc(&egu_timer_start); - if (err != NRFX_SUCCESS) { + ch = nrfx_gppi_channel_alloc(0, NULL); + if (ch < 0) { goto error; } + egu_timer_start = (nrf_ppi_channel_t)ch; - err = nrfx_ppi_channel_alloc(&radio_address_timer_stop); - if (err != NRFX_SUCCESS) { + ch = nrfx_gppi_channel_alloc(0, NULL); + if (ch < 0) { goto error; } + radio_address_timer_stop = (nrf_ppi_channel_t)ch; - err = nrfx_ppi_channel_alloc(&timer_compare0_radio_disable); - if (err != NRFX_SUCCESS) { + ch = nrfx_gppi_channel_alloc(0, NULL); + if (ch < 0) { goto error; } + timer_compare0_radio_disable = (nrf_ppi_channel_t)ch; - err = nrfx_ppi_channel_alloc(&timer_compare1_radio_txen); - if (err != NRFX_SUCCESS) { + ch = nrfx_gppi_channel_alloc(0, NULL); + if (ch < 0) { goto error; } + timer_compare1_radio_txen = (nrf_ppi_channel_t)ch; if (IS_ENABLED(CONFIG_ESB_NEVER_DISABLE_TX)) { - err = nrfx_ppi_channel_alloc(&radio_end_timer_start); - if (err != NRFX_SUCCESS) { + ch = nrfx_gppi_channel_alloc(0, NULL); + if (ch < 0) { goto error; } + radio_end_timer_start = (nrf_ppi_channel_t)ch; } - err = nrfx_ppi_group_alloc(&ramp_up_ppi_group); - if (err != NRFX_SUCCESS) { - LOG_ERR("gppi_group_alloc failed with: %d\n", err); - return -ENODEV; + ch = nrfx_gppi_group_channel_alloc(0, NULL); + if (ch < 0) { + LOG_ERR("gppi_group_alloc failed with: %d\n", ch); + return ch; } + ramp_up_ppi_group = (nrf_ppi_channel_group_t)ch; return 0; error: - LOG_ERR("gppi_channel_alloc failed with: %d\n", err); + LOG_ERR("gppi_channel_alloc failed with: %d\n", ch); return -ENODEV; } @@ -273,53 +281,15 @@ void esb_ppi_disable_all(void) void esb_ppi_deinit(void) { - nrfx_err_t err; - - err = nrfx_ppi_channel_free(egu_ramp_up); - if (err != NRFX_SUCCESS) { - goto error; - } - - err = nrfx_ppi_channel_free(disabled_egu); - if (err != NRFX_SUCCESS) { - goto error; - } - - err = nrfx_ppi_channel_free(egu_timer_start); - if (err != NRFX_SUCCESS) { - goto error; - } - - err = nrfx_ppi_channel_free(radio_address_timer_stop); - if (err != NRFX_SUCCESS) { - goto error; - } - - err = nrfx_ppi_channel_free(timer_compare0_radio_disable); - if (err != NRFX_SUCCESS) { - goto error; - } - - err = nrfx_ppi_channel_free(timer_compare1_radio_txen); - if (err != NRFX_SUCCESS) { - goto error; - } - + nrfx_gppi_channel_free(0, (uint8_t)egu_ramp_up); + nrfx_gppi_channel_free(0, (uint8_t)disabled_egu); + nrfx_gppi_channel_free(0, (uint8_t)egu_timer_start); + nrfx_gppi_channel_free(0, (uint8_t)radio_address_timer_stop); + nrfx_gppi_channel_free(0, (uint8_t)timer_compare0_radio_disable); + nrfx_gppi_channel_free(0, (uint8_t)timer_compare1_radio_txen); if (IS_ENABLED(CONFIG_ESB_NEVER_DISABLE_TX)) { - err = nrfx_ppi_channel_free(radio_end_timer_start); - if (err != NRFX_SUCCESS) { - goto error; - } - } - - err = nrfx_ppi_group_free(ramp_up_ppi_group); - if (err != NRFX_SUCCESS) { - goto error; + nrfx_gppi_channel_free(0, (uint8_t)radio_end_timer_start); } - return; - -/* Should not happen. */ -error: - __ASSERT(false, "Failed to free PPI resources"); + nrfx_gppi_group_channel_free(0, (uint8_t)ramp_up_ppi_group); } From 482c55f7d5952eecf564770561a745d29fb6818a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Wed, 29 Oct 2025 06:50:24 +0100 Subject: [PATCH 41/72] tests: drivers: audio: pdm_loopback: Align to the new GPPI API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Align test to the new GPPI API. Signed-off-by: Krzysztof Chruściński --- tests/drivers/audio/pdm_loopback/src/main.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/tests/drivers/audio/pdm_loopback/src/main.c b/tests/drivers/audio/pdm_loopback/src/main.c index 20c0addd66b..c5e4fcca376 100644 --- a/tests/drivers/audio/pdm_loopback/src/main.c +++ b/tests/drivers/audio/pdm_loopback/src/main.c @@ -286,18 +286,13 @@ ZTEST(pdm_loopback, test_pdm_clk_frequency) nrfx_timer_enable(&timer_instance); - uint8_t gppi_channel; + nrfx_gppi_handle_t gppi_handle; + uint32_t eep = nrfx_gpiote_in_event_address_get(&gpiote_instance, CLOCK_INPUT_PIN); + uint32_t tep = nrfx_timer_task_address_get(&timer_instance, NRF_TIMER_TASK_COUNT); - ret = nrfx_gppi_channel_alloc(&gppi_channel); - - zassert_true(ret == NRFX_SUCCESS, - "GPPI channel allocation failed, return code = 0x%08X", ret); - nrfx_gppi_channel_endpoints_setup(gppi_channel, - nrfx_gpiote_in_event_address_get(&gpiote_instance, - CLOCK_INPUT_PIN), - nrfx_timer_task_address_get(&timer_instance, - NRF_TIMER_TASK_COUNT)); - nrfx_gppi_channels_enable(BIT(gppi_channel)); + ret = nrfx_gppi_conn_alloc(eep, tep, &gppi_handle); + zassert_equal(ret, 0, "GPPI channel allocation failed, return code = %d", ret); + nrfx_gppi_conn_enable(gppi_handle); pdm_transfer(pdm_dev, &pdm_cfg, BLOCK_COUNT); From 702839bcd36cffd7b2c741d397d4411c8fd8c7a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Wed, 29 Oct 2025 07:33:24 +0100 Subject: [PATCH 42/72] samples: bluetooth: Align to the new GPPI API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Align samples to use the updated GPPI API. Signed-off-by: Krzysztof Chruściński --- .../src/controller_time_nrf52.c | 69 +++++++------- .../src/controller_time_nrf53_app.c | 89 ++++++++----------- .../conn_time_sync/src/timed_led_toggle.c | 13 ++- .../iso_time_sync/src/controller_time_nrf52.c | 66 ++++++-------- .../src/controller_time_nrf53_app.c | 88 ++++++++---------- .../iso_time_sync/src/timed_led_toggle.c | 13 ++- samples/bluetooth/radio_coex_1wire/src/main.c | 27 ++---- 7 files changed, 155 insertions(+), 210 deletions(-) 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 c853d36bb21..ca1c80a2048 100644 --- a/samples/bluetooth/conn_time_sync/src/controller_time_nrf52.c +++ b/samples/bluetooth/conn_time_sync/src/controller_time_nrf52.c @@ -24,7 +24,7 @@ static const nrfx_rtc_t app_rtc_instance = NRFX_RTC_INSTANCE(2); static nrfx_timer_t app_timer_instance = NRFX_TIMER_INSTANCE(NRF_TIMER1); -static uint8_t ppi_chan_on_rtc_match; +static nrfx_gppi_handle_t ppi_on_rtc_match; static volatile uint32_t num_rtc_overflows; static uint32_t offset_ticks_and_controller_to_app_rtc; @@ -110,13 +110,15 @@ static int rtc_config(void) static int timer_config(void) { int ret; - uint8_t ppi_chan_timer_clear_on_rtc_tick; + nrfx_gppi_handle_t ppi_handle_timer_clear_on_rtc_tick; const nrfx_timer_config_t timer_cfg = { .frequency = NRFX_MHZ_TO_HZ(1UL), .mode = NRF_TIMER_MODE_TIMER, .bit_width = NRF_TIMER_BIT_WIDTH_8, .interrupt_priority = NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY, .p_context = NULL}; + uint32_t eep; + uint32_t tep; ret = nrfx_timer_init(&app_timer_instance, &timer_cfg, unused_timer_isr_handler); if (ret != NRFX_SUCCESS) { @@ -125,19 +127,15 @@ static int timer_config(void) } /* Clear the TIMER every RTC tick. */ - if (nrfx_gppi_channel_alloc(&ppi_chan_timer_clear_on_rtc_tick) != NRFX_SUCCESS) { + eep = nrfx_rtc_event_address_get(&app_rtc_instance, NRF_RTC_EVENT_TICK); + tep = nrfx_timer_task_address_get(&app_timer_instance, NRF_TIMER_TASK_CLEAR); + ret = nrfx_gppi_conn_alloc(eep, tep, &ppi_handle_timer_clear_on_rtc_tick); + if (ret < 0) { printk("Failed allocating for clearing TIMER on RTC TICK\n"); - return -ENOMEM; + return ret; } - nrfx_gppi_channel_endpoints_setup(ppi_chan_timer_clear_on_rtc_tick, - nrfx_rtc_event_address_get(&app_rtc_instance, - NRF_RTC_EVENT_TICK), - nrfx_timer_task_address_get(&app_timer_instance, - NRF_TIMER_TASK_CLEAR)); - - nrfx_gppi_channels_enable(BIT(ppi_chan_timer_clear_on_rtc_tick)); - + nrfx_gppi_conn_enable(ppi_handle_timer_clear_on_rtc_tick); nrfx_timer_enable(&app_timer_instance); return 0; @@ -154,36 +152,31 @@ static int timer_config(void) */ int config_egu_trigger_on_rtc_and_timer_match(void) { - uint8_t ppi_chan_on_timer_match; + nrfx_gppi_handle_t ppi_on_timer_match; + nrfx_gppi_group_handle_t group; + uint32_t eep0 = nrfx_rtc_event_address_get(&app_rtc_instance, NRF_RTC_EVENT_COMPARE_0); + uint32_t eep1 = nrfx_timer_event_address_get(&app_timer_instance, NRF_TIMER_EVENT_COMPARE0); + uint32_t tep1 = nrf_egu_task_address_get(NRF_EGU0, NRF_EGU_TASK_TRIGGER0); + int ret; - if (nrfx_gppi_channel_alloc(&ppi_chan_on_rtc_match) != NRFX_SUCCESS) { - printk("Failed allocating for RTC match\n"); - return -ENOMEM; + ret = nrfx_gppi_group_alloc(&eep0, 1, &group); + if (ret < 0) { + printk("Failed allocating group\n"); + return ret; } - if (nrfx_gppi_channel_alloc(&ppi_chan_on_timer_match) != NRFX_SUCCESS) { - printk("Failed allocating for TIMER match\n"); - return -ENOMEM; + 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"); + return ret; } - nrfx_gppi_group_clear(NRFX_GPPI_CHANNEL_GROUP0); - nrfx_gppi_group_disable(NRFX_GPPI_CHANNEL_GROUP0); - nrfx_gppi_channels_include_in_group( - BIT(ppi_chan_on_timer_match) | BIT(ppi_chan_on_rtc_match), - NRFX_GPPI_CHANNEL_GROUP0); - - nrfx_gppi_channel_endpoints_setup(ppi_chan_on_rtc_match, - nrfx_rtc_event_address_get(&app_rtc_instance, - NRF_RTC_EVENT_COMPARE_0), - nrfx_gppi_task_address_get(NRFX_GPPI_TASK_CHG0_EN)); - - nrfx_gppi_channel_endpoints_setup(ppi_chan_on_timer_match, - nrfx_timer_event_address_get(&app_timer_instance, - NRF_TIMER_EVENT_COMPARE0), - nrf_egu_task_address_get(NRF_EGU0, - NRF_EGU_TASK_TRIGGER0)); - nrfx_gppi_fork_endpoint_setup(ppi_chan_on_timer_match, - nrfx_gppi_task_address_get(NRFX_GPPI_TASK_CHG0_DIS)); + ret = nrfx_gppi_conn_alloc(eep1, tep1, &ppi_on_timer_match); + if (ret < 0) { + printk("Failed allocating for RTC match\n"); + return ret; + } + (void)nrfx_gppi_ep_attach(ppi_on_timer_match, nrfx_gppi_group_task_dis_addr(group)); return 0; } @@ -279,7 +272,7 @@ void controller_time_trigger_set(uint64_t timestamp_us) } nrfx_timer_compare(&app_timer_instance, 0, timer_val, false); - nrfx_gppi_channels_enable(BIT(ppi_chan_on_rtc_match)); + nrfx_gppi_conn_enable(ppi_on_rtc_match); } uint32_t controller_time_trigger_event_addr_get(void) 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 145d5d7e217..fd348f7c20e 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 @@ -25,7 +25,7 @@ static const nrfx_rtc_t app_rtc_instance = NRFX_RTC_INSTANCE(0); static nrfx_timer_t app_timer_instance = NRFX_TIMER_INSTANCE(NRF_TIMER0); -static uint8_t ppi_chan_on_rtc_match; +static nrfx_gppi_handle_t ppi_on_rtc_match; static volatile uint32_t num_rtc_overflows; static void rtc_isr_handler(nrfx_rtc_int_type_t int_type) @@ -44,7 +44,7 @@ static void unused_timer_isr_handler(nrf_timer_event_t event_type, void *ctx) static int rtc_config(void) { int ret; - uint8_t dppi_channel_rtc_start; + nrfx_gppi_handle_t dppi_rtc_start; const nrfx_rtc_config_t rtc_cfg = NRFX_RTC_DEFAULT_CONFIG; ret = nrfx_rtc_init(&app_rtc_instance, &rtc_cfg, rtc_isr_handler); @@ -65,25 +65,18 @@ static int rtc_config(void) nrfx_rtc_tick_enable(&app_rtc_instance, false); nrfx_rtc_enable(&app_rtc_instance); - + nrf_ipc_receive_config_set(NRF_IPC, 4, NRF_IPC_CHANNEL_4); /* The application core RTC is started synchronously with the controller * RTC using PPI over IPC. */ - ret = nrfx_gppi_channel_alloc(&dppi_channel_rtc_start); - if (ret != NRFX_SUCCESS) { + ret = nrfx_gppi_conn_alloc(nrfx_rtc_task_address_get(&app_rtc_instance, NRF_RTC_TASK_CLEAR), + nrf_ipc_event_address_get(NRF_IPC, NRF_IPC_EVENT_RECEIVE_4), + &dppi_rtc_start); + if (ret < 0) { printk("nrfx DPPI channel alloc error for starting RTC: %d", ret); - return -ENODEV; + return ret; } - - nrf_ipc_receive_config_set(NRF_IPC, 4, NRF_IPC_CHANNEL_4); - - nrfx_gppi_channel_endpoints_setup(dppi_channel_rtc_start, - nrfx_rtc_task_address_get(&app_rtc_instance, - NRF_RTC_TASK_CLEAR), - nrf_ipc_event_address_get(NRF_IPC, - NRF_IPC_EVENT_RECEIVE_4)); - - nrfx_gppi_channels_enable(BIT(dppi_channel_rtc_start)); + nrfx_gppi_conn_enable(dppi_rtc_start); return 0; } @@ -91,13 +84,15 @@ static int rtc_config(void) static int timer_config(void) { int ret; - uint8_t ppi_chan_timer_clear_on_rtc_tick; + nrfx_gppi_handle_t ppi_timer_clear_on_rtc_tick; const nrfx_timer_config_t timer_cfg = { .frequency = NRFX_MHZ_TO_HZ(1UL), .mode = NRF_TIMER_MODE_TIMER, .bit_width = NRF_TIMER_BIT_WIDTH_8, .interrupt_priority = NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY, .p_context = NULL}; + uint32_t eep = nrfx_rtc_event_address_get(&app_rtc_instance, NRF_RTC_EVENT_TICK); + uint32_t tep = nrfx_timer_task_address_get(&app_timer_instance, NRF_TIMER_TASK_CLEAR); ret = nrfx_timer_init(&app_timer_instance, &timer_cfg, unused_timer_isr_handler); if (ret != NRFX_SUCCESS) { @@ -105,20 +100,13 @@ static int timer_config(void) return -ENODEV; } - /* Clear the TIMER every RTC tick. */ - if (nrfx_gppi_channel_alloc(&ppi_chan_timer_clear_on_rtc_tick) != NRFX_SUCCESS) { + ret = nrfx_gppi_conn_alloc(eep, tep, &ppi_timer_clear_on_rtc_tick); + if (ret < 0) { printk("Failed allocating for clearing TIMER on RTC TICK\n"); - return -ENOMEM; + return ret; } - nrfx_gppi_channel_endpoints_setup(ppi_chan_timer_clear_on_rtc_tick, - nrfx_rtc_event_address_get(&app_rtc_instance, - NRF_RTC_EVENT_TICK), - nrfx_timer_task_address_get(&app_timer_instance, - NRF_TIMER_TASK_CLEAR)); - - nrfx_gppi_channels_enable(BIT(ppi_chan_timer_clear_on_rtc_tick)); - + nrfx_gppi_conn_enable(ppi_timer_clear_on_rtc_tick); nrfx_timer_enable(&app_timer_instance); return 0; @@ -135,34 +123,31 @@ static int timer_config(void) */ int config_egu_trigger_on_rtc_and_timer_match(void) { - uint8_t ppi_chan_on_timer_match; + nrfx_gppi_handle_t ppi_on_timer_match; + nrfx_gppi_group_handle_t group; + uint32_t eep0 = nrfx_rtc_event_address_get(&app_rtc_instance, NRF_RTC_EVENT_COMPARE_0); + uint32_t eep1 = nrfx_timer_event_address_get(&app_timer_instance, NRF_TIMER_EVENT_COMPARE0); + uint32_t tep1 = nrf_egu_task_address_get(NRF_EGU0, NRF_EGU_TASK_TRIGGER0); + int ret; - if (nrfx_gppi_channel_alloc(&ppi_chan_on_rtc_match) != NRFX_SUCCESS) { - printk("Failed allocating for RTC match\n"); - return -ENOMEM; + ret = nrfx_gppi_group_alloc(&eep0, 1, &group); + if (ret < 0) { + printk("Failed allocating group\n"); + return ret; } - if (nrfx_gppi_channel_alloc(&ppi_chan_on_timer_match) != NRFX_SUCCESS) { - printk("Failed allocating for TIMER match\n"); - return -ENOMEM; + 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"); + return ret; } - nrfx_gppi_group_clear(NRFX_GPPI_CHANNEL_GROUP0); - nrfx_gppi_group_disable(NRFX_GPPI_CHANNEL_GROUP0); - nrfx_gppi_channels_include_in_group( - BIT(ppi_chan_on_timer_match) | BIT(ppi_chan_on_rtc_match), - NRFX_GPPI_CHANNEL_GROUP0); - - nrfx_gppi_channel_endpoints_setup(ppi_chan_on_rtc_match, - nrfx_rtc_event_address_get(&app_rtc_instance, - NRF_RTC_EVENT_COMPARE_0), - nrfx_gppi_task_address_get(NRFX_GPPI_TASK_CHG0_EN)); - nrfx_gppi_channel_endpoints_setup(ppi_chan_on_timer_match, - nrfx_timer_event_address_get(&app_timer_instance, - NRF_TIMER_EVENT_COMPARE0), - nrfx_gppi_task_address_get(NRFX_GPPI_TASK_CHG0_DIS)); - nrfx_gppi_fork_endpoint_setup(ppi_chan_on_timer_match, - nrf_egu_task_address_get(NRF_EGU0, NRF_EGU_TASK_TRIGGER0)); + ret = nrfx_gppi_conn_alloc(eep1, tep1, &ppi_on_timer_match); + if (ret < 0) { + printk("Failed allocating for RTC match\n"); + return ret; + } + (void)nrfx_gppi_ep_attach(ppi_on_timer_match, nrfx_gppi_group_task_dis_addr(group)); return 0; } @@ -253,7 +238,7 @@ void controller_time_trigger_set(uint64_t timestamp_us) } nrfx_timer_compare(&app_timer_instance, 0, timer_val, false); - nrfx_gppi_channels_enable(BIT(ppi_chan_on_rtc_match)); + nrfx_gppi_conn_enable(ppi_on_rtc_match); } uint32_t controller_time_trigger_event_addr_get(void) diff --git a/samples/bluetooth/conn_time_sync/src/timed_led_toggle.c b/samples/bluetooth/conn_time_sync/src/timed_led_toggle.c index b6834bab641..3185ed80d84 100644 --- a/samples/bluetooth/conn_time_sync/src/timed_led_toggle.c +++ b/samples/bluetooth/conn_time_sync/src/timed_led_toggle.c @@ -33,7 +33,7 @@ static uint8_t previous_led_value; int timed_led_toggle_init(void) { int err; - uint8_t ppi_chan_led_toggle; + nrfx_gppi_handle_t ppi_led_toggle; uint8_t gpiote_chan_led_toggle; const nrfx_gpiote_output_config_t gpiote_output_cfg = NRFX_GPIOTE_DEFAULT_OUTPUT_CONFIG; @@ -63,16 +63,15 @@ int timed_led_toggle_init(void) return -ENOMEM; } - if (nrfx_gppi_channel_alloc(&ppi_chan_led_toggle) != NRFX_SUCCESS) { + err = nrfx_gppi_conn_alloc(controller_time_trigger_event_addr_get(), + nrfx_gpiote_out_task_address_get(&gpiote, LED_PIN), + &ppi_led_toggle); + if (err < 0) { printk("Failed allocating PPI chan for toggling led\n"); return -ENOMEM; } - nrfx_gppi_channel_endpoints_setup(ppi_chan_led_toggle, - controller_time_trigger_event_addr_get(), - nrfx_gpiote_out_task_address_get(&gpiote, LED_PIN)); - - nrfx_gppi_channels_enable(BIT(ppi_chan_led_toggle)); + nrfx_gppi_conn_enable(ppi_led_toggle); nrfx_gpiote_out_task_enable(&gpiote, LED_PIN); return 0; 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 7980bc71178..9f82dde3da8 100644 --- a/samples/bluetooth/iso_time_sync/src/controller_time_nrf52.c +++ b/samples/bluetooth/iso_time_sync/src/controller_time_nrf52.c @@ -24,7 +24,7 @@ static const nrfx_rtc_t app_rtc_instance = NRFX_RTC_INSTANCE(2); static nrfx_timer_t app_timer_instance = NRFX_TIMER_INSTANCE(NRF_TIMER1); -static uint8_t ppi_chan_on_rtc_match; +static nrfx_gppi_handle_t ppi_on_rtc_match; static volatile uint32_t num_rtc_overflows; static uint32_t offset_ticks_and_controller_to_app_rtc; @@ -110,13 +110,15 @@ static int rtc_config(void) static int timer_config(void) { int ret; - uint8_t ppi_chan_timer_clear_on_rtc_tick; + nrfx_gppi_handle_t ppi_timer_clear_on_rtc_tick; const nrfx_timer_config_t timer_cfg = { .frequency = NRFX_MHZ_TO_HZ(1UL), .mode = NRF_TIMER_MODE_TIMER, .bit_width = NRF_TIMER_BIT_WIDTH_8, .interrupt_priority = NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY, .p_context = NULL}; + uint32_t eep = nrfx_rtc_event_address_get(&app_rtc_instance, NRF_RTC_EVENT_TICK); + uint32_t tep = nrfx_timer_task_address_get(&app_timer_instance, NRF_TIMER_TASK_CLEAR); ret = nrfx_timer_init(&app_timer_instance, &timer_cfg, unused_timer_isr_handler); if (ret != NRFX_SUCCESS) { @@ -125,18 +127,13 @@ static int timer_config(void) } /* Clear the TIMER every RTC tick. */ - if (nrfx_gppi_channel_alloc(&ppi_chan_timer_clear_on_rtc_tick) != NRFX_SUCCESS) { + ret = nrfx_gppi_conn_alloc(eep, tep, &ppi_timer_clear_on_rtc_tick); + if (ret < 0) { printk("Failed allocating for clearing TIMER on RTC TICK\n"); - return -ENOMEM; + return ret; } - nrfx_gppi_channel_endpoints_setup(ppi_chan_timer_clear_on_rtc_tick, - nrfx_rtc_event_address_get(&app_rtc_instance, - NRF_RTC_EVENT_TICK), - nrfx_timer_task_address_get(&app_timer_instance, - NRF_TIMER_TASK_CLEAR)); - - nrfx_gppi_channels_enable(BIT(ppi_chan_timer_clear_on_rtc_tick)); + nrfx_gppi_conn_enable(ppi_timer_clear_on_rtc_tick); nrfx_timer_enable(&app_timer_instance); @@ -154,36 +151,31 @@ static int timer_config(void) */ int config_egu_trigger_on_rtc_and_timer_match(void) { - uint8_t ppi_chan_on_timer_match; + nrfx_gppi_handle_t ppi_on_timer_match; + nrfx_gppi_group_handle_t group; + uint32_t eep0 = nrfx_rtc_event_address_get(&app_rtc_instance, NRF_RTC_EVENT_COMPARE_0); + uint32_t eep1 = nrfx_timer_event_address_get(&app_timer_instance, NRF_TIMER_EVENT_COMPARE0); + uint32_t tep1 = nrf_egu_task_address_get(NRF_EGU0, NRF_EGU_TASK_TRIGGER0); + int ret; - if (nrfx_gppi_channel_alloc(&ppi_chan_on_rtc_match) != NRFX_SUCCESS) { - printk("Failed allocating for RTC match\n"); - return -ENOMEM; + ret = nrfx_gppi_group_alloc(&eep0, 1, &group); + if (ret < 0) { + printk("Failed allocating group\n"); + return ret; } - if (nrfx_gppi_channel_alloc(&ppi_chan_on_timer_match) != NRFX_SUCCESS) { - printk("Failed allocating for TIMER match\n"); - return -ENOMEM; + 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"); + return ret; } - nrfx_gppi_group_clear(NRFX_GPPI_CHANNEL_GROUP0); - nrfx_gppi_group_disable(NRFX_GPPI_CHANNEL_GROUP0); - nrfx_gppi_channels_include_in_group( - BIT(ppi_chan_on_timer_match) | BIT(ppi_chan_on_rtc_match), - NRFX_GPPI_CHANNEL_GROUP0); - - nrfx_gppi_channel_endpoints_setup(ppi_chan_on_rtc_match, - nrfx_rtc_event_address_get(&app_rtc_instance, - NRF_RTC_EVENT_COMPARE_0), - nrfx_gppi_task_address_get(NRFX_GPPI_TASK_CHG0_EN)); - - nrfx_gppi_channel_endpoints_setup(ppi_chan_on_timer_match, - nrfx_timer_event_address_get(&app_timer_instance, - NRF_TIMER_EVENT_COMPARE0), - nrf_egu_task_address_get(NRF_EGU0, - NRF_EGU_TASK_TRIGGER0)); - nrfx_gppi_fork_endpoint_setup(ppi_chan_on_timer_match, - nrfx_gppi_task_address_get(NRFX_GPPI_TASK_CHG0_DIS)); + ret = nrfx_gppi_conn_alloc(eep1, tep1, &ppi_on_timer_match); + if (ret < 0) { + printk("Failed allocating for RTC match\n"); + return ret; + } + (void)nrfx_gppi_ep_attach(ppi_on_timer_match, nrfx_gppi_group_task_dis_addr(group)); return 0; } @@ -279,7 +271,7 @@ void controller_time_trigger_set(uint64_t timestamp_us) } nrfx_timer_compare(&app_timer_instance, 0, timer_val, false); - nrfx_gppi_channels_enable(BIT(ppi_chan_on_rtc_match)); + nrfx_gppi_conn_enable(ppi_on_rtc_match); } uint32_t controller_time_trigger_event_addr_get(void) 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 b44b4b74c8f..4a990511bbd 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 @@ -25,7 +25,7 @@ static const nrfx_rtc_t app_rtc_instance = NRFX_RTC_INSTANCE(0); static nrfx_timer_t app_timer_instance = NRFX_TIMER_INSTANCE(NRF_TIMER0); -static uint8_t ppi_chan_on_rtc_match; +static nrfx_gppi_handle_t ppi_on_rtc_match; static volatile uint32_t num_rtc_overflows; static void rtc_isr_handler(nrfx_rtc_int_type_t int_type) @@ -44,7 +44,7 @@ static void unused_timer_isr_handler(nrf_timer_event_t event_type, void *ctx) static int rtc_config(void) { int ret; - uint8_t dppi_channel_rtc_start; + nrfx_gppi_handle_t dppi_rtc_start; const nrfx_rtc_config_t rtc_cfg = NRFX_RTC_DEFAULT_CONFIG; ret = nrfx_rtc_init(&app_rtc_instance, &rtc_cfg, rtc_isr_handler); @@ -65,25 +65,18 @@ static int rtc_config(void) nrfx_rtc_tick_enable(&app_rtc_instance, false); nrfx_rtc_enable(&app_rtc_instance); - + nrf_ipc_receive_config_set(NRF_IPC, 4, NRF_IPC_CHANNEL_4); /* The application core RTC is started synchronously with the controller * RTC using PPI over IPC. */ - ret = nrfx_gppi_channel_alloc(&dppi_channel_rtc_start); - if (ret != NRFX_SUCCESS) { + ret = nrfx_gppi_conn_alloc(nrfx_rtc_task_address_get(&app_rtc_instance, NRF_RTC_TASK_CLEAR), + nrf_ipc_event_address_get(NRF_IPC, NRF_IPC_EVENT_RECEIVE_4), + &dppi_rtc_start); + if (ret < 0) { printk("nrfx DPPI channel alloc error for starting RTC: %d", ret); - return -ENODEV; + return ret; } - - nrf_ipc_receive_config_set(NRF_IPC, 4, NRF_IPC_CHANNEL_4); - - nrfx_gppi_channel_endpoints_setup(dppi_channel_rtc_start, - nrfx_rtc_task_address_get(&app_rtc_instance, - NRF_RTC_TASK_CLEAR), - nrf_ipc_event_address_get(NRF_IPC, - NRF_IPC_EVENT_RECEIVE_4)); - - nrfx_gppi_channels_enable(BIT(dppi_channel_rtc_start)); + nrfx_gppi_conn_enable(dppi_rtc_start); return 0; } @@ -91,13 +84,15 @@ static int rtc_config(void) static int timer_config(void) { int ret; - uint8_t ppi_chan_timer_clear_on_rtc_tick; + nrfx_gppi_handle_t ppi_timer_clear_on_rtc_tick; const nrfx_timer_config_t timer_cfg = { .frequency = NRFX_MHZ_TO_HZ(1UL), .mode = NRF_TIMER_MODE_TIMER, .bit_width = NRF_TIMER_BIT_WIDTH_8, .interrupt_priority = NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY, .p_context = NULL}; + uint32_t eep = nrfx_rtc_event_address_get(&app_rtc_instance, NRF_RTC_EVENT_TICK); + uint32_t tep = nrfx_timer_task_address_get(&app_timer_instance, NRF_TIMER_TASK_CLEAR); ret = nrfx_timer_init(&app_timer_instance, &timer_cfg, unused_timer_isr_handler); if (ret != NRFX_SUCCESS) { @@ -106,19 +101,13 @@ static int timer_config(void) } /* Clear the TIMER every RTC tick. */ - if (nrfx_gppi_channel_alloc(&ppi_chan_timer_clear_on_rtc_tick) != NRFX_SUCCESS) { + ret = nrfx_gppi_conn_alloc(eep, tep, &ppi_timer_clear_on_rtc_tick); + if (ret < 0) { printk("Failed allocating for clearing TIMER on RTC TICK\n"); - return -ENOMEM; + return ret; } - nrfx_gppi_channel_endpoints_setup(ppi_chan_timer_clear_on_rtc_tick, - nrfx_rtc_event_address_get(&app_rtc_instance, - NRF_RTC_EVENT_TICK), - nrfx_timer_task_address_get(&app_timer_instance, - NRF_TIMER_TASK_CLEAR)); - - nrfx_gppi_channels_enable(BIT(ppi_chan_timer_clear_on_rtc_tick)); - + nrfx_gppi_conn_enable(ppi_timer_clear_on_rtc_tick); nrfx_timer_enable(&app_timer_instance); return 0; @@ -135,34 +124,31 @@ static int timer_config(void) */ int config_egu_trigger_on_rtc_and_timer_match(void) { - uint8_t ppi_chan_on_timer_match; + nrfx_gppi_handle_t ppi_on_timer_match; + nrfx_gppi_group_handle_t group; + uint32_t eep0 = nrfx_rtc_event_address_get(&app_rtc_instance, NRF_RTC_EVENT_COMPARE_0); + uint32_t eep1 = nrfx_timer_event_address_get(&app_timer_instance, NRF_TIMER_EVENT_COMPARE0); + uint32_t tep1 = nrf_egu_task_address_get(NRF_EGU0, NRF_EGU_TASK_TRIGGER0); + int ret; - if (nrfx_gppi_channel_alloc(&ppi_chan_on_rtc_match) != NRFX_SUCCESS) { - printk("Failed allocating for RTC match\n"); - return -ENOMEM; + ret = nrfx_gppi_group_alloc(&eep0, 1, &group); + if (ret < 0) { + printk("Failed allocating group\n"); + return ret; } - if (nrfx_gppi_channel_alloc(&ppi_chan_on_timer_match) != NRFX_SUCCESS) { - printk("Failed allocating for TIMER match\n"); - return -ENOMEM; + 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"); + return ret; } - nrfx_gppi_group_clear(NRFX_GPPI_CHANNEL_GROUP0); - nrfx_gppi_group_disable(NRFX_GPPI_CHANNEL_GROUP0); - nrfx_gppi_channels_include_in_group( - BIT(ppi_chan_on_timer_match) | BIT(ppi_chan_on_rtc_match), - NRFX_GPPI_CHANNEL_GROUP0); - - nrfx_gppi_channel_endpoints_setup(ppi_chan_on_rtc_match, - nrfx_rtc_event_address_get(&app_rtc_instance, - NRF_RTC_EVENT_COMPARE_0), - nrfx_gppi_task_address_get(NRFX_GPPI_TASK_CHG0_EN)); - nrfx_gppi_channel_endpoints_setup(ppi_chan_on_timer_match, - nrfx_timer_event_address_get(&app_timer_instance, - NRF_TIMER_EVENT_COMPARE0), - nrfx_gppi_task_address_get(NRFX_GPPI_TASK_CHG0_DIS)); - nrfx_gppi_fork_endpoint_setup(ppi_chan_on_timer_match, - nrf_egu_task_address_get(NRF_EGU0, NRF_EGU_TASK_TRIGGER0)); + ret = nrfx_gppi_conn_alloc(eep1, tep1, &ppi_on_timer_match); + if (ret < 0) { + printk("Failed allocating for RTC match\n"); + return ret; + } + (void)nrfx_gppi_ep_attach(ppi_on_timer_match, nrfx_gppi_group_task_dis_addr(group)); return 0; } @@ -253,7 +239,7 @@ void controller_time_trigger_set(uint64_t timestamp_us) } nrfx_timer_compare(&app_timer_instance, 0, timer_val, false); - nrfx_gppi_channels_enable(BIT(ppi_chan_on_rtc_match)); + nrfx_gppi_conn_enable(ppi_on_rtc_match); } uint32_t controller_time_trigger_event_addr_get(void) diff --git a/samples/bluetooth/iso_time_sync/src/timed_led_toggle.c b/samples/bluetooth/iso_time_sync/src/timed_led_toggle.c index fafa3932247..74e2613ad8f 100644 --- a/samples/bluetooth/iso_time_sync/src/timed_led_toggle.c +++ b/samples/bluetooth/iso_time_sync/src/timed_led_toggle.c @@ -33,7 +33,7 @@ static uint8_t previous_led_value; int timed_led_toggle_init(void) { int err; - uint8_t ppi_chan_led_toggle; + nrfx_gppi_handle_t ppi_led_toggle; uint8_t gpiote_chan_led_toggle; const nrfx_gpiote_output_config_t gpiote_output_cfg = NRFX_GPIOTE_DEFAULT_OUTPUT_CONFIG; @@ -63,16 +63,15 @@ int timed_led_toggle_init(void) return -ENOMEM; } - if (nrfx_gppi_channel_alloc(&ppi_chan_led_toggle) != NRFX_SUCCESS) { + err = nrfx_gppi_conn_alloc(controller_time_trigger_event_addr_get(), + nrfx_gpiote_out_task_address_get(&gpiote, LED_PIN), + &ppi_led_toggle); + if (err < 0) { printk("Failed allocating PPI chan for toggling led\n"); return -ENOMEM; } - nrfx_gppi_channel_endpoints_setup(ppi_chan_led_toggle, - controller_time_trigger_event_addr_get(), - nrfx_gpiote_out_task_address_get(&gpiote, LED_PIN)); - - nrfx_gppi_channels_enable(BIT(ppi_chan_led_toggle)); + nrfx_gppi_conn_enable(ppi_led_toggle); nrfx_gpiote_out_task_enable(&gpiote, LED_PIN); return 0; diff --git a/samples/bluetooth/radio_coex_1wire/src/main.c b/samples/bluetooth/radio_coex_1wire/src/main.c index 84a5f69ecfd..78d157062a0 100644 --- a/samples/bluetooth/radio_coex_1wire/src/main.c +++ b/samples/bluetooth/radio_coex_1wire/src/main.c @@ -116,27 +116,18 @@ static void console_print_thread(void) } } -#if defined(PPI_PRESENT) -static nrf_ppi_channel_t allocate_gppi_channel(void) -{ - nrf_ppi_channel_t channel; - - if (nrfx_ppi_channel_alloc(&channel) != NRFX_SUCCESS) { - __ASSERT(false, "(D)PPI channel allocation error"); - } - return channel; -} -#endif - static void setup_radio_event_counter(void) { #if defined(PPI_PRESENT) - nrf_ppi_channel_t channel = allocate_gppi_channel(); - - nrfx_gppi_channel_endpoints_setup( - channel, nrf_radio_event_address_get(NRF_RADIO, NRF_RADIO_EVENT_READY), - nrf_egu_task_address_get(NRF_EGU, EGU_TASK)); - nrfx_ppi_channel_enable(channel); + nrfx_gppi_handle_t handle; + uint32_t eep = nrf_radio_event_address_get(NRF_RADIO, NRF_RADIO_EVENT_READY); + uint32_t tep = nrf_egu_task_address_get(NRF_EGU, EGU_TASK); + int rv; + + rv = nrfx_gppi_conn_alloc(eep, tep, &handle); + (void)rv; + __ASSERT(rv == 0, "Failed to allocate PPI channel."); + nrfx_gppi_conn_enable(handle); #else /* Radio events are published on predefined channels. */ nrf_egu_subscribe_set(NRF_EGU, EGU_TASK, MPSL_DPPI_RADIO_PUBLISH_READY_CHANNEL_IDX); From 4837c5c9c2efb8555369c45d410282295a7f50d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Wed, 29 Oct 2025 07:51:42 +0100 Subject: [PATCH 43/72] samples: bluetooth: direct_test_mode: Adapt to the new GPPI API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adapt to the new GPPI API. Signed-off-by: Krzysztof Chruściński --- samples/bluetooth/direct_test_mode/src/dtm.c | 64 +++++++++----------- 1 file changed, 27 insertions(+), 37 deletions(-) diff --git a/samples/bluetooth/direct_test_mode/src/dtm.c b/samples/bluetooth/direct_test_mode/src/dtm.c index 056f048bf2b..bef31f1b8ba 100644 --- a/samples/bluetooth/direct_test_mode/src/dtm.c +++ b/samples/bluetooth/direct_test_mode/src/dtm.c @@ -411,7 +411,7 @@ static struct dtm_instance { #endif /* Radio Enable PPI channel. */ - uint8_t ppi_radio_start; + nrfx_gppi_handle_t ppi_radio_start; /* PPI endpoint status.*/ atomic_t endpoint_state; @@ -849,11 +849,12 @@ static int anomaly_timer_init(void) static int gppi_init(void) { nrfx_err_t err; + uint32_t rad_domain = nrfx_gppi_domain_id_get((uint32_t)NRF_RADIO); - err = nrfx_gppi_channel_alloc(&dtm_inst.ppi_radio_start); - if (err != NRFX_SUCCESS) { - printk("nrfx_gppi_channel_alloc failed with: %d\n", err); - return -EAGAIN; + err = nrfx_gppi_domain_conn_alloc(rad_domain, rad_domain, &dtm_inst.ppi_radio_start); + if (err < 0) { + printk("nrfx_gppi_domain_conn_alloc failed with: %d\n", err); + return err; } return 0; @@ -1144,9 +1145,7 @@ static void radio_tx_power_set(uint8_t channel, int8_t tx_power, nrf_radio_mode_ static void radio_reset(void) { - if (nrfx_gppi_channel_check(dtm_inst.ppi_radio_start)) { - nrfx_gppi_channels_disable(BIT(dtm_inst.ppi_radio_start)); - } + nrfx_gppi_conn_disable(dtm_inst.ppi_radio_start); nrf_radio_shorts_set(NRF_RADIO, 0); nrf_radio_event_clear(NRF_RADIO, NRF_RADIO_EVENT_DISABLED); @@ -1618,34 +1617,27 @@ static void errata_191_handle(bool enable) static void endpoints_clear(void) { if (atomic_test_and_clear_bit(&dtm_inst.endpoint_state, ENDPOINT_FORK_EGU_TIMER)) { - nrfx_gppi_fork_endpoint_clear(dtm_inst.ppi_radio_start, + nrfx_gppi_ep_clear( nrf_timer_task_address_get(dtm_inst.timer.p_reg, NRF_TIMER_TASK_START)); } if (atomic_test_and_clear_bit(&dtm_inst.endpoint_state, ENDPOINT_EGU_RADIO_TX)) { - nrfx_gppi_channel_endpoints_clear( - dtm_inst.ppi_radio_start, - nrf_egu_event_address_get(DTM_EGU, DTM_EGU_EVENT), - nrf_radio_task_address_get(NRF_RADIO, NRF_RADIO_TASK_TXEN)); + nrfx_gppi_ep_clear(nrf_egu_event_address_get(DTM_EGU, DTM_EGU_EVENT)); + nrfx_gppi_ep_clear(nrf_radio_task_address_get(NRF_RADIO, NRF_RADIO_TASK_TXEN)); } if (atomic_test_and_clear_bit(&dtm_inst.endpoint_state, ENDPOINT_EGU_RADIO_RX)) { - nrfx_gppi_channel_endpoints_clear( - dtm_inst.ppi_radio_start, - nrf_egu_event_address_get(DTM_EGU, DTM_EGU_EVENT), - nrf_radio_task_address_get(NRF_RADIO, NRF_RADIO_TASK_RXEN)); + nrfx_gppi_ep_clear(nrf_egu_event_address_get(DTM_EGU, DTM_EGU_EVENT)); + nrfx_gppi_ep_clear(nrf_radio_task_address_get(NRF_RADIO, NRF_RADIO_TASK_RXEN)); } if (atomic_test_and_clear_bit(&dtm_inst.endpoint_state, ENDPOINT_TIMER_RADIO_TX)) { - nrfx_gppi_channel_endpoints_clear( - dtm_inst.ppi_radio_start, - nrf_timer_event_address_get(dtm_inst.timer.p_reg, NRF_TIMER_EVENT_COMPARE0), - nrf_radio_task_address_get(NRF_RADIO, NRF_RADIO_TASK_TXEN)); + nrfx_gppi_ep_clear( + nrf_timer_event_address_get(dtm_inst.timer.p_reg, NRF_TIMER_EVENT_COMPARE0)); + nrfx_gppi_ep_clear(nrf_radio_task_address_get(NRF_RADIO, NRF_RADIO_TASK_TXEN)); } } static void radio_ppi_clear(void) { - if (nrfx_gppi_channel_check(dtm_inst.ppi_radio_start)) { - nrfx_gppi_channels_disable(BIT(dtm_inst.ppi_radio_start)); - } + nrfx_gppi_conn_disable(dtm_inst.ppi_radio_start); nrf_egu_event_clear(DTM_EGU, DTM_EGU_EVENT); @@ -1655,19 +1647,19 @@ static void radio_ppi_clear(void) static void radio_ppi_configure(bool rx, uint32_t timer_short_mask) { - nrfx_gppi_channel_endpoints_setup( - dtm_inst.ppi_radio_start, - nrf_egu_event_address_get(DTM_EGU, DTM_EGU_EVENT), - nrf_radio_task_address_get(NRF_RADIO, + nrfx_gppi_ep_attach(dtm_inst.ppi_radio_start, + nrf_egu_event_address_get(DTM_EGU, DTM_EGU_EVENT)); + nrfx_gppi_ep_attach(dtm_inst.ppi_radio_start, + nrf_radio_task_address_get(NRF_RADIO, rx ? NRF_RADIO_TASK_RXEN : NRF_RADIO_TASK_TXEN)); atomic_set_bit(&dtm_inst.endpoint_state, (rx ? ENDPOINT_EGU_RADIO_RX : ENDPOINT_EGU_RADIO_TX)); - nrfx_gppi_fork_endpoint_setup(dtm_inst.ppi_radio_start, + nrfx_gppi_ep_attach(dtm_inst.ppi_radio_start, nrf_timer_task_address_get(dtm_inst.timer.p_reg, NRF_TIMER_TASK_START)); atomic_set_bit(&dtm_inst.endpoint_state, ENDPOINT_FORK_EGU_TIMER); - nrfx_gppi_channels_enable(BIT(dtm_inst.ppi_radio_start)); + nrfx_gppi_conn_enable(dtm_inst.ppi_radio_start); if (timer_short_mask) { nrf_timer_shorts_set(dtm_inst.timer.p_reg, timer_short_mask); @@ -1676,18 +1668,16 @@ static void radio_ppi_configure(bool rx, uint32_t timer_short_mask) static void radio_tx_ppi_reconfigure(void) { - if (nrfx_gppi_channel_check(dtm_inst.ppi_radio_start)) { - nrfx_gppi_channels_disable(BIT(dtm_inst.ppi_radio_start)); - } + nrfx_gppi_conn_disable(dtm_inst.ppi_radio_start); endpoints_clear(); - nrfx_gppi_channel_endpoints_setup( - dtm_inst.ppi_radio_start, - nrf_timer_event_address_get(dtm_inst.timer.p_reg, NRF_TIMER_EVENT_COMPARE0), + nrfx_gppi_ep_attach(dtm_inst.ppi_radio_start, + nrf_timer_event_address_get(dtm_inst.timer.p_reg, NRF_TIMER_EVENT_COMPARE0)); + nrfx_gppi_ep_attach(dtm_inst.ppi_radio_start, nrf_radio_task_address_get(NRF_RADIO, NRF_RADIO_TASK_TXEN)); atomic_set_bit(&dtm_inst.endpoint_state, ENDPOINT_TIMER_RADIO_TX); - nrfx_gppi_channels_enable(BIT(dtm_inst.ppi_radio_start)); + nrfx_gppi_conn_enable(dtm_inst.ppi_radio_start); } static void dtm_test_done(void) From 7a7c33089fb2d462dd4410020070d6429818430d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Wed, 29 Oct 2025 08:01:08 +0100 Subject: [PATCH 44/72] samples: peripheral: radio_test: Adapt to the new GPPI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adapt radio_test sample to the new GPPI API. Signed-off-by: Krzysztof Chruściński --- .../peripheral/radio_test/src/radio_test.c | 51 +++++++++---------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/samples/peripheral/radio_test/src/radio_test.c b/samples/peripheral/radio_test/src/radio_test.c index d58320bf2b6..41bb7f52a37 100644 --- a/samples/peripheral/radio_test/src/radio_test.c +++ b/samples/peripheral/radio_test/src/radio_test.c @@ -105,7 +105,7 @@ static bool sweep_processing; static uint16_t total_payload_size; /* PPI channel for starting radio */ -static uint8_t ppi_radio_start; +static nrfx_gppi_handle_t ppi_radio_start; /* PPI endpoint status.*/ static atomic_t endpoint_state; @@ -429,23 +429,22 @@ static void radio_power_set(nrf_radio_mode_t mode, uint8_t channel, int8_t power static void endpoints_clear(void) { if (atomic_test_and_clear_bit(&endpoint_state, ENDPOINT_FORK_EGU_TIMER)) { - nrfx_gppi_fork_endpoint_clear(ppi_radio_start, - nrf_timer_task_address_get(timer.p_reg, NRF_TIMER_TASK_START)); + nrfx_gppi_ep_clear(nrf_timer_task_address_get(timer.p_reg, NRF_TIMER_TASK_START)); } if (atomic_test_and_clear_bit(&endpoint_state, ENDPOINT_EGU_RADIO_TX)) { - nrfx_gppi_channel_endpoints_clear(ppi_radio_start, - nrf_egu_event_address_get(RADIO_TEST_EGU, RADIO_TEST_EGU_EVENT), - nrf_radio_task_address_get(NRF_RADIO, NRF_RADIO_TASK_TXEN)); + nrfx_gppi_ep_clear( + nrf_egu_event_address_get(RADIO_TEST_EGU, RADIO_TEST_EGU_EVENT)); + nrfx_gppi_ep_clear(nrf_radio_task_address_get(NRF_RADIO, NRF_RADIO_TASK_TXEN)); } if (atomic_test_and_clear_bit(&endpoint_state, ENDPOINT_EGU_RADIO_RX)) { - nrfx_gppi_channel_endpoints_clear(ppi_radio_start, - nrf_egu_event_address_get(RADIO_TEST_EGU, RADIO_TEST_EGU_EVENT), - nrf_radio_task_address_get(NRF_RADIO, NRF_RADIO_TASK_RXEN)); + nrfx_gppi_ep_clear( + nrf_egu_event_address_get(RADIO_TEST_EGU, RADIO_TEST_EGU_EVENT)); + nrfx_gppi_ep_clear(nrf_radio_task_address_get(NRF_RADIO, NRF_RADIO_TASK_RXEN)); } if (atomic_test_and_clear_bit(&endpoint_state, ENDPOINT_TIMER_RADIO_TX)) { - nrfx_gppi_channel_endpoints_clear(ppi_radio_start, - nrf_timer_event_address_get(timer.p_reg, NRF_TIMER_EVENT_COMPARE0), - nrf_radio_task_address_get(NRF_RADIO, NRF_RADIO_TASK_TXEN)); + nrfx_gppi_ep_clear( + nrf_timer_event_address_get(timer.p_reg, NRF_TIMER_EVENT_COMPARE0)); + nrfx_gppi_ep_clear(nrf_radio_task_address_get(NRF_RADIO, NRF_RADIO_TASK_TXEN)); } } @@ -453,33 +452,33 @@ static void radio_ppi_config(bool rx) { endpoints_clear(); - nrfx_gppi_channel_endpoints_setup(ppi_radio_start, - nrf_egu_event_address_get(RADIO_TEST_EGU, RADIO_TEST_EGU_EVENT), + nrfx_gppi_ep_attach(ppi_radio_start, + nrf_egu_event_address_get(RADIO_TEST_EGU, RADIO_TEST_EGU_EVENT)); + nrfx_gppi_ep_attach(ppi_radio_start, nrf_radio_task_address_get(NRF_RADIO, rx ? NRF_RADIO_TASK_RXEN : NRF_RADIO_TASK_TXEN)); atomic_set_bit(&endpoint_state, (rx ? ENDPOINT_EGU_RADIO_RX : ENDPOINT_EGU_RADIO_TX)); - nrfx_gppi_fork_endpoint_setup(ppi_radio_start, + nrfx_gppi_ep_attach(ppi_radio_start, nrf_timer_task_address_get(timer.p_reg, NRF_TIMER_TASK_START)); atomic_set_bit(&endpoint_state, ENDPOINT_FORK_EGU_TIMER); - nrfx_gppi_channels_enable(BIT(ppi_radio_start)); + nrfx_gppi_conn_enable(ppi_radio_start); } static void radio_ppi_tx_reconfigure(void) { - if (nrfx_gppi_channel_check(ppi_radio_start)) { - nrfx_gppi_channels_disable(BIT(ppi_radio_start)); - } + nrfx_gppi_conn_disable(ppi_radio_start); endpoints_clear(); - nrfx_gppi_channel_endpoints_setup(ppi_radio_start, - nrf_timer_event_address_get(timer.p_reg, NRF_TIMER_EVENT_COMPARE1), + nrfx_gppi_ep_attach(ppi_radio_start, + nrf_timer_event_address_get(timer.p_reg, NRF_TIMER_EVENT_COMPARE1)); + nrfx_gppi_ep_attach(ppi_radio_start, nrf_radio_task_address_get(NRF_RADIO, NRF_RADIO_TASK_TXEN)); atomic_set_bit(&endpoint_state, ENDPOINT_TIMER_RADIO_TX); - nrfx_gppi_channels_enable(BIT(ppi_radio_start)); + nrfx_gppi_conn_enable(ppi_radio_start); } #if CONFIG_FEM @@ -1103,10 +1102,7 @@ static void cancel(void) sweep_processing = false; - if (nrfx_gppi_channel_check(ppi_radio_start)) { - nrfx_gppi_channels_disable(BIT(ppi_radio_start)); - } - + nrfx_gppi_conn_disable(ppi_radio_start); endpoints_clear(); radio_disable(); @@ -1298,6 +1294,7 @@ void radio_handler(const void *context) int radio_test_init(struct radio_test_config *config) { nrfx_err_t nrfx_err; + uint32_t rad_domain = nrfx_gppi_domain_id_get((uint32_t)NRF_RADIO); timer_init(config); IRQ_CONNECT(RADIO_TEST_TIMER_IRQn, IRQ_PRIO_LOWEST, @@ -1306,7 +1303,7 @@ int radio_test_init(struct radio_test_config *config) irq_connect_dynamic(RADIO_TEST_RADIO_IRQn, IRQ_PRIO_LOWEST, radio_handler, config, 0); irq_enable(RADIO_TEST_RADIO_IRQn); - nrfx_err = nrfx_gppi_channel_alloc(&ppi_radio_start); + nrfx_err = nrfx_gppi_domain_conn_alloc(rad_domain, rad_domain, &ppi_radio_start); if (nrfx_err != NRFX_SUCCESS) { printk("Failed to allocate gppi channel.\n"); return -EFAULT; From af3b6de79012b8d40d387913d91db43acd371eb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Thu, 30 Oct 2025 09:59:53 +0100 Subject: [PATCH 45/72] modules: nrfxlib: nrf_802154: sl: Adapt to the new GPPI API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use the new GPPI API. Signed-off-by: Krzysztof Chruściński --- ..._802154_platform_sl_lptimer_grtc_hw_task.c | 85 ++++++------------- .../nrf_802154_platform_sl_lptimer_zephyr.c | 6 +- .../nrf_802154_platform_timestamper.c | 54 +++++------- 3 files changed, 52 insertions(+), 93 deletions(-) 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 30cd4729229..0605c60d5b4 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 @@ -226,96 +226,65 @@ void nrf_802154_platform_sl_lptimer_hw_task_local_domain_connections_clear(void) #elif defined(NRF54L_SERIES) -#include -#include +#include +#include -/* To trigger GRTC.TASKS_CAPTURE[#cc] with RADIO.EVENT_{?}, the following connection chain must be +/* To trigger RADIO.TASKS_x with GRTC.EVENT_CAPTURE{?}, the following connection chain must be * created: - * - starting from RADIO domain (_R_): - * {a} RADIO.EVENT_{?} <-- DPPIC_10 - * {b} DPPIC_10 <-- PPIB_11 + * - starting with the PERI domain (_P_): + * {a} DPPIC_20 <-- GRTC.CC + * {b} PPIB_21 <-- DPPIC_20 * - crossing domain boundaries * {c} PPIB_11 <-- PPIB_21 - * - ending in the PERI domain (_P_): - * {d} PPIB_21 <-- DPPIC_20 - * {e} DPPIC_20 <-- GRTC.CC + * - ending with RADIO domain (_R_): + * {d} DPPIC_10 <-- PPIB_11 + * {e} RADIO.TASK_{?} <-- DPPIC_10 */ #define INVALID_CHANNEL UINT8_MAX -static nrfx_dppi_t dppi20 = NRFX_DPPI_INSTANCE(20); -static nrfx_ppib_interconnect_t ppib11_21 = NRFX_PPIB_INTERCONNECT_INSTANCE(11, 21); -static uint8_t peri_dppi_ch = INVALID_CHANNEL; -static uint8_t peri_ppib_ch = INVALID_CHANNEL; +static nrfx_gppi_handle_t peri_rad_handle; void nrf_802154_platform_sl_lptimer_hw_task_cross_domain_connections_setup(uint32_t cc_channel) { - nrfx_err_t err; - - err = nrfx_dppi_channel_alloc(&dppi20, &peri_dppi_ch); - __ASSERT_NO_MSG(err == NRFX_SUCCESS); - - err = nrfx_ppib_channel_alloc(&ppib11_21, &peri_ppib_ch); - __ASSERT_NO_MSG(err == NRFX_SUCCESS); - - /* {c} PPIB_11 <-- PPIB_21 - * One of HW-fixed connections, so nothing to do. - */ - - /* {d} PPIB_21 <-- DPPIC_20 */ - NRF_DPPI_ENDPOINT_SETUP( - nrfx_ppib_send_task_address_get(&ppib11_21.right, peri_ppib_ch), peri_dppi_ch); - - /* {e} DPPIC_20 <-- GRTC.CC */ - NRF_DPPI_ENDPOINT_SETUP( - z_nrf_grtc_timer_compare_evt_address_get(cc_channel), peri_dppi_ch); + ARG_UNUSED(cc_channel); } void nrf_802154_platform_sl_lptimer_hw_task_cross_domain_connections_clear(void) { - nrfx_err_t err; - - err = nrfx_ppib_channel_free(&ppib11_21, peri_ppib_ch); - __ASSERT_NO_MSG(err == NRFX_SUCCESS); - - err = nrfx_dppi_channel_free(&dppi20, peri_dppi_ch); - __ASSERT_NO_MSG(err == NRFX_SUCCESS); - - peri_dppi_ch = INVALID_CHANNEL; - peri_ppib_ch = INVALID_CHANNEL; + nrfx_gppi_domain_conn_free(peri_rad_handle); } void nrf_802154_platform_sl_lptimer_hw_task_local_domain_connections_setup(uint32_t dppi_ch, uint32_t cc_channel) { - nrfx_err_t err; + nrfx_gppi_resource_t resource = { + .domain_id = NRFX_GPPI_DOMAIN_RAD, + .channel = dppi_ch + }; + uint32_t eep = z_nrf_grtc_timer_compare_evt_address_get(cc_channel); + int err; if (dppi_ch == NRF_802154_SL_HW_TASK_PPI_INVALID) { return; } - /* {a} RADIO.TASKS_{?} <-- DPPIC_10[dppi_ch] - * It is the responsibility of the user of this platform to make the {a} connection - * and pass the DPPI channel number as a parameter here. + /* Setup a connection between Peri and Rad domain. For Rad domain use provided channel. + * Remaining resources (bridge and dppi channel in PERI) allocate dynamically. */ + err = nrfx_gppi_ext_conn_alloc(NRFX_GPPI_DOMAIN_PERI, NRFX_GPPI_DOMAIN_RAD, + &peri_rad_handle, &resource); + __ASSERT_NO_MSG(err == 0); - /* {b} DPPIC_10 <-- PPIB_11 */ - NRF_DPPI_ENDPOINT_SETUP( - nrfx_ppib_receive_event_address_get(&ppib11_21.left, peri_ppib_ch), dppi_ch); + err = nrfx_gppi_ep_attach(eep, peri_rad_handle); + __ASSERT_NO_MSG(err == 0); - err = nrfx_dppi_channel_enable(&dppi20, peri_dppi_ch); - __ASSERT_NO_MSG(err == NRFX_SUCCESS); + nrfx_gppi_conn_enable(peri_rad_handle); } void nrf_802154_platform_sl_lptimer_hw_task_local_domain_connections_clear(void) { - nrfx_err_t err; - - NRF_DPPI_ENDPOINT_CLEAR( - nrfx_ppib_receive_event_address_get(&ppib11_21.left, peri_ppib_ch)); - - err = nrfx_dppi_channel_disable(&dppi20, peri_dppi_ch); - __ASSERT_NO_MSG(err == NRFX_SUCCESS); + nrfx_gppi_conn_disable(peri_rad_handle); } #endif diff --git a/modules/nrfxlib/nrf_802154/sl/platform/nrf_802154_platform_sl_lptimer_zephyr.c b/modules/nrfxlib/nrf_802154/sl/platform/nrf_802154_platform_sl_lptimer_zephyr.c index c4e0c75cee1..99a2def16e7 100644 --- a/modules/nrfxlib/nrf_802154/sl/platform/nrf_802154_platform_sl_lptimer_zephyr.c +++ b/modules/nrfxlib/nrf_802154/sl/platform/nrf_802154_platform_sl_lptimer_zephyr.c @@ -139,7 +139,7 @@ static void hw_task_rtc_cc_bind_to_ppi(int32_t cc_num, uint32_t ppi_num) { uint32_t event_address = hw_task_rtc_get_compare_evt_address(cc_num); - nrfx_gppi_event_endpoint_setup(ppi_num, event_address); + nrfx_gppi_ep_to_ch_attach(event_address, ppi_num); } static void hw_task_rtc_cc_unbind(int32_t cc_num, uint32_t ppi_num) @@ -147,7 +147,7 @@ static void hw_task_rtc_cc_unbind(int32_t cc_num, uint32_t ppi_num) if (ppi_num != NRF_802154_SL_HW_TASK_PPI_INVALID) { uint32_t event_address = hw_task_rtc_get_compare_evt_address(cc_num); - nrfx_gppi_event_endpoint_clear(ppi_num, event_address); + nrfx_gppi_ep_ch_clear(event_address, ppi_num); } } @@ -426,7 +426,7 @@ nrf_802154_sl_lptimer_platform_result_t nrf_802154_platform_sl_lptimer_hw_task_p } if (ppi_channel != NRF_802154_SL_HW_TASK_PPI_INVALID) { - nrfx_gppi_event_endpoint_setup(ppi_channel, evt_address); + nrfx_gppi_ep_to_ch_attach(evt_address, ppi_channel); } m_hw_task.ppi = ppi_channel; m_hw_task.fire_lpticks = fire_lpticks; 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 fe53cc6fe9d..b9ac2aabb3f 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 @@ -227,51 +227,41 @@ void nrf_802154_platform_timestamper_local_domain_connections_setup(uint32_t dpp * {e} DPPIC_20 --> GRTC.CC */ -#include -#include +#include +#include -#define INVALID_CHANNEL UINT8_MAX - -static nrfx_dppi_t dppi20 = NRFX_DPPI_INSTANCE(20); -static nrfx_ppib_interconnect_t ppib11_21 = NRFX_PPIB_INTERCONNECT_INSTANCE(11, 21); -static uint8_t peri_dppi_ch = INVALID_CHANNEL; -static uint8_t peri_ppib_ch = INVALID_CHANNEL; +static nrfx_gppi_handle_t rad_peri_handle; void nrf_802154_platform_timestamper_cross_domain_connections_setup(void) { - nrfx_err_t err; - - err = nrfx_dppi_channel_alloc(&dppi20, &peri_dppi_ch); - __ASSERT_NO_MSG(err == NRFX_SUCCESS); - - err = nrfx_ppib_channel_alloc(&ppib11_21, &peri_ppib_ch); - __ASSERT_NO_MSG(err == NRFX_SUCCESS); - - /* {d} PPIB_21 --> DPPIC_20 */ - NRF_DPPI_ENDPOINT_SETUP( - nrfx_ppib_receive_event_address_get(&ppib11_21.right, peri_ppib_ch), peri_dppi_ch); - - /* {e} DPPIC_20[dppi_ch] --> GRTC.CC[cc_channel] */ + __ASSERT_NO_MSG(rad_peri_handle != 0); nrf_grtc_task_t capture_task = nrfy_grtc_sys_counter_capture_task_get(m_timestamp_cc_channel); - NRF_DPPI_ENDPOINT_SETUP(nrfy_grtc_task_address_get(NRF_GRTC, capture_task), peri_dppi_ch); + uint32_t tep = nrfy_grtc_task_address_get(NRF_GRTC, capture_task); + int err; + + /* Add task endpoint (GRTC capture) to the previously configured connection. */ + err = nrfx_gppi_ep_attach(tep, rad_peri_handle); + __ASSERT_NO_MSG(err == 0); - err = nrfx_dppi_channel_enable(&dppi20, peri_dppi_ch); - __ASSERT_NO_MSG(err == NRFX_SUCCESS); + nrfx_gppi_conn_enable(rad_peri_handle); } void nrf_802154_platform_timestamper_local_domain_connections_setup(uint32_t dppi_ch) { - z_nrf_grtc_timer_capture_prepare(m_timestamp_cc_channel); + nrfx_gppi_resource_t resource = { + .domain_id = NRFX_GPPI_DOMAIN_RAD, + .channel = dppi_ch + }; + int err; - /* {a} RADIO.EVENT_{?} --> DPPIC_10 - * It is the responsibility of the user of this platform to make the {a} connection - * and pass the DPPI channel number as a parameter here. + z_nrf_grtc_timer_capture_prepare(m_timestamp_cc_channel); + /* Setup a connection between Rad and Peri domain. For Rad domain use provided channel. + * Remaining resources (bridge and dppi channel in PERI) allocate dynamically. */ - - /* {b} DPPIC_10 --> PPIB_11 */ - NRF_DPPI_ENDPOINT_SETUP( - nrfx_ppib_send_task_address_get(&ppib11_21.left, peri_ppib_ch), dppi_ch); + err = nrfx_gppi_ext_conn_alloc(NRFX_GPPI_DOMAIN_RAD, NRFX_GPPI_DOMAIN_PERI, + &rad_peri_handle, &resource); + __ASSERT_NO_MSG(err == 0); } #endif From 7249a16b929d3748c30b449747c69518d794a383 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Thu, 30 Oct 2025 12:18:54 +0100 Subject: [PATCH 46/72] samples: peripheral: 802154_phy_test: Align to the new GPPI API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Align sample to the new GPPI API. Signed-off-by: Krzysztof Chruściński --- .../802154_phy_test/src/periph_proc.c | 28 ++++++++----------- .../peripheral/802154_phy_test/src/rf_proc.c | 10 ++----- 2 files changed, 14 insertions(+), 24 deletions(-) diff --git a/samples/peripheral/802154_phy_test/src/periph_proc.c b/samples/peripheral/802154_phy_test/src/periph_proc.c index e035f4e9498..70ccbf6a1cf 100644 --- a/samples/peripheral/802154_phy_test/src/periph_proc.c +++ b/samples/peripheral/802154_phy_test/src/periph_proc.c @@ -84,7 +84,7 @@ static const struct device *gpio_port1_dev = DEVICE_DT_GET(DT_NODELABEL(gpio1)); #endif #if IS_ENABLED(CONFIG_PTT_CLK_OUT) -uint8_t ppi_channel; +nrfx_gppi_handle_t ppi_handle; uint8_t task_channel; #endif /* IS_ENABLED(CONFIG_PTT_CLK_OUT) */ @@ -143,6 +143,7 @@ bool ptt_clk_out_ext(uint8_t pin, bool mode) { #if IS_ENABLED(CONFIG_PTT_CLK_OUT) uint32_t compare_evt_addr; + uint32_t tep; nrfx_err_t err; const nrfx_gpiote_t *gpiote = NRF_GPIOTE_FOR_PSEL(pin); @@ -178,35 +179,30 @@ bool ptt_clk_out_ext(uint8_t pin, bool mode) compare_evt_addr = nrfx_timer_event_address_get(&clk_timer, NRF_TIMER_EVENT_COMPARE0); - + tep = nrfx_gpiote_out_task_address_get(gpiote, pin); nrfx_gpiote_out_task_enable(gpiote, pin); /* Allocate a (D)PPI channel. */ - err = nrfx_gppi_channel_alloc(&ppi_channel); - - if (err != NRFX_SUCCESS) { + err = nrfx_gppi_conn_alloc(compare_evt_addr, tep, &ppi_handle); + if (err < 0) { LOG_ERR("(D)PPI channel allocation error: %08x", err); return false; } - nrfx_gppi_channel_endpoints_setup( - ppi_channel, compare_evt_addr, - nrf_gpiote_task_address_get(gpiote->p_reg, - nrfx_gpiote_in_event_get(gpiote, pin))); - /* Enable (D)PPI channel. */ - nrfx_gppi_channels_enable(BIT(ppi_channel)); + nrfx_gppi_conn_enable(ppi_handle); nrfx_timer_enable(&clk_timer); } else { nrfx_timer_disable(&clk_timer); nrfx_gpiote_out_task_disable(gpiote, pin); - err = nrfx_gppi_channel_free(ppi_channel); - if (err != NRFX_SUCCESS) { - LOG_ERR("Failed to disable (D)PPI channel, error: %08x", err); - return false; - } + compare_evt_addr = + nrfx_timer_event_address_get(&clk_timer, NRF_TIMER_EVENT_COMPARE0); + tep = nrfx_gpiote_out_task_address_get(gpiote, pin); + nrfx_gppi_conn_disable(ppi_handle); + nrfx_gppi_conn_free(compare_evt_addr, tep, ppi_handle); + nrfx_gpiote_pin_uninit(gpiote, pin); err = nrfx_gpiote_channel_free(gpiote, task_channel); diff --git a/samples/peripheral/802154_phy_test/src/rf_proc.c b/samples/peripheral/802154_phy_test/src/rf_proc.c index 6f024a608d1..7cde7416fdc 100644 --- a/samples/peripheral/802154_phy_test/src/rf_proc.c +++ b/samples/peripheral/802154_phy_test/src/rf_proc.c @@ -15,11 +15,7 @@ #include #endif /* IS_ENABLED(CONFIG_PTT_ANTENNA_DIVERSITY) */ -#if defined(DPPI_PRESENT) -#include -#else -#include -#endif +#include #include "nrf_802154.h" #include "nrf_802154_sl_ant_div.h" @@ -145,7 +141,6 @@ void rf_uninit(void) #if CONFIG_PTT_ANTENNA_DIVERSITY static void configure_antenna_diversity(void) { - nrf_ppi_channel_t ppi_channel; uint8_t gpiote_channel; NRF_TIMER_Type *ad_timer = NRF_TIMER3; @@ -155,8 +150,7 @@ static void configure_antenna_diversity(void) .p_timer = ad_timer }; - nrfx_ppi_channel_alloc(&ppi_channel); - cfg.ppi_ch = (uint8_t)ppi_channel; + (void)nrfx_gppi_channel_alloc(0 ,&cfg.ppi_ch); nrfx_gpiote_channel_alloc(&gpiote, &gpiote_channel); cfg.gpiote_ch = gpiote_channel; nrf_802154_sl_ant_div_mode_t ant_div_auto = 0x02; From e6cb2ea9bfd919bf2ccbfaabfbb2ff8c76888ffb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Thu, 30 Oct 2025 13:58:22 +0100 Subject: [PATCH 47/72] applications: nrf5340_audio: Rework to use GPPI API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nrfx_dppi is deprecated and nrfx_gppi need to be used. Signed-off-by: Krzysztof Chruściński --- .../nrf5340_audio/src/audio/Kconfig.defaults | 2 +- .../src/modules/audio_sync_timer.c | 119 +++++++----------- 2 files changed, 45 insertions(+), 76 deletions(-) diff --git a/applications/nrf5340_audio/src/audio/Kconfig.defaults b/applications/nrf5340_audio/src/audio/Kconfig.defaults index c89b8d23622..bede69f2039 100644 --- a/applications/nrf5340_audio/src/audio/Kconfig.defaults +++ b/applications/nrf5340_audio/src/audio/Kconfig.defaults @@ -9,5 +9,5 @@ config NRFX_TIMER default y # Audio sync timer -config NRFX_DPPI +config NRFX_GPPI default y diff --git a/applications/nrf5340_audio/src/modules/audio_sync_timer.c b/applications/nrf5340_audio/src/modules/audio_sync_timer.c index 56f5663a03f..bbdb3efd02b 100644 --- a/applications/nrf5340_audio/src/modules/audio_sync_timer.c +++ b/applications/nrf5340_audio/src/modules/audio_sync_timer.c @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include #include @@ -31,7 +31,7 @@ LOG_MODULE_REGISTER(audio_sync_timer, CONFIG_AUDIO_SYNC_TIMER_LOG_LEVEL); static nrfx_timer_t audio_sync_hf_timer_instance = NRFX_TIMER_INSTANCE(NRF_TIMER_INST_GET(AUDIO_SYNC_HF_TIMER_INSTANCE_NUMBER)); -static uint8_t dppi_channel_i2s_frame_start; +static nrfx_gppi_handle_t dppi_handle_i2s_frame_start; #define AUDIO_SYNC_LF_TIMER_INSTANCE_NUMBER 0 @@ -41,15 +41,15 @@ static uint8_t dppi_channel_i2s_frame_start; #define AUDIO_SYNC_LF_TIMER_CURR_TIME_CAPTURE NRF_RTC_TASK_CAPTURE_1 #define CC_GET_CALLS_MAX 20 -static uint8_t dppi_channel_curr_time_capture; +static nrfx_gppi_handle_t dppi_handle_curr_time_capture; static const nrfx_rtc_config_t rtc_cfg = NRFX_RTC_DEFAULT_CONFIG; static const nrfx_rtc_t audio_sync_lf_timer_instance = NRFX_RTC_INSTANCE(AUDIO_SYNC_LF_TIMER_INSTANCE_NUMBER); -static uint8_t dppi_channel_timer_sync_with_rtc; -static uint8_t dppi_channel_rtc_start; +static nrfx_gppi_handle_t dppi_handle_timer_sync_with_rtc; +static nrfx_gppi_handle_t dppi_handle_rtc_start; static volatile uint32_t num_rtc_overflows; static nrfx_timer_config_t cfg = {.frequency = NRFX_MHZ_TO_HZ(1UL), @@ -174,7 +174,7 @@ static void rtc_isr_handler(nrfx_rtc_int_type_t int_type) static int audio_sync_timer_init(void) { nrfx_err_t ret; - nrfx_dppi_t dppi = NRFX_DPPI_INSTANCE(0); + 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) { @@ -192,92 +192,61 @@ static int audio_sync_timer_init(void) nrfx_rtc_overflow_enable(&audio_sync_lf_timer_instance, true); /* Initialize capturing of I2S frame start event timestamps */ - ret = nrfx_dppi_channel_alloc(&dppi, &dppi_channel_i2s_frame_start); - if (ret - NRFX_ERROR_BASE_NUM) { + eep0 = nrf_i2s_event_address_get(NRF_I2S0, NRF_I2S_EVENT_FRAMESTART); + tep0 = nrfx_rtc_task_address_get(&audio_sync_lf_timer_instance, + AUDIO_SYNC_LF_TIMER_I2S_FRAME_START_EVT_CAPTURE); + tep1 = nrfx_timer_task_address_get(&audio_sync_hf_timer_instance, + AUDIO_SYNC_HF_TIMER_I2S_FRAME_START_EVT_CAPTURE); + + ret = nrfx_gppi_conn_alloc(eep0, tep0, &dppi_handle_i2s_frame_start); + if (ret < 0) { LOG_ERR("nrfx DPPI channel alloc error (I2S frame start): %d", ret); - return -ENOMEM; + return ret; } - nrf_timer_subscribe_set(audio_sync_hf_timer_instance.p_reg, - AUDIO_SYNC_HF_TIMER_I2S_FRAME_START_EVT_CAPTURE, - dppi_channel_i2s_frame_start); - - /* Initialize capturing of I2S frame start event timestamps at the RTC as well. */ - nrf_rtc_subscribe_set(audio_sync_lf_timer_instance.p_reg, - AUDIO_SYNC_LF_TIMER_I2S_FRAME_START_EVT_CAPTURE, - dppi_channel_i2s_frame_start); - - nrf_i2s_publish_set(NRF_I2S0, NRF_I2S_EVENT_FRAMESTART, dppi_channel_i2s_frame_start); - ret = nrfx_dppi_channel_enable(&dppi, dppi_channel_i2s_frame_start); - if (ret - NRFX_ERROR_BASE_NUM) { - LOG_ERR("nrfx DPPI channel enable error (I2S frame start): %d", ret); - return -EIO; - } + nrfx_gppi_ep_attach(tep1, dppi_handle_i2s_frame_start); + nrfx_gppi_conn_enable(dppi_handle_i2s_frame_start); /* Initialize capturing of current timestamps */ - ret = nrfx_dppi_channel_alloc(&dppi, &dppi_channel_curr_time_capture); - if (ret - NRFX_ERROR_BASE_NUM) { + eep0 = nrf_egu_event_address_get(NRF_EGU0, NRF_EGU_EVENT_TRIGGERED0); + tep0 = nrfx_rtc_task_address_get(&audio_sync_lf_timer_instance, + AUDIO_SYNC_LF_TIMER_CURR_TIME_CAPTURE); + tep1 = nrfx_timer_task_address_get(&audio_sync_hf_timer_instance, + AUDIO_SYNC_HF_TIMER_CURR_TIME_CAPTURE); + + ret = nrfx_gppi_conn_alloc(eep0, tep0, &dppi_handle_curr_time_capture); + if (ret < 0) { LOG_ERR("nrfx DPPI channel alloc error (I2S frame start): %d", ret); - return -ENOMEM; - } - - nrf_rtc_subscribe_set(audio_sync_lf_timer_instance.p_reg, - AUDIO_SYNC_LF_TIMER_CURR_TIME_CAPTURE, - dppi_channel_curr_time_capture); - - nrf_timer_subscribe_set(audio_sync_hf_timer_instance.p_reg, - AUDIO_SYNC_HF_TIMER_CURR_TIME_CAPTURE, - dppi_channel_curr_time_capture); - - nrf_egu_publish_set(NRF_EGU0, NRF_EGU_EVENT_TRIGGERED0, dppi_channel_curr_time_capture); - - ret = nrfx_dppi_channel_enable(&dppi, dppi_channel_curr_time_capture); - if (ret - NRFX_ERROR_BASE_NUM) { - LOG_ERR("nrfx DPPI channel enable error (I2S frame start): %d", ret); - return -EIO; + return ret; } + nrfx_gppi_ep_attach(tep1, dppi_handle_curr_time_capture); + nrfx_gppi_conn_enable(dppi_handle_curr_time_capture); /* Initialize functionality for synchronization between APP and NET core */ - ret = nrfx_dppi_channel_alloc(&dppi, &dppi_channel_rtc_start); - if (ret - NRFX_ERROR_BASE_NUM) { - LOG_ERR("nrfx DPPI channel alloc error (timer clear): %d", ret); - return -ENOMEM; + eep0 = nrf_ipc_event_address_get(NRF_IPC, AUDIO_SYNC_TIMER_NET_APP_IPC_EVT); + tep0 = nrfx_rtc_task_address_get(&audio_sync_lf_timer_instance, NRF_RTC_TASK_CLEAR); + tep1 = nrfx_timer_task_address_get(&audio_sync_hf_timer_instance, NRF_TIMER_TASK_START); + ret = nrfx_gppi_conn_alloc(eep0, tep0, &dppi_handle_rtc_start); + if (ret < 0) { + LOG_ERR("nrfx DPPI channel alloc error (I2S frame start): %d", ret); + return ret; } - - nrf_rtc_subscribe_set(audio_sync_lf_timer_instance.p_reg, NRF_RTC_TASK_CLEAR, - dppi_channel_rtc_start); - nrf_timer_subscribe_set(audio_sync_hf_timer_instance.p_reg, NRF_TIMER_TASK_START, - dppi_channel_rtc_start); - + nrfx_gppi_ep_attach(tep1, dppi_handle_rtc_start); nrf_ipc_receive_config_set(NRF_IPC, AUDIO_SYNC_TIMER_NET_APP_IPC_EVT_CHANNEL, NRF_IPC_CHANNEL_4); - nrf_ipc_publish_set(NRF_IPC, AUDIO_SYNC_TIMER_NET_APP_IPC_EVT, dppi_channel_rtc_start); - - ret = nrfx_dppi_channel_enable(&dppi, dppi_channel_rtc_start); - if (ret - NRFX_ERROR_BASE_NUM) { - LOG_ERR("nrfx DPPI channel enable error (timer clear): %d", ret); - return -EIO; - } + nrfx_gppi_conn_enable(dppi_handle_rtc_start); /* Initialize functionality for synchronization between RTC and TIMER */ - ret = nrfx_dppi_channel_alloc(&dppi, &dppi_channel_timer_sync_with_rtc); - if (ret - NRFX_ERROR_BASE_NUM) { - LOG_ERR("nrfx DPPI channel alloc error (timer clear): %d", ret); - return -ENOMEM; + eep0 = nrfx_rtc_event_address_get(&audio_sync_lf_timer_instance, NRF_RTC_EVENT_TICK); + tep0 = nrfx_timer_task_address_get(&audio_sync_hf_timer_instance, NRF_TIMER_TASK_CLEAR); + ret = nrfx_gppi_conn_alloc(eep0, tep0, &dppi_handle_timer_sync_with_rtc); + if (ret < 0) { + LOG_ERR("nrfx DPPI channel alloc error (I2S frame start): %d", ret); + return ret; } - nrf_rtc_publish_set(audio_sync_lf_timer_instance.p_reg, NRF_RTC_EVENT_TICK, - dppi_channel_timer_sync_with_rtc); - nrf_timer_subscribe_set(audio_sync_hf_timer_instance.p_reg, NRF_TIMER_TASK_CLEAR, - dppi_channel_timer_sync_with_rtc); - nrfx_rtc_tick_enable(&audio_sync_lf_timer_instance, false); - - ret = nrfx_dppi_channel_enable(&dppi, dppi_channel_timer_sync_with_rtc); - if (ret - NRFX_ERROR_BASE_NUM) { - LOG_ERR("nrfx DPPI channel enable error (timer clear): %d", ret); - return -EIO; - } + nrfx_gppi_conn_enable(dppi_handle_timer_sync_with_rtc); nrfx_rtc_enable(&audio_sync_lf_timer_instance); From ab1eac1fe7fdb28a600b4af7e9c5a4012a185562 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Fri, 31 Oct 2025 07:59:51 +0100 Subject: [PATCH 48/72] tests: drivers: i2c: i2c_latency: Align to changes in nrfx_twis MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CONFIG_NRFX_TWIXxx options has been removed. Aligning test to not use those. Signed-off-by: Krzysztof Chruściński --- .../boards/nrf52840dk_nrf52840.conf | 1 - .../boards/nrf5340dk_nrf5340_cpuapp.conf | 1 - .../boards/nrf54h20dk_nrf54h20_cpuapp.conf | 1 - .../boards/nrf54l15dk_nrf54l15_cpuapp.conf | 1 - tests/drivers/i2c/i2c_latency/prj.conf | 1 + tests/drivers/i2c/i2c_latency/src/main.c | 20 +++++-------------- 6 files changed, 6 insertions(+), 19 deletions(-) delete mode 100644 tests/drivers/i2c/i2c_latency/boards/nrf52840dk_nrf52840.conf delete mode 100644 tests/drivers/i2c/i2c_latency/boards/nrf5340dk_nrf5340_cpuapp.conf delete mode 100644 tests/drivers/i2c/i2c_latency/boards/nrf54h20dk_nrf54h20_cpuapp.conf delete mode 100644 tests/drivers/i2c/i2c_latency/boards/nrf54l15dk_nrf54l15_cpuapp.conf diff --git a/tests/drivers/i2c/i2c_latency/boards/nrf52840dk_nrf52840.conf b/tests/drivers/i2c/i2c_latency/boards/nrf52840dk_nrf52840.conf deleted file mode 100644 index e79ad7a8126..00000000000 --- a/tests/drivers/i2c/i2c_latency/boards/nrf52840dk_nrf52840.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_NRFX_TWIS1=y diff --git a/tests/drivers/i2c/i2c_latency/boards/nrf5340dk_nrf5340_cpuapp.conf b/tests/drivers/i2c/i2c_latency/boards/nrf5340dk_nrf5340_cpuapp.conf deleted file mode 100644 index a7bedf1f04b..00000000000 --- a/tests/drivers/i2c/i2c_latency/boards/nrf5340dk_nrf5340_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_NRFX_TWIS2=y diff --git a/tests/drivers/i2c/i2c_latency/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/tests/drivers/i2c/i2c_latency/boards/nrf54h20dk_nrf54h20_cpuapp.conf deleted file mode 100644 index 157e0a11f72..00000000000 --- a/tests/drivers/i2c/i2c_latency/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_NRFX_TWIS131=y diff --git a/tests/drivers/i2c/i2c_latency/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/tests/drivers/i2c/i2c_latency/boards/nrf54l15dk_nrf54l15_cpuapp.conf deleted file mode 100644 index b01af3b36a7..00000000000 --- a/tests/drivers/i2c/i2c_latency/boards/nrf54l15dk_nrf54l15_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_NRFX_TWIS22=y diff --git a/tests/drivers/i2c/i2c_latency/prj.conf b/tests/drivers/i2c/i2c_latency/prj.conf index e5150a091a0..90c67749631 100644 --- a/tests/drivers/i2c/i2c_latency/prj.conf +++ b/tests/drivers/i2c/i2c_latency/prj.conf @@ -1,4 +1,5 @@ CONFIG_I2C=y +CONFIG_NRFX_TWIS=y CONFIG_ZTEST=y CONFIG_DK_LIBRARY=y diff --git a/tests/drivers/i2c/i2c_latency/src/main.c b/tests/drivers/i2c/i2c_latency/src/main.c index 9f3528cfaff..d2736fce04c 100644 --- a/tests/drivers/i2c/i2c_latency/src/main.c +++ b/tests/drivers/i2c/i2c_latency/src/main.c @@ -18,18 +18,6 @@ #include -#if CONFIG_NRFX_TWIS1 -#define I2C_S_INSTANCE 1 -#elif CONFIG_NRFX_TWIS2 -#define I2C_S_INSTANCE 2 -#elif CONFIG_NRFX_TWIS22 -#define I2C_S_INSTANCE 22 -#elif CONFIG_NRFX_TWIS131 -#define I2C_S_INSTANCE 131 -#else -#error "TWIS instance not enabled or not supported" -#endif - #define NODE_TWIM DT_NODELABEL(sensor) #define NODE_TWIS DT_ALIAS(i2c_slave) #define MEASUREMENT_REPEATS 10 @@ -42,7 +30,9 @@ #define TEST_TIMER_COUNT_TIME_LIMIT_MS 500 #define MAX_TEST_DATA_SIZE 255 -static const nrfx_twis_t twis = NRFX_TWIS_INSTANCE(I2C_S_INSTANCE); +static nrfx_twis_t twis = { + .p_reg = (NRF_TWIS_Type *)DT_REG_ADDR(NODE_TWIS) +}; const struct device *const tst_timer_dev = DEVICE_DT_GET(DT_ALIAS(tst_timer)); static uint8_t i2c_slave_buffer[MAX_TEST_DATA_SIZE] TWIS_MEMORY_SECTION; @@ -143,7 +133,7 @@ static void assess_measurement_result(uint64_t timer_value_us, "Measured call latency is over the specified limit"); } -static void i2s_slave_handler(nrfx_twis_evt_t const *p_event) +static void i2s_slave_handler(nrfx_twis_event_t const *p_event) { switch (p_event->type) { case NRFX_TWIS_EVT_READ_REQ: @@ -182,7 +172,7 @@ static void *test_setup(void) zassert_ok(ret); IRQ_CONNECT(DT_IRQN(NODE_TWIS), DT_IRQ(NODE_TWIS, priority), - NRFX_TWIS_INST_HANDLER_GET(I2C_S_INSTANCE), NULL, 0); + nrfx_twis_irq_handler, &twis, 0); nrfx_twis_enable(&twis); From 931968fc8e15e1db3111f8f06373f67f6da8cb4e Mon Sep 17 00:00:00 2001 From: Nikodem Kastelik Date: Thu, 30 Oct 2025 20:23:14 +0100 Subject: [PATCH 49/72] tests: modules: mcuboot: external_flash: disable gpio interrupts They are not needed by the test and consumes Flash. Signed-off-by: Nikodem Kastelik --- tests/modules/mcuboot/external_flash/sysbuild/mcuboot/prj.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/modules/mcuboot/external_flash/sysbuild/mcuboot/prj.conf b/tests/modules/mcuboot/external_flash/sysbuild/mcuboot/prj.conf index fdf7d8f40dd..977115b726d 100644 --- a/tests/modules/mcuboot/external_flash/sysbuild/mcuboot/prj.conf +++ b/tests/modules/mcuboot/external_flash/sysbuild/mcuboot/prj.conf @@ -21,3 +21,6 @@ CONFIG_BOOT_MAX_IMG_SECTORS=256 CONFIG_UART_CONSOLE=n CONFIG_MCUBOOT_SERIAL=y CONFIG_MCUBOOT_SERIAL_DIRECT_IMAGE_UPLOAD=y + +# Reduce GPIO driver size +CONFIG_GPIO_NRFX_INTERRUPT=n From b628bc56e5e879e91264cdc01e7198c287da6f93 Mon Sep 17 00:00:00 2001 From: Nikodem Kastelik Date: Tue, 28 Oct 2025 18:23:49 +0100 Subject: [PATCH 50/72] drivers: serial: lpuart: align to nrfx_gpiote changes GPIOTE driver instances are no longer defined within nrfx. Signed-off-by: Nikodem Kastelik --- drivers/serial/uart_nrf_sw_lpuart.c | 50 +++++++++++++++-------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/drivers/serial/uart_nrf_sw_lpuart.c b/drivers/serial/uart_nrf_sw_lpuart.c index 13927c1c4aa..2514517ae4d 100644 --- a/drivers/serial/uart_nrf_sw_lpuart.c +++ b/drivers/serial/uart_nrf_sw_lpuart.c @@ -6,9 +6,11 @@ #include #include +#include #include #include #include +#include #include #include #include @@ -132,18 +134,18 @@ static inline const struct lpuart_config *get_dev_config(const struct device *de } #define GPIOTE_NODE(gpio_node) DT_PHANDLE(gpio_node, gpiote_instance) -#define GPIOTE_INST_AND_COMMA(gpio_node) \ - IF_ENABLED(DT_NODE_HAS_PROP(gpio_node, gpiote_instance), ( \ - [DT_PROP(gpio_node, port)] = \ - NRFX_GPIOTE_INSTANCE(DT_PROP(GPIOTE_NODE(gpio_node), instance)),)) +#define GPIOTE_INST_AND_COMMA(gpio_node) [DT_PROP(gpio_node, port)] = \ + COND_CODE_1(DT_NODE_HAS_PROP(gpio_node, gpiote_instance), \ + (&GPIOTE_NRFX_INST_BY_NODE(GPIOTE_NODE(gpio_node))), \ + (NULL)), -static const nrfx_gpiote_t *get_gpiote(nrfx_gpiote_pin_t pin) +static nrfx_gpiote_t *get_gpiote(nrfx_gpiote_pin_t pin) { - static const nrfx_gpiote_t gpiote[GPIO_COUNT] = { + static nrfx_gpiote_t * const gpiote_per_port[GPIO_COUNT] = { DT_FOREACH_STATUS_OKAY(nordic_nrf_gpio, GPIOTE_INST_AND_COMMA) }; - return &gpiote[pin >> 5]; + return gpiote_per_port[NRF_PIN_NUMBER_TO_PORT(pin)]; } /* Called when uart transfer is finished to indicate to the receiver that it @@ -194,7 +196,7 @@ static void req_pin_arm(struct lpuart_data *data) static int req_pin_init(struct lpuart_data *data, nrfx_gpiote_pin_t pin) { uint8_t ch; - nrfx_err_t err; + int err; nrf_gpio_pin_pull_t pull_config = NRF_GPIO_PIN_PULLDOWN; nrfx_gpiote_trigger_config_t trigger_config = { .trigger = NRFX_GPIOTE_TRIGGER_HITOLO, @@ -211,13 +213,13 @@ static int req_pin_init(struct lpuart_data *data, nrfx_gpiote_pin_t pin) }; err = nrfx_gpiote_channel_alloc(get_gpiote(pin), &ch); - if (err != NRFX_SUCCESS) { - return -ENOMEM; + if (err < 0) { + return err; } err = nrfx_gpiote_input_configure(get_gpiote(pin), pin, &input_config); - if (err != NRFX_SUCCESS) { - return -EINVAL; + if (err < 0) { + return err; } data->req_pin = pin; @@ -238,7 +240,7 @@ static void rdy_pin_suspend(struct lpuart_data *data) static int rdy_pin_init(struct lpuart_data *data, nrfx_gpiote_pin_t pin) { - nrfx_err_t err; + int err; nrf_gpio_pin_pull_t pull_config = NRF_GPIO_PIN_NOPULL; nrfx_gpiote_handler_config_t handler_config = { .handler = rdy_pin_handler, @@ -251,14 +253,14 @@ static int rdy_pin_init(struct lpuart_data *data, nrfx_gpiote_pin_t pin) }; err = nrfx_gpiote_channel_alloc(get_gpiote(pin), &data->rdy_ch); - if (err != NRFX_SUCCESS) { - return -ENOMEM; + if (err < 0) { + return err; } err = nrfx_gpiote_input_configure(get_gpiote(pin), pin, &input_config); - if (err != NRFX_SUCCESS) { - LOG_ERR("err:%08x", err); - return -EINVAL; + if (err < 0) { + LOG_ERR("err: %d", err); + return err; } data->rdy_pin = pin; @@ -270,7 +272,7 @@ static int rdy_pin_init(struct lpuart_data *data, nrfx_gpiote_pin_t pin) /* Pin activated to detect high state (using SENSE). */ static void rdy_pin_idle(struct lpuart_data *data) { - nrfx_err_t err; + int err; nrfx_gpiote_trigger_config_t trigger_config = { .trigger = NRFX_GPIOTE_TRIGGER_HIGH }; @@ -279,10 +281,10 @@ static void rdy_pin_idle(struct lpuart_data *data) .p_trigger_config = &trigger_config, .p_handler_config = NULL }; - const nrfx_gpiote_t *gpiote = get_gpiote(data->rdy_pin); + nrfx_gpiote_t *gpiote = get_gpiote(data->rdy_pin); err = nrfx_gpiote_input_configure(gpiote, data->rdy_pin, &input_config); - __ASSERT(err == NRFX_SUCCESS, "Unexpected err: %08x/%d", err, err); + __ASSERT(err == 0, "Unexpected err: %d", err); nrfx_gpiote_trigger_enable(gpiote, data->rdy_pin, true); } @@ -295,7 +297,7 @@ static void rdy_pin_idle(struct lpuart_data *data) */ static bool rdy_pin_blink(struct lpuart_data *data) { - nrfx_err_t err; + int err; nrfx_gpiote_trigger_config_t trigger_config = { .trigger = NRFX_GPIOTE_TRIGGER_HITOLO, .p_in_channel = &data->rdy_ch @@ -307,14 +309,14 @@ static bool rdy_pin_blink(struct lpuart_data *data) }; const nrf_gpio_pin_dir_t dir_in = NRF_GPIO_PIN_DIR_INPUT; const nrf_gpio_pin_dir_t dir_out = NRF_GPIO_PIN_DIR_OUTPUT; - const nrfx_gpiote_t *gpiote = get_gpiote(data->rdy_pin); + nrfx_gpiote_t *gpiote = get_gpiote(data->rdy_pin); bool ret; /* Drive low for a moment */ nrf_gpio_reconfigure(data->rdy_pin, &dir_out, NULL, NULL, NULL, NULL); err = nrfx_gpiote_input_configure(gpiote, data->rdy_pin, &input_config); - __ASSERT(err == NRFX_SUCCESS, "Unexpected err: %08x/%d", err, err); + __ASSERT(err == 0, "Unexpected err: %d", err); nrfx_gpiote_trigger_enable(gpiote, data->rdy_pin, true); From 1bbfbb425f46af9182cd653c18b24adc1246aca5 Mon Sep 17 00:00:00 2001 From: Nikodem Kastelik Date: Thu, 30 Oct 2025 13:30:56 +0100 Subject: [PATCH 51/72] samples: bluetooth: time_sync: align to nrfx_gpiote changes GPIOTE driver instances are no longer defined within nrfx. Signed-off-by: Nikodem Kastelik --- .../conn_time_sync/src/timed_led_toggle.c | 17 +++++++---------- .../iso_time_sync/src/timed_led_toggle.c | 17 +++++++---------- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/samples/bluetooth/conn_time_sync/src/timed_led_toggle.c b/samples/bluetooth/conn_time_sync/src/timed_led_toggle.c index 3185ed80d84..54127c71b88 100644 --- a/samples/bluetooth/conn_time_sync/src/timed_led_toggle.c +++ b/samples/bluetooth/conn_time_sync/src/timed_led_toggle.c @@ -15,17 +15,13 @@ #include #include #include +#include #include #include "conn_time_sync.h" -#define GPIOTE_INST NRF_DT_GPIOTE_INST(DT_ALIAS(led1), gpios) -#define GPIOTE_NODE DT_NODELABEL(_CONCAT(gpiote, GPIOTE_INST)) +#define GPIOTE_NODE NRF_DT_GPIOTE_NODE(DT_ALIAS(led1), gpios) #define LED_PIN NRF_DT_GPIOS_TO_PSEL(DT_ALIAS(led1), gpios) -BUILD_ASSERT(IS_ENABLED(_CONCAT(CONFIG_, _CONCAT(NRFX_GPIOTE, GPIOTE_INST))), - "NRFX_GPIOTE" STRINGIFY(GPIOTE_INST) " must be enabled in Kconfig"); - -static const nrfx_gpiote_t gpiote = NRFX_GPIOTE_INSTANCE(GPIOTE_INST); static struct gpio_dt_spec led = GPIO_DT_SPEC_GET_OR(DT_ALIAS(led1), gpios, {0}); static uint8_t previous_led_value; @@ -35,6 +31,7 @@ int timed_led_toggle_init(void) int err; nrfx_gppi_handle_t ppi_led_toggle; uint8_t gpiote_chan_led_toggle; + nrfx_gpiote_t *gpiote = &GPIOTE_NRFX_INST_BY_NODE(GPIOTE_NODE); const nrfx_gpiote_output_config_t gpiote_output_cfg = NRFX_GPIOTE_DEFAULT_OUTPUT_CONFIG; @@ -45,7 +42,7 @@ int timed_led_toggle_init(void) return err; } - if (nrfx_gpiote_channel_alloc(&gpiote, &gpiote_chan_led_toggle) != NRFX_SUCCESS) { + if (nrfx_gpiote_channel_alloc(gpiote, &gpiote_chan_led_toggle) != 0) { printk("Failed allocating GPIOTE chan for setting led\n"); return -ENOMEM; } @@ -57,8 +54,8 @@ int timed_led_toggle_init(void) NRF_GPIOTE_INITIAL_VALUE_HIGH : NRF_GPIOTE_INITIAL_VALUE_LOW, }; - if (nrfx_gpiote_output_configure(&gpiote, LED_PIN, &gpiote_output_cfg, - &task_cfg_led_toggle) != NRFX_SUCCESS) { + if (nrfx_gpiote_output_configure(gpiote, LED_PIN, &gpiote_output_cfg, + &task_cfg_led_toggle) != 0) { printk("Failed configuring GPIOTE chan for toggling led\n"); return -ENOMEM; } @@ -72,7 +69,7 @@ int timed_led_toggle_init(void) } nrfx_gppi_conn_enable(ppi_led_toggle); - nrfx_gpiote_out_task_enable(&gpiote, LED_PIN); + nrfx_gpiote_out_task_enable(gpiote, LED_PIN); return 0; } diff --git a/samples/bluetooth/iso_time_sync/src/timed_led_toggle.c b/samples/bluetooth/iso_time_sync/src/timed_led_toggle.c index 74e2613ad8f..d8391c3d349 100644 --- a/samples/bluetooth/iso_time_sync/src/timed_led_toggle.c +++ b/samples/bluetooth/iso_time_sync/src/timed_led_toggle.c @@ -15,17 +15,13 @@ #include #include #include +#include #include #include "iso_time_sync.h" -#define GPIOTE_INST NRF_DT_GPIOTE_INST(DT_ALIAS(led1), gpios) -#define GPIOTE_NODE DT_NODELABEL(_CONCAT(gpiote, GPIOTE_INST)) +#define GPIOTE_NODE NRF_DT_GPIOTE_NODE(DT_ALIAS(led1), gpios) #define LED_PIN NRF_DT_GPIOS_TO_PSEL(DT_ALIAS(led1), gpios) -BUILD_ASSERT(IS_ENABLED(_CONCAT(CONFIG_, _CONCAT(NRFX_GPIOTE, GPIOTE_INST))), - "NRFX_GPIOTE" STRINGIFY(GPIOTE_INST) " must be enabled in Kconfig"); - -static const nrfx_gpiote_t gpiote = NRFX_GPIOTE_INSTANCE(GPIOTE_INST); static struct gpio_dt_spec led = GPIO_DT_SPEC_GET_OR(DT_ALIAS(led1), gpios, {0}); static uint8_t previous_led_value; @@ -35,6 +31,7 @@ int timed_led_toggle_init(void) int err; nrfx_gppi_handle_t ppi_led_toggle; uint8_t gpiote_chan_led_toggle; + nrfx_gpiote_t *gpiote = &GPIOTE_NRFX_INST_BY_NODE(GPIOTE_NODE); const nrfx_gpiote_output_config_t gpiote_output_cfg = NRFX_GPIOTE_DEFAULT_OUTPUT_CONFIG; @@ -45,7 +42,7 @@ int timed_led_toggle_init(void) return err; } - if (nrfx_gpiote_channel_alloc(&gpiote, &gpiote_chan_led_toggle) != NRFX_SUCCESS) { + if (nrfx_gpiote_channel_alloc(gpiote, &gpiote_chan_led_toggle) != 0) { printk("Failed allocating GPIOTE chan for setting led\n"); return -ENOMEM; } @@ -57,8 +54,8 @@ int timed_led_toggle_init(void) NRF_GPIOTE_INITIAL_VALUE_HIGH : NRF_GPIOTE_INITIAL_VALUE_LOW, }; - if (nrfx_gpiote_output_configure(&gpiote, LED_PIN, &gpiote_output_cfg, - &task_cfg_led_toggle) != NRFX_SUCCESS) { + if (nrfx_gpiote_output_configure(gpiote, LED_PIN, &gpiote_output_cfg, + &task_cfg_led_toggle) != 0) { printk("Failed configuring GPIOTE chan for toggling led\n"); return -ENOMEM; } @@ -72,7 +69,7 @@ int timed_led_toggle_init(void) } nrfx_gppi_conn_enable(ppi_led_toggle); - nrfx_gpiote_out_task_enable(&gpiote, LED_PIN); + nrfx_gpiote_out_task_enable(gpiote, LED_PIN); return 0; } From a9e78ebf4bd8acb53ca730356f7ad595dc73ea88 Mon Sep 17 00:00:00 2001 From: Nikodem Kastelik Date: Thu, 30 Oct 2025 13:31:50 +0100 Subject: [PATCH 52/72] samples: peripheral: 802154_phy_test: align to nrfx_gpiote changes GPIOTE driver instances are no longer defined within nrfx. Signed-off-by: Nikodem Kastelik --- .../802154_phy_test/src/periph_proc.c | 51 ++++++++----------- .../peripheral/802154_phy_test/src/rf_proc.c | 10 ++-- 2 files changed, 25 insertions(+), 36 deletions(-) diff --git a/samples/peripheral/802154_phy_test/src/periph_proc.c b/samples/peripheral/802154_phy_test/src/periph_proc.c index 70ccbf6a1cf..6a4854d9aee 100644 --- a/samples/peripheral/802154_phy_test/src/periph_proc.c +++ b/samples/peripheral/802154_phy_test/src/periph_proc.c @@ -24,6 +24,7 @@ #if IS_ENABLED(CONFIG_PTT_CLK_OUT) #include +#include #endif /* IS_ENABLED(CONFIG_PTT_CLK_OUT) */ #if defined(CONFIG_PTT_CACHE_MGMT) @@ -52,26 +53,18 @@ LOG_MODULE_REGISTER(periph); static nrfx_timer_t clk_timer = NRFX_TIMER_INSTANCE(NRF_TIMER_INST_GET(PTT_CLK_TIMER)); #define GPIOTE_NODE(gpio_node) DT_PHANDLE(gpio_node, gpiote_instance) -#define GPIOTE_INST_AND_COMMA(gpio_node) \ - [DT_PROP(gpio_node, port)] = \ - NRFX_GPIOTE_INSTANCE(DT_PROP(GPIOTE_NODE(gpio_node), instance)), +#define GPIOTE_INST_AND_COMMA(gpio_node) [DT_PROP(gpio_node, port)] = \ + COND_CODE_1(DT_NODE_HAS_PROP(gpio_node, gpiote_instance), \ + (&GPIOTE_NRFX_INST_BY_NODE(GPIOTE_NODE(gpio_node))), \ + (NULL)), -#define COND_GPIOTE_INST_AND_COMMA(gpio_node) \ - COND_CODE_1(DT_NODE_HAS_PROP(gpio_node, gpiote_instance), \ - (GPIOTE_INST_AND_COMMA(gpio_node)), \ - ()) - -static const nrfx_gpiote_t gpiote_inst[GPIO_COUNT] = { - DT_FOREACH_STATUS_OKAY(nordic_nrf_gpio, COND_GPIOTE_INST_AND_COMMA) +static nrfx_gpiote_t * const gpiote_inst[GPIO_COUNT] = { + DT_FOREACH_STATUS_OKAY(nordic_nrf_gpio, GPIOTE_INST_AND_COMMA) }; -#define NRF_GPIOTE_FOR_GPIO(idx) &gpiote_inst[idx] -#define NRF_GPIOTE_FOR_PSEL(psel) &gpiote_inst[psel >> 5] +#define NRF_GPIOTE_FOR_GPIO(idx) gpiote_inst[idx] +#define NRF_GPIOTE_FOR_PSEL(psel) gpiote_inst[NRF_PIN_NUMBER_TO_PORT(psel)] -static inline bool gpiote_is_valid(const nrfx_gpiote_t *gpiote) -{ - return gpiote->p_reg != NULL; -} #endif /* IS_ENABLED(CONFIG_PTT_CLK_OUT) */ #define CLOCK_NODE DT_INST(0, nordic_nrf_clock) @@ -100,7 +93,7 @@ void periph_init(void) int ret; #if IS_ENABLED(CONFIG_PTT_CLK_OUT) - nrfx_err_t err_code; + int err_code; uint32_t base_frequency = NRF_TIMER_BASE_FREQUENCY_GET(clk_timer.p_reg); nrfx_timer_config_t clk_timer_cfg = NRFX_TIMER_DEFAULT_CONFIG(base_frequency); @@ -109,15 +102,15 @@ void periph_init(void) NRFX_ASSERT(err_code); for (int i = 0; i < GPIO_COUNT; ++i) { - const nrfx_gpiote_t *gpiote = NRF_GPIOTE_FOR_GPIO(i); + nrfx_gpiote_t *gpiote = NRF_GPIOTE_FOR_GPIO(i); - if (!gpiote_is_valid(gpiote)) { + if (gpiote == NULL) { continue; } if (!nrfx_gpiote_init_check(gpiote)) { err_code = nrfx_gpiote_init(gpiote, 0); - NRFX_ASSERT(err_code); + __ASSERT_NO_MSG(err_code == 0); } } #endif @@ -144,10 +137,10 @@ bool ptt_clk_out_ext(uint8_t pin, bool mode) #if IS_ENABLED(CONFIG_PTT_CLK_OUT) uint32_t compare_evt_addr; uint32_t tep; - nrfx_err_t err; - const nrfx_gpiote_t *gpiote = NRF_GPIOTE_FOR_PSEL(pin); + int err; + nrfx_gpiote_t *gpiote = NRF_GPIOTE_FOR_PSEL(pin); - if (!nrf_gpio_pin_present_check(pin) || !gpiote_is_valid(gpiote)) { + if (!nrf_gpio_pin_present_check(pin) || (gpiote == NULL)) { return false; } @@ -156,8 +149,8 @@ bool ptt_clk_out_ext(uint8_t pin, bool mode) NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK, false); err = nrfx_gpiote_channel_alloc(gpiote, &task_channel); - if (err != NRFX_SUCCESS) { - LOG_ERR("nrfx_gpiote_channel_alloc error: %08x", err); + if (err != 0) { + LOG_ERR("nrfx_gpiote_channel_alloc error: %d", err); return false; } @@ -172,8 +165,8 @@ bool ptt_clk_out_ext(uint8_t pin, bool mode) * CLR will turn it off and OUT will toggle it. */ err = nrfx_gpiote_output_configure(gpiote, pin, &config, &out_config); - if (err != NRFX_SUCCESS) { - LOG_ERR("nrfx_gpiote_output_configure error: %08x", err); + if (err != 0) { + LOG_ERR("nrfx_gpiote_output_configure error: %d", err); return false; } @@ -206,8 +199,8 @@ bool ptt_clk_out_ext(uint8_t pin, bool mode) nrfx_gpiote_pin_uninit(gpiote, pin); err = nrfx_gpiote_channel_free(gpiote, task_channel); - if (err != NRFX_SUCCESS) { - LOG_ERR("Failed to disable GPIOTE channel, error: %08x", err); + if (err != 0) { + LOG_ERR("Failed to disable GPIOTE channel, error: %d", err); return false; } } diff --git a/samples/peripheral/802154_phy_test/src/rf_proc.c b/samples/peripheral/802154_phy_test/src/rf_proc.c index 7cde7416fdc..e167e295cd9 100644 --- a/samples/peripheral/802154_phy_test/src/rf_proc.c +++ b/samples/peripheral/802154_phy_test/src/rf_proc.c @@ -13,6 +13,7 @@ #if IS_ENABLED(CONFIG_PTT_ANTENNA_DIVERSITY) #include +#include #endif /* IS_ENABLED(CONFIG_PTT_ANTENNA_DIVERSITY) */ #include @@ -34,10 +35,6 @@ static struct rf_rx_pkt_s rf_rx_pool[RF_RX_POOL_N]; static struct rf_rx_pkt_s ack_packet; static uint8_t temp_tx_pkt[RF_PSDU_MAX_SIZE]; -#ifdef CONFIG_PTT_ANTENNA_DIVERSITY -static const nrfx_gpiote_t gpiote = NRFX_GPIOTE_INSTANCE(0); -#endif - static inline void rf_rx_pool_init(void); static void rf_rx_pool_clear(void); @@ -141,7 +138,7 @@ void rf_uninit(void) #if CONFIG_PTT_ANTENNA_DIVERSITY static void configure_antenna_diversity(void) { - uint8_t gpiote_channel; + nrfx_gpiote_t *gpiote = &GPIOTE_NRFX_INST_BY_NODE(DT_NODELABEL(gpiote0)); NRF_TIMER_Type *ad_timer = NRF_TIMER3; nrf_802154_sl_ant_div_cfg_t cfg = { @@ -151,8 +148,7 @@ static void configure_antenna_diversity(void) }; (void)nrfx_gppi_channel_alloc(0 ,&cfg.ppi_ch); - nrfx_gpiote_channel_alloc(&gpiote, &gpiote_channel); - cfg.gpiote_ch = gpiote_channel; + (void)nrfx_gpiote_channel_alloc(gpiote, &cfg.gpiote_ch); nrf_802154_sl_ant_div_mode_t ant_div_auto = 0x02; nrf_802154_antenna_diversity_config_set(&cfg); From 6e5ef3158f81d836b2ebbddfc446ba23defc807b Mon Sep 17 00:00:00 2001 From: Nikodem Kastelik Date: Thu, 30 Oct 2025 13:32:28 +0100 Subject: [PATCH 53/72] debug: ppi_trace: align to nrfx_gpiote changes GPIOTE driver instances are no longer defined within nrfx. Signed-off-by: Nikodem Kastelik --- subsys/debug/ppi_trace/ppi_trace.c | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/subsys/debug/ppi_trace/ppi_trace.c b/subsys/debug/ppi_trace/ppi_trace.c index 05d2c3c7146..ce1294de85f 100644 --- a/subsys/debug/ppi_trace/ppi_trace.c +++ b/subsys/debug/ppi_trace/ppi_trace.c @@ -6,6 +6,7 @@ #include #include +#include #include #include @@ -14,36 +15,26 @@ LOG_MODULE_REGISTER(ppi_trace, CONFIG_PPI_TRACE_LOG_LEVEL); #define GPIOTE_NODE(gpio_node) DT_PHANDLE(gpio_node, gpiote_instance) -#define INVALID_NRFX_GPIOTE_INSTANCE \ - { .p_reg = NULL } -#define GPIOTE_INST_AND_COMMA(gpio_node) \ - [DT_PROP(gpio_node, port)] = \ - COND_CODE_1(DT_NODE_HAS_PROP(gpio_node, gpiote_instance), \ - (NRFX_GPIOTE_INSTANCE(DT_PROP(GPIOTE_NODE(gpio_node), instance))), \ - (INVALID_NRFX_GPIOTE_INSTANCE)), +#define GPIOTE_INST_AND_COMMA(gpio_node) [DT_PROP(gpio_node, port)] = \ + COND_CODE_1(DT_NODE_HAS_PROP(gpio_node, gpiote_instance), \ + (&GPIOTE_NRFX_INST_BY_NODE(GPIOTE_NODE(gpio_node))), \ + (NULL)), typedef struct { - const nrfx_gpiote_t *gpiote; - uint8_t gpiote_channel; + nrfx_gpiote_t *gpiote; + uint8_t gpiote_channel; } ppi_trace_gpiote_pin_t; static atomic_t alloc_cnt; static uint32_t handle_pool[CONFIG_PPI_TRACE_PIN_CNT]; -static const nrfx_gpiote_t *get_gpiote(nrfx_gpiote_pin_t pin) +static nrfx_gpiote_t *get_gpiote(nrfx_gpiote_pin_t pin) { - static const nrfx_gpiote_t gpiote[GPIO_COUNT] = { + static nrfx_gpiote_t * const gpiote_per_port[GPIO_COUNT] = { DT_FOREACH_STATUS_OKAY(nordic_nrf_gpio, GPIOTE_INST_AND_COMMA) }; - const nrfx_gpiote_t *result = &gpiote[pin >> 5]; - - if (result->p_reg == NULL) { - /* On given pin's port there is no GPIOTE. */ - result = NULL; - } - - return result; + return gpiote_per_port[NRF_PIN_NUMBER_TO_PORT(pin)]; } static bool ppi_trace_gpiote_pin_init( From 5188d2471a6185414746327c6ca5d0053fa020b6 Mon Sep 17 00:00:00 2001 From: Nikodem Kastelik Date: Thu, 30 Oct 2025 13:33:21 +0100 Subject: [PATCH 54/72] mpsl: align to nrfx_gpiote changes GPIOTE driver instances are no longer defined within nrfx. Signed-off-by: Nikodem Kastelik --- subsys/mpsl/cx/1wire/mpsl_cx_1wire.c | 11 +++--- subsys/mpsl/cx/3wire/mpsl_cx_3wire.c | 11 +++--- subsys/mpsl/cx/nrf700x/mpsl_cx_nrf700x.c | 11 +++--- .../nrf21540_gpio/mpsl_fem_nrf21540_gpio.c | 27 +++++++------- .../mpsl_fem_nrf21540_gpio_spi.c | 35 ++++++++++--------- subsys/mpsl/fem/nrf2220/mpsl_fem_nrf2220.c | 21 ++++++----- subsys/mpsl/fem/nrf2240/mpsl_fem_nrf2240.c | 19 +++++----- .../fem/simple_gpio/mpsl_fem_simple_gpio.c | 19 +++++----- subsys/mpsl/pin_debug/mpsl_pin_debug_nrf54.c | 35 ++++++++++--------- .../pin_debug/mpsl_pin_debug_radio_core.c | 32 +++++++++-------- 10 files changed, 122 insertions(+), 99 deletions(-) diff --git a/subsys/mpsl/cx/1wire/mpsl_cx_1wire.c b/subsys/mpsl/cx/1wire/mpsl_cx_1wire.c index 08478408646..1a619811ae1 100644 --- a/subsys/mpsl/cx/1wire/mpsl_cx_1wire.c +++ b/subsys/mpsl/cx/1wire/mpsl_cx_1wire.c @@ -26,6 +26,7 @@ #include "hal/nrf_gpio.h" #include +#include #if DT_NODE_EXISTS(DT_NODELABEL(nrf_radio_coex)) #define CX_NODE DT_NODELABEL(nrf_radio_coex) @@ -50,8 +51,8 @@ #define GRANT_PIN_PORT_NO DT_PROP(DT_GPIO_CTLR(CX_NODE, grant_gpios), port) #define GRANT_PIN_PIN_NO DT_GPIO_PIN(CX_NODE, grant_gpios) -static const nrfx_gpiote_t gpiote = - NRFX_GPIOTE_INSTANCE(NRF_DT_GPIOTE_INST(CX_NODE, grant_gpios)); +static nrfx_gpiote_t *gpiote = + &GPIOTE_NRFX_INST_BY_NODE(NRF_DT_GPIOTE_NODE(CX_NODE, grant_gpios)); static const struct gpio_dt_spec gra_spec = GPIO_DT_SPEC_GET(CX_NODE, grant_gpios); @@ -123,9 +124,9 @@ static int32_t register_callback(mpsl_cx_cb_t cb) callback = cb; if (cb) { - nrfx_gpiote_trigger_enable(&gpiote, grant_abs_pin, true); + nrfx_gpiote_trigger_enable(gpiote, grant_abs_pin, true); } else { - nrfx_gpiote_trigger_disable(&gpiote, grant_abs_pin); + nrfx_gpiote_trigger_disable(gpiote, grant_abs_pin); } return 0; @@ -162,7 +163,7 @@ static int mpsl_cx_init(void) } grant_abs_pin = NRF_GPIO_PIN_MAP(GRANT_PIN_PORT_NO, GRANT_PIN_PIN_NO); - nrfx_gpiote_trigger_disable(&gpiote, grant_abs_pin); + nrfx_gpiote_trigger_disable(gpiote, grant_abs_pin); gpio_init_callback(&grant_cb, gpiote_irq_handler, BIT(gra_spec.pin)); gpio_add_callback(gra_spec.port, &grant_cb); diff --git a/subsys/mpsl/cx/3wire/mpsl_cx_3wire.c b/subsys/mpsl/cx/3wire/mpsl_cx_3wire.c index 40a286b493f..8f84d87d045 100644 --- a/subsys/mpsl/cx/3wire/mpsl_cx_3wire.c +++ b/subsys/mpsl/cx/3wire/mpsl_cx_3wire.c @@ -29,6 +29,7 @@ #include "hal/nrf_gpio.h" #include +#include #if DT_NODE_EXISTS(DT_NODELABEL(nrf_radio_coex)) #define CX_NODE DT_NODELABEL(nrf_radio_coex) @@ -45,8 +46,8 @@ #define GRANT_PIN_PORT_NO DT_PROP(DT_GPIO_CTLR(CX_NODE, grant_gpios), port) #define GRANT_PIN_PIN_NO DT_GPIO_PIN(CX_NODE, grant_gpios) -static const nrfx_gpiote_t gpiote = - NRFX_GPIOTE_INSTANCE(NRF_DT_GPIOTE_INST(CX_NODE, grant_gpios)); +static nrfx_gpiote_t *gpiote = + &GPIOTE_NRFX_INST_BY_NODE(NRF_DT_GPIOTE_NODE(CX_NODE, grant_gpios)); static const struct gpio_dt_spec req_spec = GPIO_DT_SPEC_GET(CX_NODE, req_gpios); static const struct gpio_dt_spec pri_spec = GPIO_DT_SPEC_GET(CX_NODE, pri_dir_gpios); @@ -175,9 +176,9 @@ static int32_t register_callback(mpsl_cx_cb_t cb) callback = cb; if (cb != NULL) { - nrfx_gpiote_trigger_enable(&gpiote, grant_abs_pin, true); + nrfx_gpiote_trigger_enable(gpiote, grant_abs_pin, true); } else { - nrfx_gpiote_trigger_disable(&gpiote, grant_abs_pin); + nrfx_gpiote_trigger_disable(gpiote, grant_abs_pin); } return 0; @@ -224,7 +225,7 @@ static int mpsl_cx_init(void) return ret; } grant_abs_pin = NRF_GPIO_PIN_MAP(GRANT_PIN_PORT_NO, GRANT_PIN_PIN_NO); - nrfx_gpiote_trigger_disable(&gpiote, grant_abs_pin); + nrfx_gpiote_trigger_disable(gpiote, grant_abs_pin); gpio_init_callback(&grant_cb, gpiote_irq_handler, BIT(gra_spec.pin)); gpio_add_callback(gra_spec.port, &grant_cb); diff --git a/subsys/mpsl/cx/nrf700x/mpsl_cx_nrf700x.c b/subsys/mpsl/cx/nrf700x/mpsl_cx_nrf700x.c index 5e5a5b864ff..9c06edaa851 100644 --- a/subsys/mpsl/cx/nrf700x/mpsl_cx_nrf700x.c +++ b/subsys/mpsl/cx/nrf700x/mpsl_cx_nrf700x.c @@ -28,6 +28,7 @@ #include "hal/nrf_gpio.h" #include +#include /* * Typical part of device tree describing coex (sample port and pin numbers). @@ -58,8 +59,8 @@ #define GRANT_PIN_PORT_NO DT_PROP(DT_GPIO_CTLR(CX_NODE, grant_gpios), port) #define GRANT_PIN_PIN_NO DT_GPIO_PIN(CX_NODE, grant_gpios) -static const nrfx_gpiote_t gpiote = - NRFX_GPIOTE_INSTANCE(NRF_DT_GPIOTE_INST(CX_NODE, grant_gpios)); +static nrfx_gpiote_t *gpiote = + &GPIOTE_NRFX_INST_BY_NODE(NRF_DT_GPIOTE_NODE(CX_NODE, grant_gpios)); static const struct gpio_dt_spec req_spec = GPIO_DT_SPEC_GET(CX_NODE, req_gpios); static const struct gpio_dt_spec status0_spec = GPIO_DT_SPEC_GET(CX_NODE, status0_gpios); @@ -269,9 +270,9 @@ static int32_t register_callback(mpsl_cx_cb_t cb) callback = cb; if (cb != NULL) { - nrfx_gpiote_trigger_enable(&gpiote, grant_abs_pin, true); + nrfx_gpiote_trigger_enable(gpiote, grant_abs_pin, true); } else { - nrfx_gpiote_trigger_disable(&gpiote, grant_abs_pin); + nrfx_gpiote_trigger_disable(gpiote, grant_abs_pin); } return 0; @@ -317,7 +318,7 @@ static int mpsl_cx_init(void) return ret; } grant_abs_pin = NRF_GPIO_PIN_MAP(GRANT_PIN_PORT_NO, GRANT_PIN_PIN_NO); - nrfx_gpiote_trigger_disable(&gpiote, grant_abs_pin); + nrfx_gpiote_trigger_disable(gpiote, grant_abs_pin); gpio_init_callback(&grant_cb, gpiote_irq_handler, BIT(grant_spec.pin)); gpio_add_callback(grant_spec.port, &grant_cb); diff --git a/subsys/mpsl/fem/nrf21540_gpio/mpsl_fem_nrf21540_gpio.c b/subsys/mpsl/fem/nrf21540_gpio/mpsl_fem_nrf21540_gpio.c index 94b841a453f..fbc2e326798 100644 --- a/subsys/mpsl/fem/nrf21540_gpio/mpsl_fem_nrf21540_gpio.c +++ b/subsys/mpsl/fem/nrf21540_gpio/mpsl_fem_nrf21540_gpio.c @@ -16,6 +16,7 @@ #include "mpsl_fem_power_model_interface.h" #endif #include +#include #include #else /* !defined(CONFIG_MPSL_FEM_PIN_FORWARDER) */ #include @@ -24,6 +25,8 @@ #endif #endif /* !defined(CONFIG_MPSL_FEM_PIN_FORWARDER) */ +#define RADIO_FEM_NODE DT_NODELABEL(nrf_radio_fem) + #if !defined(CONFIG_MPSL_FEM_PIN_FORWARDER) static int fem_nrf21540_gpio_configure(void) { @@ -31,30 +34,30 @@ static int fem_nrf21540_gpio_configure(void) #if DT_NODE_HAS_PROP(DT_NODELABEL(nrf_radio_fem), tx_en_gpios) uint8_t txen_gpiote_channel; - const nrfx_gpiote_t txen_gpiote = NRFX_GPIOTE_INSTANCE( - NRF_DT_GPIOTE_INST(DT_NODELABEL(nrf_radio_fem), tx_en_gpios)); + nrfx_gpiote_t *txen_gpiote = + &GPIOTE_NRFX_INST_BY_NODE(NRF_DT_GPIOTE_NODE(RADIO_FEM_NODE, tx_en_gpios)); - if (nrfx_gpiote_channel_alloc(&txen_gpiote, &txen_gpiote_channel) != NRFX_SUCCESS) { + if (nrfx_gpiote_channel_alloc(txen_gpiote, &txen_gpiote_channel) != 0) { return -ENOMEM; } #endif #if DT_NODE_HAS_PROP(DT_NODELABEL(nrf_radio_fem), rx_en_gpios) uint8_t rxen_gpiote_channel; - const nrfx_gpiote_t rxen_gpiote = NRFX_GPIOTE_INSTANCE( - NRF_DT_GPIOTE_INST(DT_NODELABEL(nrf_radio_fem), rx_en_gpios)); + nrfx_gpiote_t *rxen_gpiote = + &GPIOTE_NRFX_INST_BY_NODE(NRF_DT_GPIOTE_NODE(RADIO_FEM_NODE, rx_en_gpios)); - if (nrfx_gpiote_channel_alloc(&rxen_gpiote, &rxen_gpiote_channel) != NRFX_SUCCESS) { + if (nrfx_gpiote_channel_alloc(rxen_gpiote, &rxen_gpiote_channel) != 0) { return -ENOMEM; } #endif #if DT_NODE_HAS_PROP(DT_NODELABEL(nrf_radio_fem), pdn_gpios) uint8_t pdn_gpiote_channel; - const nrfx_gpiote_t pdn_gpiote = NRFX_GPIOTE_INSTANCE( - NRF_DT_GPIOTE_INST(DT_NODELABEL(nrf_radio_fem), pdn_gpios)); + nrfx_gpiote_t *pdn_gpiote = + &GPIOTE_NRFX_INST_BY_NODE(NRF_DT_GPIOTE_NODE(RADIO_FEM_NODE, pdn_gpios)); - if (nrfx_gpiote_channel_alloc(&pdn_gpiote, &pdn_gpiote_channel) != NRFX_SUCCESS) { + if (nrfx_gpiote_channel_alloc(pdn_gpiote, &pdn_gpiote_channel) != 0) { return -ENOMEM; } #endif @@ -93,7 +96,7 @@ static int fem_nrf21540_gpio_configure(void) .active_high = MPSL_FEM_GPIO_POLARITY_GET(tx_en_gpios), .gpiote_ch_id = txen_gpiote_channel, #if defined(NRF54L_SERIES) - .p_gpiote = txen_gpiote.p_reg, + .p_gpiote = txen_gpiote->p_reg, #endif #else MPSL_FEM_DISABLED_GPIOTE_PIN_CONFIG_INIT @@ -110,7 +113,7 @@ static int fem_nrf21540_gpio_configure(void) .active_high = MPSL_FEM_GPIO_POLARITY_GET(rx_en_gpios), .gpiote_ch_id = rxen_gpiote_channel, #if defined(NRF54L_SERIES) - .p_gpiote = rxen_gpiote.p_reg, + .p_gpiote = rxen_gpiote->p_reg, #endif #else MPSL_FEM_DISABLED_GPIOTE_PIN_CONFIG_INIT @@ -127,7 +130,7 @@ static int fem_nrf21540_gpio_configure(void) .active_high = MPSL_FEM_GPIO_POLARITY_GET(pdn_gpios), .gpiote_ch_id = pdn_gpiote_channel, #if defined(NRF54L_SERIES) - .p_gpiote = pdn_gpiote.p_reg, + .p_gpiote = pdn_gpiote->p_reg, #endif #else MPSL_FEM_DISABLED_GPIOTE_PIN_CONFIG_INIT diff --git a/subsys/mpsl/fem/nrf21540_gpio_spi/mpsl_fem_nrf21540_gpio_spi.c b/subsys/mpsl/fem/nrf21540_gpio_spi/mpsl_fem_nrf21540_gpio_spi.c index be09237b03e..f71383828db 100644 --- a/subsys/mpsl/fem/nrf21540_gpio_spi/mpsl_fem_nrf21540_gpio_spi.c +++ b/subsys/mpsl/fem/nrf21540_gpio_spi/mpsl_fem_nrf21540_gpio_spi.c @@ -20,11 +20,14 @@ #include "mpsl_fem_power_model_interface.h" #endif #include +#include #if !defined(CONFIG_PINCTRL) #error CONFIG_PINCTRL is required for nRF21540 GPIO SPI driver #endif +#define RADIO_FEM_NODE DT_NODELABEL(nrf_radio_fem) + #define MPSL_FEM_SPI_IF DT_PHANDLE(DT_NODELABEL(nrf_radio_fem), spi_if) #define MPSL_FEM_SPI_BUS DT_BUS(MPSL_FEM_SPI_IF) #define MPSL_FEM_SPI_REG ((NRF_SPIM_Type *) DT_REG_ADDR(MPSL_FEM_SPI_BUS)) @@ -44,10 +47,10 @@ static uint32_t fem_nrf21540_spi_configure(mpsl_fem_nrf21540_gpio_spi_interface_ { #if DT_NODE_HAS_PROP(MPSL_FEM_SPI_BUS, cs_gpios) uint8_t cs_gpiote_channel; - const nrfx_gpiote_t cs_gpiote = NRFX_GPIOTE_INSTANCE( - NRF_DT_GPIOTE_INST(MPSL_FEM_SPI_BUS, cs_gpios)); + nrfx_gpiote_t *cs_gpiote = + &GPIOTE_NRFX_INST_BY_NODE(NRF_DT_GPIOTE_NODE(MPSL_FEM_SPI_BUS, cs_gpios)); - if (nrfx_gpiote_channel_alloc(&cs_gpiote, &cs_gpiote_channel) != NRFX_SUCCESS) { + if (nrfx_gpiote_channel_alloc(cs_gpiote, &cs_gpiote_channel) != 0) { return -ENOMEM; } #endif @@ -65,7 +68,7 @@ static uint32_t fem_nrf21540_spi_configure(mpsl_fem_nrf21540_gpio_spi_interface_ .active_high = true, .gpiote_ch_id = cs_gpiote_channel, #if defined(NRF54L_SERIES) - .p_gpiote = cs_gpiote.p_reg, + .p_gpiote = cs_gpiote->p_reg, #endif #else MPSL_FEM_DISABLED_GPIOTE_PIN_CONFIG_INIT @@ -115,30 +118,30 @@ static int fem_nrf21540_gpio_spi_configure(void) #if DT_NODE_HAS_PROP(DT_NODELABEL(nrf_radio_fem), tx_en_gpios) uint8_t txen_gpiote_channel; - const nrfx_gpiote_t txen_gpiote = NRFX_GPIOTE_INSTANCE( - NRF_DT_GPIOTE_INST(DT_NODELABEL(nrf_radio_fem), tx_en_gpios)); + nrfx_gpiote_t *txen_gpiote = + &GPIOTE_NRFX_INST_BY_NODE(NRF_DT_GPIOTE_NODE(RADIO_FEM_NODE, tx_en_gpios)); - if (nrfx_gpiote_channel_alloc(&txen_gpiote, &txen_gpiote_channel) != NRFX_SUCCESS) { + if (nrfx_gpiote_channel_alloc(txen_gpiote, &txen_gpiote_channel) != 0) { return -ENOMEM; } #endif #if DT_NODE_HAS_PROP(DT_NODELABEL(nrf_radio_fem), rx_en_gpios) uint8_t rxen_gpiote_channel; - const nrfx_gpiote_t rxen_gpiote = NRFX_GPIOTE_INSTANCE( - NRF_DT_GPIOTE_INST(DT_NODELABEL(nrf_radio_fem), rx_en_gpios)); + nrfx_gpiote_t *rxen_gpiote = + &GPIOTE_NRFX_INST_BY_NODE(NRF_DT_GPIOTE_NODE(RADIO_FEM_NODE, rx_en_gpios)); - if (nrfx_gpiote_channel_alloc(&rxen_gpiote, &rxen_gpiote_channel) != NRFX_SUCCESS) { + if (nrfx_gpiote_channel_alloc(rxen_gpiote, &rxen_gpiote_channel) != 0) { return -ENOMEM; } #endif #if DT_NODE_HAS_PROP(DT_NODELABEL(nrf_radio_fem), pdn_gpios) uint8_t pdn_gpiote_channel; - const nrfx_gpiote_t pdn_gpiote = NRFX_GPIOTE_INSTANCE( - NRF_DT_GPIOTE_INST(DT_NODELABEL(nrf_radio_fem), pdn_gpios)); + nrfx_gpiote_t *pdn_gpiote = + &GPIOTE_NRFX_INST_BY_NODE(NRF_DT_GPIOTE_NODE(RADIO_FEM_NODE, pdn_gpios)); - if (nrfx_gpiote_channel_alloc(&pdn_gpiote, &pdn_gpiote_channel) != NRFX_SUCCESS) { + if (nrfx_gpiote_channel_alloc(pdn_gpiote, &pdn_gpiote_channel) != 0) { return -ENOMEM; } #endif @@ -177,7 +180,7 @@ static int fem_nrf21540_gpio_spi_configure(void) .active_high = MPSL_FEM_GPIO_POLARITY_GET(tx_en_gpios), .gpiote_ch_id = txen_gpiote_channel, #if defined(NRF54L_SERIES) - .p_gpiote = txen_gpiote.p_reg, + .p_gpiote = txen_gpiote->p_reg, #endif #else MPSL_FEM_DISABLED_GPIOTE_PIN_CONFIG_INIT @@ -194,7 +197,7 @@ static int fem_nrf21540_gpio_spi_configure(void) .active_high = MPSL_FEM_GPIO_POLARITY_GET(rx_en_gpios), .gpiote_ch_id = rxen_gpiote_channel, #if defined(NRF54L_SERIES) - .p_gpiote = rxen_gpiote.p_reg, + .p_gpiote = rxen_gpiote->p_reg, #endif #else MPSL_FEM_DISABLED_GPIOTE_PIN_CONFIG_INIT @@ -211,7 +214,7 @@ static int fem_nrf21540_gpio_spi_configure(void) .active_high = MPSL_FEM_GPIO_POLARITY_GET(pdn_gpios), .gpiote_ch_id = pdn_gpiote_channel, #if defined(NRF54L_SERIES) - .p_gpiote = pdn_gpiote.p_reg, + .p_gpiote = pdn_gpiote->p_reg, #endif #else MPSL_FEM_DISABLED_GPIOTE_PIN_CONFIG_INIT diff --git a/subsys/mpsl/fem/nrf2220/mpsl_fem_nrf2220.c b/subsys/mpsl/fem/nrf2220/mpsl_fem_nrf2220.c index 00f213a5eb7..813a4d3d258 100644 --- a/subsys/mpsl/fem/nrf2220/mpsl_fem_nrf2220.c +++ b/subsys/mpsl/fem/nrf2220/mpsl_fem_nrf2220.c @@ -15,6 +15,7 @@ #include #include +#include #include #include @@ -33,6 +34,8 @@ #error "The nRF2220 driver must be used with CONFIG_PINCTRL! Set CONFIG_PINCTRL=y" #endif +#define RADIO_FEM_NODE DT_NODELABEL(nrf_radio_fem) + #if DT_NODE_HAS_PROP(DT_NODELABEL(nrf_radio_fem), twi_if) #define MPSL_FEM_TWI_IF DT_PHANDLE(DT_NODELABEL(nrf_radio_fem), twi_if) #define MPSL_FEM_TWI_ADDRESS DT_REG_ADDR(MPSL_FEM_TWI_IF) @@ -97,15 +100,17 @@ static int fem_nrf2220_configure(void) { int err; - const nrfx_gpiote_t cs_gpiote = NRFX_GPIOTE_INSTANCE( - NRF_DT_GPIOTE_INST(DT_NODELABEL(nrf_radio_fem), cs_gpios)); - if (nrfx_gpiote_channel_alloc(&cs_gpiote, &cs_gpiote_channel) != NRFX_SUCCESS) { + nrfx_gpiote_t *cs_gpiote = + &GPIOTE_NRFX_INST_BY_NODE(NRF_DT_GPIOTE_NODE(RADIO_FEM_NODE, cs_gpios)); + + if (nrfx_gpiote_channel_alloc(cs_gpiote, &cs_gpiote_channel) != 0) { return -ENOMEM; } - const nrfx_gpiote_t md_gpiote = NRFX_GPIOTE_INSTANCE( - NRF_DT_GPIOTE_INST(DT_NODELABEL(nrf_radio_fem), md_gpios)); - if (nrfx_gpiote_channel_alloc(&md_gpiote, &md_gpiote_channel) != NRFX_SUCCESS) { + nrfx_gpiote_t *md_gpiote = + &GPIOTE_NRFX_INST_BY_NODE(NRF_DT_GPIOTE_NODE(RADIO_FEM_NODE, md_gpios)); + + if (nrfx_gpiote_channel_alloc(md_gpiote, &md_gpiote_channel) != 0) { return -ENOMEM; } @@ -124,7 +129,7 @@ static int fem_nrf2220_configure(void) .active_high = MPSL_FEM_GPIO_POLARITY_GET(cs_gpios), .gpiote_ch_id = cs_gpiote_channel, #if defined(NRF54L_SERIES) - .p_gpiote = cs_gpiote.p_reg, + .p_gpiote = cs_gpiote->p_reg, #endif }, .md_pin_config = { @@ -137,7 +142,7 @@ static int fem_nrf2220_configure(void) .active_high = MPSL_FEM_GPIO_POLARITY_GET(md_gpios), .gpiote_ch_id = md_gpiote_channel, #if defined(NRF54L_SERIES) - .p_gpiote = md_gpiote.p_reg, + .p_gpiote = md_gpiote->p_reg, #endif } }; diff --git a/subsys/mpsl/fem/nrf2240/mpsl_fem_nrf2240.c b/subsys/mpsl/fem/nrf2240/mpsl_fem_nrf2240.c index 79a2eefd6ea..cf2ca7dad8a 100644 --- a/subsys/mpsl/fem/nrf2240/mpsl_fem_nrf2240.c +++ b/subsys/mpsl/fem/nrf2240/mpsl_fem_nrf2240.c @@ -15,6 +15,7 @@ #include #include +#include #include #include @@ -28,6 +29,8 @@ #error "The nRF2240 driver must be used with CONFIG_PINCTRL! Set CONFIG_PINCTRL=y" #endif +#define RADIO_FEM_NODE DT_NODELABEL(nrf_radio_fem) + #if DT_NODE_HAS_PROP(DT_NODELABEL(nrf_radio_fem), twi_if) #define MPSL_FEM_TWI_IF DT_PHANDLE(DT_NODELABEL(nrf_radio_fem), twi_if) #define MPSL_FEM_TWI_ADDRESS DT_REG_ADDR(MPSL_FEM_TWI_IF) @@ -93,15 +96,15 @@ static int fem_nrf2240_configure(void) { int err; - const nrfx_gpiote_t cs_gpiote = NRFX_GPIOTE_INSTANCE( - NRF_DT_GPIOTE_INST(DT_NODELABEL(nrf_radio_fem), cs_gpios)); - if (nrfx_gpiote_channel_alloc(&cs_gpiote, &cs_gpiote_channel) != NRFX_SUCCESS) { + nrfx_gpiote_t *cs_gpiote = + &GPIOTE_NRFX_INST_BY_NODE(NRF_DT_GPIOTE_NODE(RADIO_FEM_NODE, cs_gpios)); + if (nrfx_gpiote_channel_alloc(cs_gpiote, &cs_gpiote_channel) != 0) { return -ENOMEM; } - const nrfx_gpiote_t md_gpiote = NRFX_GPIOTE_INSTANCE( - NRF_DT_GPIOTE_INST(DT_NODELABEL(nrf_radio_fem), md_gpios)); - if (nrfx_gpiote_channel_alloc(&md_gpiote, &md_gpiote_channel) != NRFX_SUCCESS) { + nrfx_gpiote_t *md_gpiote = + &GPIOTE_NRFX_INST_BY_NODE(NRF_DT_GPIOTE_NODE(RADIO_FEM_NODE, md_gpios)); + if (nrfx_gpiote_channel_alloc(md_gpiote, &md_gpiote_channel) != 0) { return -ENOMEM; } @@ -125,7 +128,7 @@ static int fem_nrf2240_configure(void) .active_high = MPSL_FEM_GPIO_POLARITY_GET(cs_gpios), .gpiote_ch_id = cs_gpiote_channel, #if defined(NRF54L_SERIES) - .p_gpiote = cs_gpiote.p_reg, + .p_gpiote = cs_gpiote->p_reg, #endif }, .md_pin_config = { @@ -138,7 +141,7 @@ static int fem_nrf2240_configure(void) .active_high = MPSL_FEM_GPIO_POLARITY_GET(md_gpios), .gpiote_ch_id = md_gpiote_channel, #if defined(NRF54L_SERIES) - .p_gpiote = md_gpiote.p_reg, + .p_gpiote = md_gpiote->p_reg, #endif }, #if DT_NODE_HAS_PROP(DT_NODELABEL(nrf_radio_fem), pwrmd_gpios) diff --git a/subsys/mpsl/fem/simple_gpio/mpsl_fem_simple_gpio.c b/subsys/mpsl/fem/simple_gpio/mpsl_fem_simple_gpio.c index 884a0a078dc..22fb50ba1e6 100644 --- a/subsys/mpsl/fem/simple_gpio/mpsl_fem_simple_gpio.c +++ b/subsys/mpsl/fem/simple_gpio/mpsl_fem_simple_gpio.c @@ -16,6 +16,7 @@ #include "mpsl_fem_power_model_interface.h" #endif #include +#include #include #else /* !defined(CONFIG_MPSL_FEM_PIN_FORWARDER) */ #include @@ -24,6 +25,8 @@ #endif #endif /* !defined(CONFIG_MPSL_FEM_PIN_FORWARDER) */ +#define RADIO_FEM_NODE DT_NODELABEL(nrf_radio_fem) + #if !defined(CONFIG_MPSL_FEM_PIN_FORWARDER) static int fem_simple_gpio_configure(void) { @@ -31,20 +34,20 @@ static int fem_simple_gpio_configure(void) #if DT_NODE_HAS_PROP(DT_NODELABEL(nrf_radio_fem), ctx_gpios) uint8_t ctx_gpiote_channel = MPSL_FEM_GPIOTE_INVALID_CHANNEL; - const nrfx_gpiote_t ctx_gpiote = NRFX_GPIOTE_INSTANCE( - NRF_DT_GPIOTE_INST(DT_NODELABEL(nrf_radio_fem), ctx_gpios)); + nrfx_gpiote_t *ctx_gpiote = + &GPIOTE_NRFX_INST_BY_NODE(NRF_DT_GPIOTE_NODE(RADIO_FEM_NODE, ctx_gpios)); - if (nrfx_gpiote_channel_alloc(&ctx_gpiote, &ctx_gpiote_channel) != NRFX_SUCCESS) { + if (nrfx_gpiote_channel_alloc(ctx_gpiote, &ctx_gpiote_channel) != 0) { return -ENOMEM; } #endif #if DT_NODE_HAS_PROP(DT_NODELABEL(nrf_radio_fem), crx_gpios) uint8_t crx_gpiote_channel = MPSL_FEM_GPIOTE_INVALID_CHANNEL; - const nrfx_gpiote_t crx_gpiote = NRFX_GPIOTE_INSTANCE( - NRF_DT_GPIOTE_INST(DT_NODELABEL(nrf_radio_fem), crx_gpios)); + nrfx_gpiote_t *crx_gpiote = + &GPIOTE_NRFX_INST_BY_NODE(NRF_DT_GPIOTE_NODE(RADIO_FEM_NODE, crx_gpios)); - if (nrfx_gpiote_channel_alloc(&crx_gpiote, &crx_gpiote_channel) != NRFX_SUCCESS) { + if (nrfx_gpiote_channel_alloc(crx_gpiote, &crx_gpiote_channel) != 0) { return -ENOMEM; } #endif @@ -75,7 +78,7 @@ static int fem_simple_gpio_configure(void) .active_high = MPSL_FEM_GPIO_POLARITY_GET(ctx_gpios), .gpiote_ch_id = ctx_gpiote_channel, #if defined(NRF54L_SERIES) - .p_gpiote = ctx_gpiote.p_reg, + .p_gpiote = ctx_gpiote->p_reg, #endif #else MPSL_FEM_DISABLED_GPIOTE_PIN_CONFIG_INIT @@ -92,7 +95,7 @@ static int fem_simple_gpio_configure(void) .active_high = MPSL_FEM_GPIO_POLARITY_GET(crx_gpios), .gpiote_ch_id = crx_gpiote_channel, #if defined(NRF54L_SERIES) - .p_gpiote = crx_gpiote.p_reg, + .p_gpiote = crx_gpiote->p_reg, #endif #else MPSL_FEM_DISABLED_GPIOTE_PIN_CONFIG_INIT diff --git a/subsys/mpsl/pin_debug/mpsl_pin_debug_nrf54.c b/subsys/mpsl/pin_debug/mpsl_pin_debug_nrf54.c index 80ed7c7bc32..f8ac2915e8f 100644 --- a/subsys/mpsl/pin_debug/mpsl_pin_debug_nrf54.c +++ b/subsys/mpsl/pin_debug/mpsl_pin_debug_nrf54.c @@ -9,18 +9,21 @@ #include #include #include +#include #include #include #include #include -const nrfx_gpiote_t gpiote = NRFX_GPIOTE_INSTANCE(20); +#define GPIOTE_NODE DT_NODELABEL(gpiote20) + LOG_MODULE_REGISTER(mpsl_radio_pin_debug, CONFIG_MPSL_LOG_LEVEL); static int m_ppi_config(void) { + nrfx_gpiote_t *gpiote = &GPIOTE_NRFX_INST_BY_NODE(GPIOTE_NODE); uint32_t rad_domain = nrfx_gppi_domain_id_get(NRF_DPPIC10); - uint32_t dst_domain = nrfx_gppi_domain_id_get(gpiote.p_reg); + uint32_t dst_domain = nrfx_gppi_domain_id_get(gpiote->p_reg); nrfx_gppi_resource_t rad_resource; nrfx_gppi_handle_t handle; uint32_t tep[4]; @@ -32,13 +35,13 @@ static int m_ppi_config(void) MPSL_DPPI_RADIO_PUBLISH_END_CHANNEL_IDX }; - tep[0] = nrfx_gpiote_set_task_address_get(&gpiote, + tep[0] = nrfx_gpiote_set_task_address_get(gpiote, CONFIG_MPSL_PIN_DEBUG_RADIO_READY_AND_DISABLED_PIN); - tep[1] = nrfx_gpiote_clr_task_address_get(&gpiote, + tep[1] = nrfx_gpiote_clr_task_address_get(gpiote, CONFIG_MPSL_PIN_DEBUG_RADIO_READY_AND_DISABLED_PIN); - tep[2] = nrfx_gpiote_set_task_address_get(&gpiote, + tep[2] = nrfx_gpiote_set_task_address_get(gpiote, CONFIG_MPSL_PIN_DEBUG_RADIO_ADDRESS_AND_END_PIN); - tep[3] = nrfx_gpiote_clr_task_address_get(&gpiote, + tep[3] = nrfx_gpiote_clr_task_address_get(gpiote, CONFIG_MPSL_PIN_DEBUG_RADIO_ADDRESS_AND_END_PIN); rad_resource.rad_domain = nrfx_gppi_domain_id_get(NRF_DPPIC10); @@ -58,19 +61,18 @@ static int m_ppi_config(void) static int mpsl_radio_pin_debug_init(void) { + nrfx_gpiote_t *gpiote = &GPIOTE_NRFX_INST_BY_NODE(GPIOTE_NODE); uint8_t radio_ready_radio_disabled_gpiote_channel; uint8_t radio_address_radio_end_gpiote_channel; const nrfx_gpiote_output_config_t gpiote_output_cfg = NRFX_GPIOTE_DEFAULT_OUTPUT_CONFIG; - if (nrfx_gpiote_channel_alloc(&gpiote, &radio_ready_radio_disabled_gpiote_channel) != - NRFX_SUCCESS) { + if (nrfx_gpiote_channel_alloc(gpiote, &radio_ready_radio_disabled_gpiote_channel) != 0) { LOG_ERR("Failed allocating GPIOTE chan"); return -ENOMEM; } - if (nrfx_gpiote_channel_alloc(&gpiote, &radio_address_radio_end_gpiote_channel) != - NRFX_SUCCESS) { + if (nrfx_gpiote_channel_alloc(gpiote, &radio_address_radio_end_gpiote_channel) != 0) { LOG_ERR("Failed allocating GPIOTE chan"); return -ENOMEM; } @@ -81,11 +83,10 @@ static int mpsl_radio_pin_debug_init(void) .init_val = NRF_GPIOTE_INITIAL_VALUE_LOW, }; - if (nrfx_gpiote_output_configure(&gpiote, + if (nrfx_gpiote_output_configure(gpiote, CONFIG_MPSL_PIN_DEBUG_RADIO_READY_AND_DISABLED_PIN, &gpiote_output_cfg, - &task_cfg_ready_disabled) - != NRFX_SUCCESS) { + &task_cfg_ready_disabled) != 0) { LOG_ERR("Failed configuring GPIOTE chan"); return -ENOMEM; } @@ -96,9 +97,9 @@ static int mpsl_radio_pin_debug_init(void) .init_val = NRF_GPIOTE_INITIAL_VALUE_LOW, }; - if (nrfx_gpiote_output_configure(&gpiote, CONFIG_MPSL_PIN_DEBUG_RADIO_ADDRESS_AND_END_PIN, + if (nrfx_gpiote_output_configure(gpiote, CONFIG_MPSL_PIN_DEBUG_RADIO_ADDRESS_AND_END_PIN, &gpiote_output_cfg, - &task_cfg_address_end) != NRFX_SUCCESS) { + &task_cfg_address_end) != 0) { LOG_ERR("Failed configuring GPIOTE chan"); return -ENOMEM; } @@ -107,8 +108,8 @@ static int mpsl_radio_pin_debug_init(void) return -ENOMEM; } - nrfx_gpiote_out_task_enable(&gpiote, CONFIG_MPSL_PIN_DEBUG_RADIO_READY_AND_DISABLED_PIN); - nrfx_gpiote_out_task_enable(&gpiote, CONFIG_MPSL_PIN_DEBUG_RADIO_ADDRESS_AND_END_PIN); + nrfx_gpiote_out_task_enable(gpiote, CONFIG_MPSL_PIN_DEBUG_RADIO_READY_AND_DISABLED_PIN); + nrfx_gpiote_out_task_enable(gpiote, CONFIG_MPSL_PIN_DEBUG_RADIO_ADDRESS_AND_END_PIN); return 0; } diff --git a/subsys/mpsl/pin_debug/mpsl_pin_debug_radio_core.c b/subsys/mpsl/pin_debug/mpsl_pin_debug_radio_core.c index ff1aef1cc4c..21ab37940f0 100644 --- a/subsys/mpsl/pin_debug/mpsl_pin_debug_radio_core.c +++ b/subsys/mpsl/pin_debug/mpsl_pin_debug_radio_core.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include @@ -15,21 +16,23 @@ #include #endif -const nrfx_gpiote_t gpiote = NRFX_GPIOTE_INSTANCE(0); +#define GPIOTE_NODE DT_NODELABEL(gpiote0) + LOG_MODULE_REGISTER(mpsl_radio_pin_debug, CONFIG_MPSL_LOG_LEVEL); static int m_ppi_config(void) { + nrfx_gpiote_t *gpiote = &GPIOTE_NRFX_INST_BY_NODE(GPIOTE_NODE); nrfx_gppi_handle_t handle[4]; uint32_t tep[4]; - tep[0] = nrfx_gpiote_set_task_address_get(&gpiote, + tep[0] = nrfx_gpiote_set_task_address_get(gpiote, CONFIG_MPSL_PIN_DEBUG_RADIO_READY_AND_DISABLED_PIN); - tep[1] = nrfx_gpiote_clr_task_address_get(&gpiote, + tep[1] = nrfx_gpiote_clr_task_address_get(gpiote, CONFIG_MPSL_PIN_DEBUG_RADIO_READY_AND_DISABLED_PIN); - tep[2] = nrfx_gpiote_set_task_address_get(&gpiote, + tep[2] = nrfx_gpiote_set_task_address_get(gpiote, CONFIG_MPSL_PIN_DEBUG_RADIO_ADDRESS_AND_END_PIN); - tep[3] = nrfx_gpiote_clr_task_address_get(&gpiote, + tep[3] = nrfx_gpiote_clr_task_address_get(gpiote, CONFIG_MPSL_PIN_DEBUG_RADIO_ADDRESS_AND_END_PIN); #if defined(DPPI_PRESENT) handle[0] = MPSL_DPPI_RADIO_PUBLISH_READY_CHANNEL_IDX; @@ -62,19 +65,18 @@ static int m_ppi_config(void) static int mpsl_radio_pin_debug_init(void) { + nrfx_gpiote_t *gpiote = &GPIOTE_NRFX_INST_BY_NODE(GPIOTE_NODE); uint8_t radio_ready_radio_disabled_gpiote_channel; uint8_t radio_address_radio_end_gpiote_channel; const nrfx_gpiote_output_config_t gpiote_output_cfg = NRFX_GPIOTE_DEFAULT_OUTPUT_CONFIG; - if (nrfx_gpiote_channel_alloc(&gpiote, &radio_ready_radio_disabled_gpiote_channel) != - NRFX_SUCCESS) { + if (nrfx_gpiote_channel_alloc(gpiote, &radio_ready_radio_disabled_gpiote_channel) != 0) { LOG_ERR("Failed allocating GPIOTE chan"); return -ENOMEM; } - if (nrfx_gpiote_channel_alloc(&gpiote, &radio_address_radio_end_gpiote_channel) != - NRFX_SUCCESS) { + if (nrfx_gpiote_channel_alloc(gpiote, &radio_address_radio_end_gpiote_channel) != 0) { LOG_ERR("Failed allocating GPIOTE chan"); return -ENOMEM; } @@ -86,8 +88,8 @@ static int mpsl_radio_pin_debug_init(void) }; if (nrfx_gpiote_output_configure( - &gpiote, CONFIG_MPSL_PIN_DEBUG_RADIO_READY_AND_DISABLED_PIN, &gpiote_output_cfg, - &task_cfg_ready_disabled) != NRFX_SUCCESS) { + gpiote, CONFIG_MPSL_PIN_DEBUG_RADIO_READY_AND_DISABLED_PIN, &gpiote_output_cfg, + &task_cfg_ready_disabled) != 0) { LOG_ERR("Failed configuring GPIOTE chan"); return -ENOMEM; } @@ -98,9 +100,9 @@ static int mpsl_radio_pin_debug_init(void) .init_val = NRF_GPIOTE_INITIAL_VALUE_LOW, }; - if (nrfx_gpiote_output_configure(&gpiote, CONFIG_MPSL_PIN_DEBUG_RADIO_ADDRESS_AND_END_PIN, + if (nrfx_gpiote_output_configure(gpiote, CONFIG_MPSL_PIN_DEBUG_RADIO_ADDRESS_AND_END_PIN, &gpiote_output_cfg, - &task_cfg_address_end) != NRFX_SUCCESS) { + &task_cfg_address_end) != 0) { LOG_ERR("Failed configuring GPIOTE chan"); return -ENOMEM; } @@ -109,8 +111,8 @@ static int mpsl_radio_pin_debug_init(void) return -ENOMEM; } - nrfx_gpiote_out_task_enable(&gpiote, CONFIG_MPSL_PIN_DEBUG_RADIO_READY_AND_DISABLED_PIN); - nrfx_gpiote_out_task_enable(&gpiote, CONFIG_MPSL_PIN_DEBUG_RADIO_ADDRESS_AND_END_PIN); + nrfx_gpiote_out_task_enable(gpiote, CONFIG_MPSL_PIN_DEBUG_RADIO_READY_AND_DISABLED_PIN); + nrfx_gpiote_out_task_enable(gpiote, CONFIG_MPSL_PIN_DEBUG_RADIO_ADDRESS_AND_END_PIN); return 0; } From 7a5d7606c32a705098c0a0252273912d56854ab4 Mon Sep 17 00:00:00 2001 From: Nikodem Kastelik Date: Thu, 30 Oct 2025 13:33:51 +0100 Subject: [PATCH 55/72] tests: drivers: audio: pdm_loopback: align to nrfx_gpiote changes GPIOTE driver instances are no longer defined within nrfx. Signed-off-by: Nikodem Kastelik --- tests/drivers/audio/pdm_loopback/src/main.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/tests/drivers/audio/pdm_loopback/src/main.c b/tests/drivers/audio/pdm_loopback/src/main.c index c5e4fcca376..bf4cd67a315 100644 --- a/tests/drivers/audio/pdm_loopback/src/main.c +++ b/tests/drivers/audio/pdm_loopback/src/main.c @@ -12,6 +12,7 @@ #include #include #include +#include #if defined(CONFIG_HAS_NORDIC_DMM) #include #endif @@ -43,9 +44,6 @@ K_MEM_SLAB_DEFINE_STATIC(mem_slab, MAX_BLOCK_SIZE, BLOCK_COUNT, 4); #define CLOCK_INPUT_PIN NRF_DT_GPIOS_TO_PSEL(DT_NODELABEL(pulse_counter), gpios) static const struct device *const pdm_dev = DEVICE_DT_GET(DT_NODELABEL(pdm_dev)); -static const nrfx_gpiote_t gpiote_instance = NRFX_GPIOTE_INSTANCE( - NRF_DT_GPIOTE_INST( - DT_NODELABEL(pulse_counter), gpios)); static struct pcm_stream_cfg stream_config, stream_config_dummy; static struct dmic_cfg pdm_cfg, pdm_cfg_dummy; @@ -250,12 +248,12 @@ ZTEST(pdm_loopback, test_start_trigger) ZTEST(pdm_loopback, test_pdm_clk_frequency) { int ret; - uint8_t gpiote_channel; + nrfx_gpiote_t *gpiote_instance = + &GPIOTE_NRFX_INST_BY_NODE(NRF_DT_GPIOTE_NODE(DT_NODELABEL(pulse_counter), gpios)); - ret = nrfx_gpiote_channel_alloc(&gpiote_instance, &gpiote_channel); - zassert_true(ret == NRFX_SUCCESS, - "GPIOTE channel allocation failed, return code = 0x%08X", ret); + ret = nrfx_gpiote_channel_alloc(gpiote_instance, &gpiote_channel); + zassert_true(ret == 0, "GPIOTE channel allocation failed, return code = %d", ret); nrfx_gpiote_trigger_config_t trigger_cfg = { .p_in_channel = &gpiote_channel, @@ -269,11 +267,10 @@ ZTEST(pdm_loopback, test_pdm_clk_frequency) .p_trigger_config = &trigger_cfg, }; - ret = nrfx_gpiote_input_configure(&gpiote_instance, CLOCK_INPUT_PIN, &gpiote_cfg); - zassert_true(ret == NRFX_SUCCESS, - "GPIOTE input configuration failed, return code = 0x%08X", ret); + ret = nrfx_gpiote_input_configure(gpiote_instance, CLOCK_INPUT_PIN, &gpiote_cfg); + zassert_true(ret == 0, "GPIOTE input configuration failed, return code = %d", ret); - nrfx_gpiote_trigger_enable(&gpiote_instance, CLOCK_INPUT_PIN, false); + nrfx_gpiote_trigger_enable(gpiote_instance, CLOCK_INPUT_PIN, false); nrfx_timer_config_t timer_config = NRFX_TIMER_DEFAULT_CONFIG( NRFX_TIMER_BASE_FREQUENCY_GET(&timer_instance)); @@ -287,7 +284,7 @@ ZTEST(pdm_loopback, test_pdm_clk_frequency) nrfx_timer_enable(&timer_instance); nrfx_gppi_handle_t gppi_handle; - uint32_t eep = nrfx_gpiote_in_event_address_get(&gpiote_instance, CLOCK_INPUT_PIN); + uint32_t eep = nrfx_gpiote_in_event_address_get(gpiote_instance, CLOCK_INPUT_PIN); uint32_t tep = nrfx_timer_task_address_get(&timer_instance, NRF_TIMER_TASK_COUNT); ret = nrfx_gppi_conn_alloc(eep, tep, &gppi_handle); From e0d3c4bd2990d9d7b6271bc3f55c4fdbb539b3db Mon Sep 17 00:00:00 2001 From: Nikodem Kastelik Date: Fri, 31 Oct 2025 11:32:46 +0100 Subject: [PATCH 56/72] tests: drivers: audio: pdm_loopback: fix incorrect error code Errno codes are returned now. Signed-off-by: Nikodem Kastelik --- tests/drivers/audio/pdm_loopback/src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/drivers/audio/pdm_loopback/src/main.c b/tests/drivers/audio/pdm_loopback/src/main.c index bf4cd67a315..83d5b3aca15 100644 --- a/tests/drivers/audio/pdm_loopback/src/main.c +++ b/tests/drivers/audio/pdm_loopback/src/main.c @@ -278,7 +278,7 @@ ZTEST(pdm_loopback, test_pdm_clk_frequency) timer_config.mode = NRF_TIMER_MODE_COUNTER; ret = nrfx_timer_init(&timer_instance, &timer_config, timer_handler); - zassert_true(ret == NRFX_SUCCESS, + zassert_true(ret == 0, "TIMER initialization failed, return code = 0x%08X", ret); nrfx_timer_enable(&timer_instance); From 2a621b45cbcb75c5a0881077776cdb03afdbbd34 Mon Sep 17 00:00:00 2001 From: Nikodem Kastelik Date: Fri, 31 Oct 2025 11:33:27 +0100 Subject: [PATCH 57/72] tests: drivers: i2c: i2c_latency: fix incorrect error code Errno codes are returned now. Signed-off-by: Nikodem Kastelik --- tests/drivers/i2c/i2c_latency/src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/drivers/i2c/i2c_latency/src/main.c b/tests/drivers/i2c/i2c_latency/src/main.c index d2736fce04c..0e7f22c2ea2 100644 --- a/tests/drivers/i2c/i2c_latency/src/main.c +++ b/tests/drivers/i2c/i2c_latency/src/main.c @@ -164,7 +164,7 @@ static void *test_setup(void) zassert_equal(dk_leds_init(), 0, "DK leds init failed"); dk_set_led_off(DK_LED1); - zassert_equal(NRFX_SUCCESS, nrfx_twis_init(&twis, &config, i2s_slave_handler), + zassert_equal(0, nrfx_twis_init(&twis, &config, i2s_slave_handler), "TWIS initialization failed"); PINCTRL_DT_DEFINE(NODE_TWIS); From bf9f5fa8d79e4201971f5e42cf2e61becf5a12c4 Mon Sep 17 00:00:00 2001 From: Nikodem Kastelik Date: Fri, 31 Oct 2025 15:40:18 +0100 Subject: [PATCH 58/72] samples: bluetooth: time_sync: fix gpiote reference GPIOTE instance shall be accessed via pointer. Signed-off-by: Nikodem Kastelik --- samples/bluetooth/conn_time_sync/src/timed_led_toggle.c | 2 +- samples/bluetooth/iso_time_sync/src/timed_led_toggle.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/bluetooth/conn_time_sync/src/timed_led_toggle.c b/samples/bluetooth/conn_time_sync/src/timed_led_toggle.c index 54127c71b88..d5e1123d1bd 100644 --- a/samples/bluetooth/conn_time_sync/src/timed_led_toggle.c +++ b/samples/bluetooth/conn_time_sync/src/timed_led_toggle.c @@ -61,7 +61,7 @@ int timed_led_toggle_init(void) } err = nrfx_gppi_conn_alloc(controller_time_trigger_event_addr_get(), - nrfx_gpiote_out_task_address_get(&gpiote, LED_PIN), + nrfx_gpiote_out_task_address_get(gpiote, LED_PIN), &ppi_led_toggle); if (err < 0) { printk("Failed allocating PPI chan for toggling led\n"); diff --git a/samples/bluetooth/iso_time_sync/src/timed_led_toggle.c b/samples/bluetooth/iso_time_sync/src/timed_led_toggle.c index d8391c3d349..6db3ad19a32 100644 --- a/samples/bluetooth/iso_time_sync/src/timed_led_toggle.c +++ b/samples/bluetooth/iso_time_sync/src/timed_led_toggle.c @@ -61,7 +61,7 @@ int timed_led_toggle_init(void) } err = nrfx_gppi_conn_alloc(controller_time_trigger_event_addr_get(), - nrfx_gpiote_out_task_address_get(&gpiote, LED_PIN), + nrfx_gpiote_out_task_address_get(gpiote, LED_PIN), &ppi_led_toggle); if (err < 0) { printk("Failed allocating PPI chan for toggling led\n"); From d49d1b311d9cf249f4657c5034db138babab7170 Mon Sep 17 00:00:00 2001 From: Marcin Szymczyk Date: Wed, 5 Nov 2025 13:22:19 +0100 Subject: [PATCH 59/72] 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 7c584228862..fa292cc7185 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 74efebd75c5e017ef1772bcd9efcbfdf7c4a194d Mon Sep 17 00:00:00 2001 From: Michal Frankiewicz Date: Wed, 5 Nov 2025 15:09:10 +0100 Subject: [PATCH 60/72] 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 c7b79b1cd04..f70bdc66e9e 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 fa292cc7185..42946ffb803 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 09609f8dab7..dd34ab78c26 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 5a96f362020..6a92c74b468 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 5600328f1a8..7b1733b7573 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 550b0a19af1e744ace0d68c8a5fee4fcd28c2e5b 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 61/72] nfc: lib: 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 a2e42853684..36a1abf0029 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 e9f85450a0f6f501663b63dd8814d437af0e0edd 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 62/72] 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 bbdb3efd02b..64b1d60ed4c 100644 --- a/applications/nrf5340_audio/src/modules/audio_sync_timer.c +++ b/applications/nrf5340_audio/src/modules/audio_sync_timer.c @@ -173,17 +173,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 ca1c80a2048..f147dcb7992 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 fd348f7c20e..86543aed232 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 9f82dde3da8..1f859865e37 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 4a990511bbd..5224866b5a2 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 5b7a2dd1653c380cd0879ac9975f89ef11f50db3 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 63/72] 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 115f9683c84..06ef98505ee 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 d88e4e70e1f..2763fb1f391 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 8c9caf555cb56998d279dd7512117576a1425715 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 64/72] 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_hwres.c | 4 ++-- 20 files changed, 63 insertions(+), 41 deletions(-) diff --git a/applications/connectivity_bridge/prj.conf b/applications/connectivity_bridge/prj.conf index f60c50be99c..783356233ee 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 b12882f81be..b36d150e66d 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 0605c60d5b4..ea2d2d6013a 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 b9ac2aabb3f..1ca69d590cb 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 ec772c7e06d..049731d69b6 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 ec772c7e06d..049731d69b6 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 f147dcb7992..31fcac3e3bc 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 86543aed232..dabaef53e13 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 0f4ea039c9f..6bf550e92ac 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 ec772c7e06d..049731d69b6 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 ec772c7e06d..049731d69b6 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 1f859865e37..e18c27d8071 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 5224866b5a2..e9411ce535f 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 b4049880b85..20935f398b9 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 e167e295cd9..1ab78771b80 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 4b8f87e6fdb..858b1e8750a 100644 --- a/subsys/esb/esb_dppi.c +++ b/subsys/esb/esb_dppi.c @@ -206,51 +206,51 @@ int esb_ppi_init(void) int ch; uint32_t domain_id = nrfx_gppi_domain_id_get((uint32_t)ESB_DPPIC); - 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 d89ccf159c8..956d8da61b4 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 77ed2f6ea37..eb6b0aa9b62 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 5773fd0da22..f05f9a329ab 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_hwres.c b/subsys/mpsl/hwres/mpsl_hwres.c index c86d955a95b..d84bfef22b5 100644 --- a/subsys/mpsl/hwres/mpsl_hwres.c +++ b/subsys/mpsl/hwres/mpsl_hwres.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) { From d8c76df798a48822b2722c11104b3af22a147133 Mon Sep 17 00:00:00 2001 From: Jakub Zymelka Date: Tue, 18 Nov 2025 14:44:33 +0100 Subject: [PATCH 65/72] tests: drivers: spi: align to new timer and gpiote drivers Align test to extracted control block in nrfx_timer and nrfx_gpiote drivers. Signed-off-by: Jakub Zymelka --- .../boards/nrf54l15dk_nrf54l15_cpuapp.conf | 1 - .../boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf | 1 - .../boards/nrf54ls05dk_nrf54ls05b_cpuapp.conf | 1 - .../boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf | 1 - tests/drivers/spi/spim_mosi_toggles/prj.conf | 2 +- .../drivers/spi/spim_mosi_toggles/src/main.c | 38 +++++++++---------- 6 files changed, 18 insertions(+), 26 deletions(-) delete mode 100644 tests/drivers/spi/spim_mosi_toggles/boards/nrf54l15dk_nrf54l15_cpuapp.conf delete mode 100644 tests/drivers/spi/spim_mosi_toggles/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf delete mode 100644 tests/drivers/spi/spim_mosi_toggles/boards/nrf54ls05dk_nrf54ls05b_cpuapp.conf delete mode 100644 tests/drivers/spi/spim_mosi_toggles/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf diff --git a/tests/drivers/spi/spim_mosi_toggles/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/tests/drivers/spi/spim_mosi_toggles/boards/nrf54l15dk_nrf54l15_cpuapp.conf deleted file mode 100644 index 02b014c2bc0..00000000000 --- a/tests/drivers/spi/spim_mosi_toggles/boards/nrf54l15dk_nrf54l15_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_NRFX_TIMER00=y diff --git a/tests/drivers/spi/spim_mosi_toggles/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf b/tests/drivers/spi/spim_mosi_toggles/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf deleted file mode 100644 index 02b014c2bc0..00000000000 --- a/tests/drivers/spi/spim_mosi_toggles/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_NRFX_TIMER00=y diff --git a/tests/drivers/spi/spim_mosi_toggles/boards/nrf54ls05dk_nrf54ls05b_cpuapp.conf b/tests/drivers/spi/spim_mosi_toggles/boards/nrf54ls05dk_nrf54ls05b_cpuapp.conf deleted file mode 100644 index 02b014c2bc0..00000000000 --- a/tests/drivers/spi/spim_mosi_toggles/boards/nrf54ls05dk_nrf54ls05b_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_NRFX_TIMER00=y diff --git a/tests/drivers/spi/spim_mosi_toggles/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf b/tests/drivers/spi/spim_mosi_toggles/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf deleted file mode 100644 index 02b014c2bc0..00000000000 --- a/tests/drivers/spi/spim_mosi_toggles/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_NRFX_TIMER00=y diff --git a/tests/drivers/spi/spim_mosi_toggles/prj.conf b/tests/drivers/spi/spim_mosi_toggles/prj.conf index 097c88ec3bc..f7ed2fda1b6 100644 --- a/tests/drivers/spi/spim_mosi_toggles/prj.conf +++ b/tests/drivers/spi/spim_mosi_toggles/prj.conf @@ -1,5 +1,5 @@ CONFIG_SPI=y CONFIG_GPIO=y CONFIG_NRFX_GPPI=y - +CONFIG_NRFX_TIMER=y CONFIG_LOG=y diff --git a/tests/drivers/spi/spim_mosi_toggles/src/main.c b/tests/drivers/spi/spim_mosi_toggles/src/main.c index e6bdbc62032..b65b1882d84 100644 --- a/tests/drivers/spi/spim_mosi_toggles/src/main.c +++ b/tests/drivers/spi/spim_mosi_toggles/src/main.c @@ -12,6 +12,7 @@ LOG_MODULE_REGISTER(spim_mosi_toggles, LOG_LEVEL_INF); #include #include #include +#include #include #include @@ -33,14 +34,10 @@ static uint8_t spim_buffer[2 * TEST_DATA_SIZE] MEMORY_SECTION(DT_BUS(DT_NODELABE /* Variables used to count edges on SPI MOSI line. */ #define CLOCK_INPUT_PIN NRF_DT_GPIOS_TO_PSEL(DT_PATH(zephyr_user), test_gpios) -static const nrfx_gpiote_t gpiote_instance = NRFX_GPIOTE_INSTANCE( - NRF_DT_GPIOTE_INST( - DT_PATH(zephyr_user), test_gpios)); - -#if CONFIG_NRFX_TIMER00 -static const nrfx_timer_t timer_instance = NRFX_TIMER_INSTANCE(00); -#elif CONFIG_NRFX_TIMER130 -static const nrfx_timer_t timer_instance = NRFX_TIMER_INSTANCE(130); +#if defined(NRF_TIMER00) +static nrfx_timer_t timer_instance = NRFX_TIMER_INSTANCE(NRF_TIMER00); +#elif defined(NRF_TIMER130) +static nrfx_timer_t timer_instance = NRFX_TIMER_INSTANCE(NRF_TIMER130); #else #error "No timer instance found" #endif @@ -87,9 +84,11 @@ int main(void) /* Configure GPIOTE. */ uint8_t gpiote_channel; + nrfx_gpiote_t gpiote_instance = + GPIOTE_NRFX_INST_BY_NODE(NRF_DT_GPIOTE_NODE(DT_PATH(zephyr_user), test_gpios)); ret = nrfx_gpiote_channel_alloc(&gpiote_instance, &gpiote_channel); - if (ret != NRFX_SUCCESS) { + if (ret != 0) { LOG_ERR("nrfx_gpiote_channel_alloc(), err: %d", ret); } @@ -106,7 +105,7 @@ int main(void) }; ret = nrfx_gpiote_input_configure(&gpiote_instance, CLOCK_INPUT_PIN, &gpiote_cfg); - if (ret != NRFX_SUCCESS) { + if (ret != 0) { LOG_ERR("nrfx_gpiote_input_configure(), err: %d", ret); } @@ -119,25 +118,22 @@ int main(void) timer_config.mode = NRF_TIMER_MODE_COUNTER; ret = nrfx_timer_init(&timer_instance, &timer_config, timer_handler); - if (ret != NRFX_SUCCESS) { + if (ret != 0) { LOG_ERR("nrfx_timer_init(), err: %d", ret); } nrfx_timer_enable(&timer_instance); /* Configure GPPI from GPIOTE to Timer. */ - uint8_t gppi_channel; + nrfx_gppi_handle_t gppi_handle; + uint32_t eep = nrfx_gpiote_in_event_address_get(&gpiote_instance, CLOCK_INPUT_PIN); + uint32_t tep = nrfx_timer_task_address_get(&timer_instance, NRF_TIMER_TASK_COUNT); - ret = nrfx_gppi_channel_alloc(&gppi_channel); - if (ret != NRFX_SUCCESS) { - LOG_ERR("nrfx_gppi_channel_alloc(), err: %d", ret); + ret = nrfx_gppi_conn_alloc(eep, tep, &gppi_handle); + if (ret != 0) { + LOG_ERR("GPPI channel allocation failed, err: %d", ret); } - - nrfx_gppi_channel_endpoints_setup(gppi_channel, - nrfx_gpiote_in_event_address_get(&gpiote_instance, CLOCK_INPUT_PIN), - nrfx_timer_task_address_get(&timer_instance, NRF_TIMER_TASK_COUNT) - ); - nrfx_gppi_channels_enable(BIT(gppi_channel)); + nrfx_gppi_conn_enable(gppi_handle); /* Set tx_data for current test. Test scenario reqires: * The first transmitted bit in the final byte is 1. From 9eec1c7202db7c5a108b9485cf7378ec20516239 Mon Sep 17 00:00:00 2001 From: Marcin Szymczyk Date: Fri, 21 Nov 2025 14:19:29 +0100 Subject: [PATCH 66/72] mpsl: init: verify enabled instances with DT Since nrfx driver instances are no longer exposed in Kconfig, DT should be used to assert instances will not be used by both MPSL and application. Signed-off-by: Marcin Szymczyk --- subsys/mpsl/init/mpsl_init.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/subsys/mpsl/init/mpsl_init.c b/subsys/mpsl/init/mpsl_init.c index 1fc18efcd18..5ce255c3faf 100644 --- a/subsys/mpsl/init/mpsl_init.c +++ b/subsys/mpsl/init/mpsl_init.c @@ -56,12 +56,16 @@ extern void rtc_pretick_rtc0_isr_hook(void); #if IS_ENABLED(CONFIG_COUNTER) #if IS_ENABLED(CONFIG_SOC_COMPATIBLE_NRF52X) || IS_ENABLED(CONFIG_SOC_NRF5340_CPUNET) -BUILD_ASSERT(!IS_ENABLED(CONFIG_NRFX_RTC0), "MPSL reserves RTC0 on this SoC."); -BUILD_ASSERT(!IS_ENABLED(CONFIG_NRFX_TIMER0), "MPSL reserves TIMER0 on this SoC."); +BUILD_ASSERT(!DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(rtc0)), + "MPSL reserves RTC0 on this SoC."); +BUILD_ASSERT(!DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(timer0)), + "MPSL reserves TIMER0 on this SoC."); #elif IS_ENABLED(CONFIG_SOC_COMPATIBLE_NRF54LX) || IS_ENABLED(CONFIG_SOC_SERIES_NRF71X) -BUILD_ASSERT(!IS_ENABLED(CONFIG_NRFX_TIMER10), "MPSL reserves TIMER10 on this SoC."); +BUILD_ASSERT(!DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(timer10)), + "MPSL reserves TIMER10 on this SoC."); #elif IS_ENABLED(CONFIG_SOC_SERIES_NRF54HX) -BUILD_ASSERT(!IS_ENABLED(CONFIG_NRFX_TIMER020), "MPSL reserves TIMER020 on this SoC."); +BUILD_ASSERT(!DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(timer020)), + "MPSL reserves TIMER020 on this SoC."); #else #error #endif From a846b2ff26b6367b1365e19d11f25de75216ce8d Mon Sep 17 00:00:00 2001 From: Marcin Szymczyk Date: Thu, 20 Nov 2025 15:26:10 +0100 Subject: [PATCH 67/72] samples: peripheral: radio test: align to nrfx 4.0 nrfx functions now return errno.h values. Signed-off-by: Marcin Szymczyk --- samples/peripheral/radio_test/src/radio_test.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/peripheral/radio_test/src/radio_test.c b/samples/peripheral/radio_test/src/radio_test.c index 41bb7f52a37..dd0687e7813 100644 --- a/samples/peripheral/radio_test/src/radio_test.c +++ b/samples/peripheral/radio_test/src/radio_test.c @@ -1226,7 +1226,7 @@ static void timer_handler(nrf_timer_event_t event_type, void *context) static void timer_init(const struct radio_test_config *config) { - nrfx_err_t err; + int err; nrfx_timer_config_t timer_cfg = { .frequency = NRFX_MHZ_TO_HZ(1), .mode = NRF_TIMER_MODE_TIMER, @@ -1235,7 +1235,7 @@ static void timer_init(const struct radio_test_config *config) }; err = nrfx_timer_init(&timer, &timer_cfg, timer_handler); - if (err != NRFX_SUCCESS) { + if (err != 0) { printk("nrfx_timer_init failed with: %d\n", err); } } @@ -1293,7 +1293,7 @@ void radio_handler(const void *context) int radio_test_init(struct radio_test_config *config) { - nrfx_err_t nrfx_err; + int nrfx_err; uint32_t rad_domain = nrfx_gppi_domain_id_get((uint32_t)NRF_RADIO); timer_init(config); @@ -1304,7 +1304,7 @@ int radio_test_init(struct radio_test_config *config) irq_enable(RADIO_TEST_RADIO_IRQn); nrfx_err = nrfx_gppi_domain_conn_alloc(rad_domain, rad_domain, &ppi_radio_start); - if (nrfx_err != NRFX_SUCCESS) { + if (nrfx_err != 0) { printk("Failed to allocate gppi channel.\n"); return -EFAULT; } From a4acc444e48ea795180b21798c8dfddd3ea4a030 Mon Sep 17 00:00:00 2001 From: Marcin Szymczyk Date: Fri, 21 Nov 2025 14:04:27 +0100 Subject: [PATCH 68/72] applications: nrf5340_audio: align to nrfx 4.0 Align to new return codes. Signed-off-by: Marcin Szymczyk --- applications/nrf5340_audio/src/modules/audio_i2s.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/applications/nrf5340_audio/src/modules/audio_i2s.c b/applications/nrf5340_audio/src/modules/audio_i2s.c index bf09c8790de..a0222c7542e 100644 --- a/applications/nrf5340_audio/src/modules/audio_i2s.c +++ b/applications/nrf5340_audio/src/modules/audio_i2s.c @@ -88,10 +88,10 @@ void audio_i2s_set_next_buf(const uint8_t *tx_buf, uint32_t *rx_buf) .p_tx_buffer = (uint32_t *)tx_buf, .buffer_size = I2S_SAMPLES_NUM}; - nrfx_err_t ret; + int ret; ret = nrfx_i2s_next_buffers_set(&i2s_inst, &i2s_buf); - __ASSERT_NO_MSG(ret == NRFX_SUCCESS); + __ASSERT_NO_MSG(ret == 0); } void audio_i2s_start(const uint8_t *tx_buf, uint32_t *rx_buf) @@ -109,11 +109,11 @@ void audio_i2s_start(const uint8_t *tx_buf, uint32_t *rx_buf) .p_tx_buffer = (uint32_t *)tx_buf, .buffer_size = I2S_SAMPLES_NUM}; - nrfx_err_t ret; + int ret; /* Buffer size in 32-bit words */ ret = nrfx_i2s_start(&i2s_inst, &i2s_buf, 0); - __ASSERT_NO_MSG(ret == NRFX_SUCCESS); + __ASSERT_NO_MSG(ret == 0); state = AUDIO_I2S_STATE_STARTED; } @@ -136,7 +136,7 @@ void audio_i2s_init(void) { __ASSERT_NO_MSG(state == AUDIO_I2S_STATE_UNINIT); - nrfx_err_t ret; + int ret; nrfx_clock_hfclkaudio_config_set(HFCLKAUDIO_12_288_MHZ); @@ -154,7 +154,7 @@ void audio_i2s_init(void) irq_enable(DT_IRQN(I2S_NL)); ret = nrfx_i2s_init(&i2s_inst, &cfg, i2s_comp_handler); - __ASSERT_NO_MSG(ret == NRFX_SUCCESS); + __ASSERT_NO_MSG(ret == 0); state = AUDIO_I2S_STATE_IDLE; } From fbb86e6d1e82c9d5e76fc1bea689a8258af1e084 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Tue, 25 Nov 2025 10:36:24 +0100 Subject: [PATCH 69/72] modules: nrfxlib: nrf_802154: Fix control of PPI channels MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rework implementation of local domain and cross domain connections setup. Local domain connections happens frequent from an interrupt context so need to be fast. Signed-off-by: Krzysztof Chruściński --- ..._802154_platform_sl_lptimer_grtc_hw_task.c | 48 +++++++++++-------- .../nrf_802154_platform_timestamper.c | 31 +++++++----- 2 files changed, 47 insertions(+), 32 deletions(-) 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 ea2d2d6013a..7455caffcee 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 @@ -244,47 +244,55 @@ void nrf_802154_platform_sl_lptimer_hw_task_local_domain_connections_clear(void) #define INVALID_CHANNEL UINT8_MAX static nrfx_gppi_handle_t peri_rad_handle; +static uint32_t ppib_chan; void nrf_802154_platform_sl_lptimer_hw_task_cross_domain_connections_setup(uint32_t cc_channel) -{ - ARG_UNUSED(cc_channel); -} - -void nrf_802154_platform_sl_lptimer_hw_task_cross_domain_connections_clear(void) -{ - nrfx_gppi_domain_conn_free(peri_rad_handle); -} - -void nrf_802154_platform_sl_lptimer_hw_task_local_domain_connections_setup(uint32_t dppi_ch, - uint32_t cc_channel) { nrfx_gppi_resource_t resource = { .domain_id = NRFX_GPPI_DOMAIN_RAD, - .channel = dppi_ch + .channel = 0 }; uint32_t eep = z_nrf_grtc_timer_compare_evt_address_get(cc_channel); int err; - if (dppi_ch == NRF_802154_SL_HW_TASK_PPI_INVALID) { - return; - } - - /* Setup a connection between Peri and Rad domain. For Rad domain use provided channel. - * Remaining resources (bridge and dppi channel in PERI) allocate dynamically. - */ err = nrfx_gppi_ext_conn_alloc(NRFX_GPPI_DOMAIN_PERI, NRFX_GPPI_DOMAIN_RAD, &peri_rad_handle, &resource); __ASSERT_NO_MSG(err == 0); + /* Add event endpoint (GRTC compare) to the previously configured connection. */ err = nrfx_gppi_ep_attach(eep, peri_rad_handle); __ASSERT_NO_MSG(err == 0); + /* Get PPIB channel used in the connection. */ + ppib_chan = nrfx_gppi_domain_channel_get(peri_rad_handle, NRFX_GPPI_NODE_PPIB11_21); + __ASSERT_NO_MSG(ppib_chan >= 0); + + /* Disable PPIB for now until exact channel from RADIO domain is known. */ + nrf_ppib_publish_clear(NRF_PPIB11, nrf_ppib_receive_event_get(ppib_chan)); + nrfx_gppi_conn_enable(peri_rad_handle); } -void nrf_802154_platform_sl_lptimer_hw_task_local_domain_connections_clear(void) +void nrf_802154_platform_sl_lptimer_hw_task_cross_domain_connections_clear(void) { nrfx_gppi_conn_disable(peri_rad_handle); + nrfx_gppi_domain_conn_free(peri_rad_handle); +} + +void nrf_802154_platform_sl_lptimer_hw_task_local_domain_connections_setup(uint32_t dppi_ch, + uint32_t cc_channel) +{ + if (dppi_ch == NRF_802154_SL_HW_TASK_PPI_INVALID) { + return; + } + + /* Configure PPIB to forward GRTC event to the DPPI channel from the Radio domain. */ + nrf_ppib_publish_set(NRF_PPIB11, nrf_ppib_receive_event_get(ppib_chan), dppi_ch); +} + +void nrf_802154_platform_sl_lptimer_hw_task_local_domain_connections_clear(void) +{ + nrf_ppib_publish_clear(NRF_PPIB11, nrf_ppib_receive_event_get(ppib_chan)); } #endif 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 1ca69d590cb..ff4038dbc79 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 @@ -231,37 +231,44 @@ void nrf_802154_platform_timestamper_local_domain_connections_setup(uint32_t dpp #include static nrfx_gppi_handle_t rad_peri_handle; +static uint32_t ppib_chan; void nrf_802154_platform_timestamper_cross_domain_connections_setup(void) { - __ASSERT_NO_MSG(rad_peri_handle != 0); + nrfx_gppi_resource_t resource = { + .domain_id = NRFX_GPPI_DOMAIN_RAD, + .channel = 0 + }; nrf_grtc_task_t capture_task = nrfy_grtc_sys_counter_capture_task_get(m_timestamp_cc_channel); uint32_t tep = nrfy_grtc_task_address_get(NRF_GRTC, capture_task); int err; + err = nrfx_gppi_ext_conn_alloc(NRFX_GPPI_DOMAIN_RAD, NRFX_GPPI_DOMAIN_PERI, + &rad_peri_handle, &resource); + __ASSERT_NO_MSG(err == 0); + /* Add task endpoint (GRTC capture) to the previously configured connection. */ err = nrfx_gppi_ep_attach(tep, rad_peri_handle); __ASSERT_NO_MSG(err == 0); + /* Get PPIB channel used in the connection. */ + ppib_chan = nrfx_gppi_domain_channel_get(rad_peri_handle, NRFX_GPPI_NODE_PPIB11_21); + __ASSERT_NO_MSG(ppib_chan >= 0); + + /* Disable PPIB for now until exact channel from RADIO domain is known. */ + nrf_ppib_subscribe_clear(NRF_PPIB11, nrf_ppib_send_task_get(ppib_chan)); + nrfx_gppi_conn_enable(rad_peri_handle); } void nrf_802154_platform_timestamper_local_domain_connections_setup(uint32_t dppi_ch) { - nrfx_gppi_resource_t resource = { - .domain_id = NRFX_GPPI_DOMAIN_RAD, - .channel = dppi_ch - }; - int err; - z_nrf_grtc_timer_capture_prepare(m_timestamp_cc_channel); - /* Setup a connection between Rad and Peri domain. For Rad domain use provided channel. - * Remaining resources (bridge and dppi channel in PERI) allocate dynamically. + /* Configure PPIB to forward provided DPPI channel from Radio domain and enable + * the connection. */ - err = nrfx_gppi_ext_conn_alloc(NRFX_GPPI_DOMAIN_RAD, NRFX_GPPI_DOMAIN_PERI, - &rad_peri_handle, &resource); - __ASSERT_NO_MSG(err == 0); + nrf_ppib_subscribe_set(NRF_PPIB11, nrf_ppib_send_task_get(ppib_chan), dppi_ch); } #endif From d59f88475437db6b576a3458692137488ad9da41 Mon Sep 17 00:00:00 2001 From: Marcin Szymczyk Date: Wed, 26 Nov 2025 11:17:21 +0100 Subject: [PATCH 70/72] debug: ppi_trace: minor fixes nrfx uses errno now. Fix GPPI usage. Signed-off-by: Marcin Szymczyk --- subsys/debug/ppi_trace/ppi_trace.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/subsys/debug/ppi_trace/ppi_trace.c b/subsys/debug/ppi_trace/ppi_trace.c index ce1294de85f..026bdf5fcd1 100644 --- a/subsys/debug/ppi_trace/ppi_trace.c +++ b/subsys/debug/ppi_trace/ppi_trace.c @@ -47,7 +47,7 @@ static bool ppi_trace_gpiote_pin_init( } if (nrfx_gpiote_channel_alloc(ppi_trace_gpiote_pin->gpiote, - &ppi_trace_gpiote_pin->gpiote_channel) != NRFX_SUCCESS) { + &ppi_trace_gpiote_pin->gpiote_channel) < 0) { LOG_ERR("Failed to allocate GPIOTE channel."); return false; } @@ -129,7 +129,7 @@ void *ppi_trace_pair_config(uint32_t pin, uint32_t start_evt, uint32_t stop_evt) /* Address to aligned 32 bit variable will always have 0 on last two bits. Last bit is * used to indicated that it is a pair. */ - return (void *)((uintptr_t)handle1 | 0x1); + return (void *)((uintptr_t)handle1 | BIT(0)); #endif } @@ -150,11 +150,18 @@ int ppi_trace_dppi_ch_trace(uint32_t pin, uint32_t dppi_ch, NRF_DPPIC_Type *p_dp .domain_id = nrfx_gppi_domain_id_get((uint32_t)p_dppi), .channel = dppi_ch }; - - if (nrfx_gppi_ext_conn_alloc(resource.domain_id, dst_domain, &handle, &resource) < 0) { + int err; + + err = nrfx_gppi_ext_conn_alloc(resource.domain_id, dst_domain, &handle, &resource); + if (err == -ENOTSUP) { + /* System with single DPPI instance. Just attach to the channel. */ + nrfx_gppi_ep_attach(tep, dppi_ch); + return 0; + } else if (err < 0) { LOG_ERR("Failed to allocate GPPI channel."); return -ENOMEM; } + nrfx_gppi_ep_attach(tep, handle); nrfx_gppi_conn_enable(handle); @@ -164,22 +171,22 @@ int ppi_trace_dppi_ch_trace(uint32_t pin, uint32_t dppi_ch, NRF_DPPIC_Type *p_dp void ppi_trace_enable(void *handle) { - nrfx_gppi_handle_t *handles = (nrfx_gppi_handle_t *)((uintptr_t)handle & 0x1); + nrfx_gppi_handle_t *handles = (nrfx_gppi_handle_t *)((uintptr_t)handle & ~BIT(0)); nrfx_gppi_conn_enable(handles[0]); /* If LSB bit is set it indicates that handle is for pair of connections. */ - if ((uintptr_t)handle & 0x1) { + if ((uintptr_t)handle & BIT(0)) { nrfx_gppi_conn_enable(handles[1]); } } void ppi_trace_disable(void *handle) { - nrfx_gppi_handle_t *handles = (nrfx_gppi_handle_t *)((uintptr_t)handle & 0x1); + nrfx_gppi_handle_t *handles = (nrfx_gppi_handle_t *)((uintptr_t)handle & ~BIT(0)); nrfx_gppi_conn_disable(handles[0]); /* If LSB bit is set it indicates that handle is for pair of connections. */ - if ((uintptr_t)handle & 0x1) { + if ((uintptr_t)handle & BIT(0)) { nrfx_gppi_conn_disable(handles[1]); } } From 35a943fab4000f43ffb029dafab3ec8a74a9a258 Mon Sep 17 00:00:00 2001 From: Marcin Szymczyk Date: Wed, 26 Nov 2025 12:53:34 +0100 Subject: [PATCH 71/72] manifest: update sdk-nrf-802154 Temporary update to test CI. Signed-off-by: Marcin Szymczyk --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 9a3505c9102..f56cf02c5fc 100644 --- a/west.yml +++ b/west.yml @@ -174,7 +174,7 @@ manifest: - name: nrf-802154 repo-path: sdk-nrf-802154 path: nrf-802154 - revision: 00422af73e817b5a0a75cb34ceed5de1193091ed + revision: 1a3e91557fdd3c2fea0b536046a0020d928b4c0d groups: - nrf-802154 - name: dragoon From 7f9baee7b677b99c72e1b5754b286de95af47bbb Mon Sep 17 00:00:00 2001 From: Marcin Szymczyk Date: Thu, 27 Nov 2025 16:59:10 +0100 Subject: [PATCH 72/72] Revert "tests: drivers: spi: Add test case for MLTPAN-55 workaround" This reverts commit aec0909ee18f88c76076aceb2bc10358cbb61f0d. Signed-off-by: Marcin Szymczyk --- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 12 +-- .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 10 +-- .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 10 +-- .../nrf54ls05dk_nrf54ls05b_cpuapp.overlay | 10 +-- .../nrf54lv10dk_nrf54lv10a_cpuapp.overlay | 10 +-- tests/drivers/spi/spim_pan/prj.conf | 2 - tests/drivers/spi/spim_pan/src/main.c | 75 ++----------------- 7 files changed, 11 insertions(+), 118 deletions(-) diff --git a/tests/drivers/spi/spim_pan/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/spi/spim_pan/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index ebf833ee8af..4f000ae90a9 100644 --- a/tests/drivers/spi/spim_pan/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/drivers/spi/spim_pan/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -41,20 +41,10 @@ dut_spi: &spi130 { dut_spi_dt: test-spi-dev@0 { compatible = "vnd,spi-device"; reg = <0>; - spi-max-frequency = ; + spi-max-frequency = ; }; }; &exmif { status = "disabled"; }; - -tst_timer: &timer131 { - status = "okay"; -}; - -&dppic133 { - owned-channels = <1>; - sink-channels = <1>; - status = "okay"; -}; diff --git a/tests/drivers/spi/spim_pan/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/drivers/spi/spim_pan/boards/nrf54l15dk_nrf54l15_cpuapp.overlay index b3b8b57096a..4d44f1b9703 100644 --- a/tests/drivers/spi/spim_pan/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ b/tests/drivers/spi/spim_pan/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -40,18 +40,10 @@ dut_spi: &spi21 { dut_spi_dt: test-spi-dev@0 { compatible = "vnd,spi-device"; reg = <0>; - spi-max-frequency = ; + spi-max-frequency = ; }; }; &gpio1 { status = "okay"; }; - -tst_timer: &timer20 { - status = "okay"; -}; - -&dppic20 { - status = "okay"; -}; diff --git a/tests/drivers/spi/spim_pan/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/spi/spim_pan/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index e8996c45b81..f53d97531b4 100644 --- a/tests/drivers/spi/spim_pan/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/tests/drivers/spi/spim_pan/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -40,18 +40,10 @@ dut_spi: &spi21 { dut_spi_dt: test-spi-dev@0 { compatible = "vnd,spi-device"; reg = <0>; - spi-max-frequency = ; + spi-max-frequency = ; }; }; &gpio1 { status = "okay"; }; - -tst_timer: &timer20 { - status = "okay"; -}; - -&dppic20 { - status = "okay"; -}; diff --git a/tests/drivers/spi/spim_pan/boards/nrf54ls05dk_nrf54ls05b_cpuapp.overlay b/tests/drivers/spi/spim_pan/boards/nrf54ls05dk_nrf54ls05b_cpuapp.overlay index 04f3533fc63..93ce94a4d86 100644 --- a/tests/drivers/spi/spim_pan/boards/nrf54ls05dk_nrf54ls05b_cpuapp.overlay +++ b/tests/drivers/spi/spim_pan/boards/nrf54ls05dk_nrf54ls05b_cpuapp.overlay @@ -40,18 +40,10 @@ dut_spi: &spi21 { dut_spi_dt: test-spi-dev@0 { compatible = "vnd,spi-device"; reg = <0>; - spi-max-frequency = ; + spi-max-frequency = ; }; }; &gpio1 { status = "okay"; }; - -tst_timer: &timer20 { - status = "okay"; -}; - -&dppic20 { - status = "okay"; -}; diff --git a/tests/drivers/spi/spim_pan/boards/nrf54lv10dk_nrf54lv10a_cpuapp.overlay b/tests/drivers/spi/spim_pan/boards/nrf54lv10dk_nrf54lv10a_cpuapp.overlay index 04f3533fc63..93ce94a4d86 100644 --- a/tests/drivers/spi/spim_pan/boards/nrf54lv10dk_nrf54lv10a_cpuapp.overlay +++ b/tests/drivers/spi/spim_pan/boards/nrf54lv10dk_nrf54lv10a_cpuapp.overlay @@ -40,18 +40,10 @@ dut_spi: &spi21 { dut_spi_dt: test-spi-dev@0 { compatible = "vnd,spi-device"; reg = <0>; - spi-max-frequency = ; + spi-max-frequency = ; }; }; &gpio1 { status = "okay"; }; - -tst_timer: &timer20 { - status = "okay"; -}; - -&dppic20 { - status = "okay"; -}; diff --git a/tests/drivers/spi/spim_pan/prj.conf b/tests/drivers/spi/spim_pan/prj.conf index d55f0782ea2..2358254598b 100644 --- a/tests/drivers/spi/spim_pan/prj.conf +++ b/tests/drivers/spi/spim_pan/prj.conf @@ -1,5 +1,3 @@ CONFIG_SPI=y -CONFIG_NRFX_GPPI=y - CONFIG_ZTEST=y diff --git a/tests/drivers/spi/spim_pan/src/main.c b/tests/drivers/spi/spim_pan/src/main.c index d0e92b9b99b..68689e228d6 100644 --- a/tests/drivers/spi/spim_pan/src/main.c +++ b/tests/drivers/spi/spim_pan/src/main.c @@ -8,19 +8,14 @@ #include #include #include -#include #include -#include -#include - -/* SPI MODE 0 */ #define SPI_MODE (SPI_OP_MODE_MASTER | SPI_WORD_SET(8) | SPI_LINES_SINGLE | SPI_TRANSFER_MSB) -#define TEST_BUFFER_SIZE 64 + +#define TEST_BUFFER_SIZE 8 static struct spi_dt_spec spim_spec = SPI_DT_SPEC_GET(DT_NODELABEL(dut_spi_dt), SPI_MODE, 0); NRF_SPIM_Type *spim_reg = (NRF_SPIM_Type *)DT_REG_ADDR(DT_NODELABEL(dut_spi)); -NRF_TIMER_Type *timer_reg = (NRF_TIMER_Type *)DT_REG_ADDR(DT_NODELABEL(tst_timer)); #define MEMORY_SECTION(node) \ COND_CODE_1(DT_NODE_HAS_PROP(node, memory_regions), \ @@ -44,27 +39,15 @@ static void set_buffers(void) memset(rx_buffer, 0xFF, TEST_BUFFER_SIZE); } -static uint32_t configure_test_timer(NRF_TIMER_Type *preg) -{ - const nrfy_timer_config_t test_timer_config = {.prescaler = 1, - .mode = NRF_TIMER_MODE_COUNTER, - .bit_width = NRF_TIMER_BIT_WIDTH_16}; - - nrfy_timer_periph_configure(preg, &test_timer_config); - nrfy_timer_task_trigger(preg, NRF_TIMER_TASK_START); - - return nrfy_timer_task_address_get(preg, NRF_TIMER_TASK_COUNT); -} - /* * Reference: MLTPAN-8 * Requirements to trigger the PAN workaround * CPHA = 0 (configured in SPI_MODE) - * PRESCALER > 2 (4 for 4MHz) + * PRESCALER > 2 (16 for 1MHz) * First transmitted bit is 1 (0x8B, MSB) */ -ZTEST(spim_pan, test_spim_mltpan_8_workaround) +ZTEST(spim_pan, test_spim_pan_workaround) { int err; @@ -76,59 +59,13 @@ ZTEST(spim_pan, test_spim_mltpan_8_workaround) set_buffers(); - err = spi_transceive_dt(&spim_spec, &tx_spi_buf_set, &rx_spi_buf_set); TC_PRINT("SPIM prescaler: %u\n", spim_reg->PRESCALER); zassert_true(spim_reg->PRESCALER > 2, "SPIM prescaler is not greater than 2\n"); - zassert_ok(err, "SPI transceive failed: %d\n", err); - zassert_mem_equal(tx_buffer, rx_buffer, TEST_BUFFER_SIZE, "TX buffer != RX buffer\n"); -} - -/* - * Reference: MLTPAN-55 - * Requirements to trigger the PAN workaround - * MODE 0 or MODE 2 (CPHA = 0) - * PRESCALER = 4 (4 MHz) for SPIM2x and SPIM3x - * RX.MAXCNT lower than TX.MAXCNT - */ - -ZTEST(spim_pan, test_spim_mltpan_55_workaround) -{ - int err; - uint8_t ppi_channel; - uint32_t timer_cc_before, timer_cc_after; - - uint32_t timer_task; - uint32_t spim_event; - - struct spi_buf tx_spi_buf = {.buf = tx_buffer, .len = TEST_BUFFER_SIZE}; - struct spi_buf_set tx_spi_buf_set = {.buffers = &tx_spi_buf, .count = 1}; - - struct spi_buf rx_spi_buf = {.buf = rx_buffer, .len = TEST_BUFFER_SIZE - 1}; - struct spi_buf_set rx_spi_buf_set = {.buffers = &rx_spi_buf, .count = 1}; - - set_buffers(); - - err = nrfx_gppi_channel_alloc(&ppi_channel); - zassert_equal(nrfx_gppi_channel_alloc(&ppi_channel), NRFX_SUCCESS, - "Failed to allocate GPPI channel"); - - timer_task = configure_test_timer(timer_reg); - spim_event = nrf_spim_event_address_get(spim_reg, NRF_SPIM_EVENT_END); - - nrfx_gppi_channel_endpoints_setup(ppi_channel, spim_event, timer_task); - nrfx_gppi_channels_enable(BIT(ppi_channel)); - - timer_cc_before = nrfy_timer_capture_get(timer_reg, NRF_TIMER_CC_CHANNEL0); err = spi_transceive_dt(&spim_spec, &tx_spi_buf_set, &rx_spi_buf_set); - timer_cc_after = nrfy_timer_capture_get(timer_reg, NRF_TIMER_CC_CHANNEL0); - - TC_PRINT("Timer count before: %u, timer count after: %u\n", timer_cc_before, - timer_cc_after); + zassert_ok(err, "SPI transceive failed: %d\n", err); - zassert_true((timer_cc_after - timer_cc_before) > 0, - "NRF_SPIM_EVENT_END did not trigger\n"); - zassert_mem_equal(tx_buffer, rx_buffer, TEST_BUFFER_SIZE - 1, "TX buffer != RX buffer\n"); + zassert_mem_equal(tx_buffer, rx_buffer, TEST_BUFFER_SIZE, "TX buffer != RX buffer\n"); } ZTEST_SUITE(spim_pan, NULL, test_setup, NULL, NULL, NULL);