Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
410b944
manifest: Update nrfx, zephyr and nrfxlib with GPPI rework
nordic-krch Oct 27, 2025
2ed4fa7
mpsl: hwres: dppi: Align to use NRFX_GPPI
nordic-krch Oct 28, 2025
bd4d7f5
lib: fem_al: Use GPPI instead of nrfx_dppi
nordic-krch Oct 28, 2025
6d87650
debug: ppi_trace: Adapt to use new GPPI API
nordic-krch Oct 28, 2025
2bf7bca
mpsl: fem: Adapt to use GPPI API
nordic-krch Oct 28, 2025
859530b
mpsl: pin_debug: Adapt to use GPPI API
nordic-krch Oct 28, 2025
2b2beaf
debug: cpu_load: Align to the new GPPI API
nordic-krch Oct 28, 2025
fbe5a20
dm: Use GPPI for PPI resource allocation
nordic-krch Oct 28, 2025
685b677
gazell: gzll_glue: Use GPPI for PPI resource allocation
nordic-krch Oct 28, 2025
8e98b1d
esb: Use GPPI for allocating resources
nordic-krch Oct 28, 2025
ea5a4fe
tests: drivers: audio: pdm_loopback: Align to the new GPPI API
nordic-krch Oct 29, 2025
0afb94a
samples: bluetooth: Align to the new GPPI API
nordic-krch Oct 29, 2025
c1aeaac
samples: bluetooth: direct_test_mode: Adapt to the new GPPI API
nordic-krch Oct 29, 2025
2630a42
samples: peripheral: radio_test: Adapt to the new GPPI
nordic-krch Oct 29, 2025
0b85326
modules: nrfxlib: nrf_802154: sl: Adapt to the new GPPI API
nordic-krch Oct 30, 2025
b940c34
samples: peripheral: 802154_phy_test: Align to the new GPPI API
nordic-krch Oct 30, 2025
9a97c5a
applications: nrf5340_audio: Rework to use GPPI API
nordic-krch Oct 30, 2025
7111b2a
tests: drivers: i2c: i2c_latency: Align to changes in nrfx_twis
nordic-krch Oct 31, 2025
a7bedde
tests: modules: mcuboot: external_flash: disable gpio interrupts
nika-nordic Oct 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion applications/nrf5340_audio/src/audio/Kconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ config NRFX_TIMER
default y

# Audio sync timer
config NRFX_DPPI
config NRFX_GPPI
default y
119 changes: 44 additions & 75 deletions applications/nrf5340_audio/src/modules/audio_sync_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include <zephyr/kernel.h>
#include <zephyr/init.h>
#include <nrfx_dppi.h>
#include <helpers/nrfx_gppi.h>
#include <nrfx_i2s.h>
#include <nrfx_ipc.h>
#include <nrfx_rtc.h>
Expand All @@ -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

Expand All @@ -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),
Expand Down Expand Up @@ -171,7 +171,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) {
Expand All @@ -189,92 +189,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_curr_time_capture);

/* 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);

Expand Down
9 changes: 2 additions & 7 deletions include/debug/ppi_trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
#include <stdint.h>
#include <nrfx.h>

#if defined(DPPI_PRESENT)
#include <nrfx_dppi.h>
#endif

#ifdef __cplusplus
extern "C" {
#endif
Expand Down Expand Up @@ -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 */

Expand Down
32 changes: 15 additions & 17 deletions lib/fem_al/fem_al.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <hal/nrf_radio.h>
#include <hal/nrf_timer.h>
#ifdef DPPI_PRESENT
#include <nrfx_dppi.h>
#include <helpers/nrfx_gppi.h>
#endif
#include <nrfx.h>

Expand All @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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;
}
Expand Down
Loading
Loading