Skip to content
Draft

Mpsl alt #25756

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
11b3ffd
manifest: Update sdk-zephyr, nrfxlib, tf-m and mcuboot revisions
jaz1-nordic Nov 7, 2025
41fda08
nfc: platform: Enable workaround for MLTPAN-60 anomaly
maje-emb Oct 28, 2025
54b1e99
modules: hal_nordic: nrfx: align MDK path to BSP
magp-nordic Sep 12, 2025
eabe9cc
tests: drivers: nrfx_integration_test: remove selecting PRS BOX > 0
magp-nordic Sep 15, 2025
449d563
lib: ram_pwrdn: replace deprecated NRF_POWER symbol
mstasiaknordic Sep 18, 2025
ad51b7a
scripts: quarantine: add not passing tests to quarantine
magp-nordic Sep 18, 2025
42a1422
applications: nrf5340_audio: add prescaler structure
mstasiaknordic Sep 30, 2025
925355f
dts: common: nordic: Switch saadc pin definitions for generic ones
jaz1-nordic Oct 13, 2025
08d1c93
tests: drivers: nrfx_integration_test: remove deleted configs
mstasiaknordic Sep 30, 2025
4f9e635
treewide: align to modified include paths in nrfx
masz-nordic Oct 2, 2025
fc2944d
mpsl: align to name change in mpsl_hwres
masz-nordic Oct 16, 2025
4574ede
samples: bluetooth: align to nrfx 4.0
masz-nordic Oct 23, 2025
0370ba9
tests: bluetooth: replace deprecated API
masz-nordic Oct 28, 2025
90546cf
application: nrf5340_audio: Align to new I2S driver
jaz1-nordic Oct 17, 2025
81e57b7
tests: drivers: nrfx_integration_test: remove deleted I2S configs
jaz1-nordic Oct 17, 2025
07354ee
tests: drivers: nrfx_integration_test: remove deleted PDM configs
jaz1-nordic Oct 20, 2025
a92667d
tests: drivers: nrfx_integration_test: remove deleted QDEC configs
kl-cruz Oct 24, 2025
8904b50
tests: drivers: nrfx_integration_test: remove WDT configs
mstasiaknordic Sep 30, 2025
065c3ac
applications: remove UARTE instance config symbols
mstasiaknordic Oct 20, 2025
484a406
modules: remove UARTE instance config symbols
mstasiaknordic Oct 20, 2025
790b311
samples: remove UARTE instance config symbols
mstasiaknordic Oct 20, 2025
d302a71
tests: remove UARTE instance config symbols
mstasiaknordic Oct 20, 2025
0d47431
boards: align to relocation of nrfx_coredep
masz-nordic Oct 29, 2025
e060c7a
tests: drivers: nrfx_integration_test: remove PWM configs
mib1-nordic Oct 1, 2025
aad387c
applications: Align to changes in nrfx_timer driver
mib1-nordic Oct 6, 2025
ec2d59c
samples: Align to changes in nrfx_timer driver
mib1-nordic Oct 6, 2025
9045ec0
tests: Align to changes in nrfx_timer driver
mib1-nordic Oct 22, 2025
586d013
debug: cpu_load: align to changes in nrfx_timer
mib1-nordic Oct 27, 2025
34affdf
esb: Align to changes in nrfx_timer
mib1-nordic Oct 27, 2025
4e5b322
nfc: Align to changes in nrfx_timer driver
mib1-nordic Oct 27, 2025
74a1d38
tests: i2c: Align tests to I2C API changes
adamkondraciuk Oct 17, 2025
054958d
soc: nrf54ls05b: add config indicating MPU presense
mstasiaknordic Oct 27, 2025
3684b69
mpsl: hwres: dppi: Align to use NRFX_GPPI
nordic-krch Oct 28, 2025
cd07d79
lib: fem_al: Use GPPI instead of nrfx_dppi
nordic-krch Oct 28, 2025
9b29ea6
debug: ppi_trace: Adapt to use new GPPI API
nordic-krch Oct 28, 2025
420c3b6
mpsl: fem: Adapt to use GPPI API
nordic-krch Oct 28, 2025
b2a6504
mpsl: pin_debug: Adapt to use GPPI API
nordic-krch Oct 28, 2025
eeda033
debug: cpu_load: Align to the new GPPI API
nordic-krch Oct 28, 2025
bc1f9a2
dm: Use GPPI for PPI resource allocation
nordic-krch Oct 28, 2025
6e3e782
gazell: gzll_glue: Use GPPI for PPI resource allocation
nordic-krch Oct 28, 2025
0370eb9
esb: Use GPPI for allocating resources
nordic-krch Oct 28, 2025
0ff609c
tests: drivers: audio: pdm_loopback: Align to the new GPPI API
nordic-krch Oct 29, 2025
2870314
samples: bluetooth: Align to the new GPPI API
nordic-krch Oct 29, 2025
dbfd3ab
samples: bluetooth: direct_test_mode: Adapt to the new GPPI API
nordic-krch Oct 29, 2025
db7b514
samples: peripheral: radio_test: Adapt to the new GPPI
nordic-krch Oct 29, 2025
93fd4c8
modules: nrfxlib: nrf_802154: sl: Adapt to the new GPPI API
nordic-krch Oct 30, 2025
5349d5c
samples: peripheral: 802154_phy_test: Align to the new GPPI API
nordic-krch Oct 30, 2025
568be5d
applications: nrf5340_audio: Rework to use GPPI API
nordic-krch Oct 30, 2025
b0abaa3
tests: drivers: i2c: i2c_latency: Align to changes in nrfx_twis
nordic-krch Oct 31, 2025
67bf78c
tests: modules: mcuboot: external_flash: disable gpio interrupts
nika-nordic Oct 30, 2025
079743e
drivers: serial: lpuart: align to nrfx_gpiote changes
nika-nordic Oct 28, 2025
ef0e62b
samples: bluetooth: time_sync: align to nrfx_gpiote changes
nika-nordic Oct 30, 2025
308693f
samples: peripheral: 802154_phy_test: align to nrfx_gpiote changes
nika-nordic Oct 30, 2025
ebdeb87
debug: ppi_trace: align to nrfx_gpiote changes
nika-nordic Oct 30, 2025
1f47143
mpsl: align to nrfx_gpiote changes
nika-nordic Oct 30, 2025
58c0cfb
tests: drivers: audio: pdm_loopback: align to nrfx_gpiote changes
nika-nordic Oct 30, 2025
ada2171
tests: drivers: audio: pdm_loopback: fix incorrect error code
nika-nordic Oct 31, 2025
6a5b162
tests: drivers: i2c: i2c_latency: fix incorrect error code
nika-nordic Oct 31, 2025
e1ea8fd
samples: bluetooth: time_sync: fix gpiote reference
nika-nordic Oct 31, 2025
dcb9050
drivers: mpsl: clock: add missing `lfclk` functions
masz-nordic Nov 5, 2025
8a7e868
treewide: update error codes for nrfx_clock driver
mif1-nordic Nov 5, 2025
3ed27e9
nfc: lib: replace nrfx_err_t with errno
mstasiaknordic Oct 22, 2025
b012902
treewide: align to nrfx_rtc returning errno
mstasiaknordic Oct 22, 2025
2363266
treewide: align to nrfx_nvmc returning errno
mstasiaknordic Oct 22, 2025
823a9fb
all: Align to GPPI API tweaking
nordic-krch Nov 4, 2025
785f892
tests: drivers: spi: align to new timer and gpiote drivers
jaz1-nordic Nov 18, 2025
45f9dcb
mpsl: init: verify enabled instances with DT
masz-nordic Nov 21, 2025
0ea3abf
samples: peripheral: radio test: align to nrfx 4.0
masz-nordic Nov 20, 2025
650a864
applications: nrf5340_audio: align to nrfx 4.0
masz-nordic Nov 21, 2025
187155b
modules: nrfxlib: nrf_802154: Fix control of PPI channels
nordic-krch Nov 25, 2025
6c45f97
debug: ppi_trace: fix comparing error code
masz-nordic Nov 26, 2025
52f7e4a
manifest: update sdk-nrf-802154
masz-nordic Nov 26, 2025
8ca7d52
TMP: test MPSL alt
masz-nordic Nov 24, 2025
f91695e
Revert "all: Align to GPPI API tweaking"
masz-nordic Nov 24, 2025
bfac099
Revert "mpsl: hwres: dppi: Align to use NRFX_GPPI"
masz-nordic Nov 24, 2025
b21da50
Revert "mpsl: align to name change in mpsl_hwres"
masz-nordic Nov 24, 2025
3c758d5
mpsl: hwres: dppi: Align to use NRFX_GPPI
nordic-krch Oct 28, 2025
18ea558
all: Align to GPPI API tweaking
nordic-krch Nov 4, 2025
00cb7d3
TMP: switch sdk-zephyr
masz-nordic Nov 25, 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
8 changes: 3 additions & 5 deletions applications/connectivity_bridge/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,9 @@ 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_TIMER1=y
CONFIG_NRFX_TIMER2=y
CONFIG_NRFX_PPI=y
CONFIG_NRFX_UARTE=y
CONFIG_NRFX_TIMER=y
CONFIG_NRFX_GPPI=y

