From c5b3c2c4488d420f1645445079bb6ba3f8c3d05b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Ku=C5=BAnia?= Date: Wed, 9 Apr 2025 11:23:48 +0200 Subject: [PATCH 1/2] mpsl: clock_ctrl: fire XO_TUNED on nRF54L SoC series MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The MPSL executes the HFCLK callback when the clock is active and stable on nRF54L SoCs. This fact must be reflected in the parameter of the event_handlier, which should receive the NRFX_CLOCK_EVT_XO_TUNED value. Signed-off-by: Rafał Kuźnia --- drivers/mpsl/clock_control/nrfx_clock_mpsl.c | 4 ++++ west.yml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/mpsl/clock_control/nrfx_clock_mpsl.c b/drivers/mpsl/clock_control/nrfx_clock_mpsl.c index ed0b23dff39b..27594979cfe1 100644 --- a/drivers/mpsl/clock_control/nrfx_clock_mpsl.c +++ b/drivers/mpsl/clock_control/nrfx_clock_mpsl.c @@ -12,7 +12,11 @@ static nrfx_clock_event_handler_t event_handler; static void mpsl_hfclk_callback(void) { +#if IS_ENABLED(CONFIG_SOC_SERIES_NRF54LX) + event_handler(NRFX_CLOCK_EVT_XO_TUNED); +#else event_handler(NRFX_CLOCK_EVT_HFCLK_STARTED); +#endif } void nrfx_clock_start(nrf_clock_domain_t domain) diff --git a/west.yml b/west.yml index 51605cd83d6a..78a445e59cba 100644 --- a/west.yml +++ b/west.yml @@ -65,7 +65,7 @@ manifest: # https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/modules.html - name: zephyr repo-path: sdk-zephyr - revision: 4ff1c3616aeecb52617d87bfdf2da0435f36fb17 + revision: 59a8d2d1692d43086c0343e9ba87a800a2e93bc4 import: # In addition to the zephyr repository itself, NCS also # imports the contents of zephyr/west.yml at the above From 742cca420a0b3c41bcfd11594b9ce44637817080 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20Laso=C5=84czyk?= Date: Thu, 10 Apr 2025 11:57:20 +0200 Subject: [PATCH 2/2] tests: drivers: Change comparison of ticks in PDM loopback test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Loosening value of comparison. Signed-off-by: Karol Lasończyk --- tests/drivers/audio/pdm_loopback/src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/drivers/audio/pdm_loopback/src/main.c b/tests/drivers/audio/pdm_loopback/src/main.c index 532a1365a2c4..1fb144d4f5a4 100644 --- a/tests/drivers/audio/pdm_loopback/src/main.c +++ b/tests/drivers/audio/pdm_loopback/src/main.c @@ -270,9 +270,9 @@ ZTEST(pdm_loopback, test_pdm_clk_frequency) uint32_t pulses = nrfx_timer_capture_get(&timer_instance, NRF_TIMER_CC_CHANNEL0); - /* Assert that captured frequency is within 2% margin of expected one. */ + /* Assert that captured frequency is within 3% margin of expected one. */ zassert_within(pulses, PDM_EXPECTED_FREQ * SAMPLING_RATIO, - PDM_EXPECTED_FREQ * SAMPLING_RATIO / 50, + PDM_EXPECTED_FREQ * SAMPLING_RATIO / 30, "Captured incorrect frequency Hz. Captured pulses = %lu, expected = %lu", pulses, PDM_EXPECTED_FREQ * SAMPLING_RATIO); }