Skip to content

Commit

Permalink
mpsl: clock_ctrl: Allow LFCLK timeout on nRF54H20 due to sysctrl IPC …
Browse files Browse the repository at this point in the history
…issue

Add temporary workaround that allows the LFCLK to timeout on nRF54H20
(if CLOCK_CONTROL_NRF2 is enabled). The potential timeout is not
an issue for now because the integration layer request the lowest
accuracy of LFCLK and such or better LFCLK should be runing from
boot of the radio core.

Signed-off-by: Piotr Pryga <[email protected]>
  • Loading branch information
ppryga-nordic committed Feb 7, 2025
1 parent ab470a9 commit 59a8322
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion subsys/mpsl/clock_ctrl/mpsl_clock_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <zephyr/kernel.h>
#include <zephyr/drivers/clock_control.h>
#include <zephyr/drivers/clock_control/nrf_clock_control.h>
#include <zephyr/logging/log.h>

#if defined(CONFIG_CLOCK_CONTROL_NRF)
#include <nrfx_clock.h>
Expand All @@ -15,6 +16,8 @@
#include <mpsl_clock.h>
#include "mpsl_clock_ctrl.h"

LOG_MODULE_REGISTER(mpsl_clock_ctrl, CONFIG_MPSL_LOG_LEVEL);

/* Variable shared for nrf and nrf2 clock control */
static atomic_t m_hfclk_refcnt;

Expand Down Expand Up @@ -86,7 +89,14 @@ static int32_t m_lfclk_wait(void)
return -NRF_EFAULT;
}

if (m_lfclk_state.clk_req_rsp < 0) {
if (IS_ENABLED(CONFIG_CLOCK_CONTROL_NRF2) && m_lfclk_state.clk_req_rsp == -ETIMEDOUT) {
/* Due to NCSDK-31169, temporarily allow for LFCLK request to timeout.
* That doens't break anything now because the LFCLK requested clock is
* 500PPM and such LFCLK should be running from boot of the radio core.
*/
LOG_WRN("LFCLK could not be started: %d", m_lfclk_state.clk_req_rsp);
return 0;
} else if (m_lfclk_state.clk_req_rsp < 0) {
__ASSERT(false, "LFCLK could not be started, reason: %d",
m_lfclk_state.clk_req_rsp);
/* Possible failure reasons:
Expand Down

0 comments on commit 59a8322

Please sign in to comment.