CONFIG_HW_ID_LIBRARY=y
CONFIG_RESET_ON_FATAL_ERROR=y
Expand Down
2 changes: 1 addition & 1 deletion applications/nrf5340_audio/Kconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ config REGULATOR
config CONTIN_ARRAY
default y

config NRFX_I2S0
config NRFX_I2S
default y

config PCM_MIX
Expand Down
4 changes: 2 additions & 2 deletions applications/nrf5340_audio/src/audio/Kconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
#

# Audio sync timer
config NRFX_TIMER1
config NRFX_TIMER
default y

# Audio sync timer
config NRFX_DPPI
config NRFX_GPPI
default y
24 changes: 13 additions & 11 deletions applications/nrf5340_audio/src/modules/audio_i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand All @@ -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)
Expand All @@ -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;
Expand Down Expand Up @@ -86,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)
Expand All @@ -107,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;
}
Expand All @@ -134,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);

Expand All @@ -148,11 +150,11 @@ 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);
__ASSERT_NO_MSG(ret == NRFX_SUCCESS);
__ASSERT_NO_MSG(ret == 0);

state = AUDIO_I2S_STATE_IDLE;
}
129 changes: 49 additions & 80 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 @@ -28,10 +28,10 @@ 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;
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 @@ -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;
nrfx_dppi_t dppi = NRFX_DPPI_INSTANCE(0);
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;
}
Expand All @@ -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_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
1 change: 0 additions & 1 deletion applications/nrf5340_audio/src/utils/peripherals.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
24 changes: 22 additions & 2 deletions drivers/mpsl/clock_control/nrfx_clock_mpsl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -81,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;
}


Expand Down
Loading
Loading