Skip to content

Commit 7ff8355

Browse files
ppryga-nordicnordicjm
authored andcommitted
mpsl: clock_ctrl: Allow LFCLK timeout on nRF54H20 due to sysctrl IPC 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]>
1 parent 107e386 commit 7ff8355

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

subsys/mpsl/clock_ctrl/mpsl_clock_ctrl.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <zephyr/kernel.h>
88
#include <zephyr/drivers/clock_control.h>
99
#include <zephyr/drivers/clock_control/nrf_clock_control.h>
10+
#include <zephyr/logging/log.h>
1011

1112
#if defined(CONFIG_CLOCK_CONTROL_NRF)
1213
#include <nrfx_clock.h>
@@ -15,6 +16,8 @@
1516
#include <mpsl_clock.h>
1617
#include "mpsl_clock_ctrl.h"
1718

19+
LOG_MODULE_REGISTER(mpsl_clock_ctrl, CONFIG_MPSL_LOG_LEVEL);
20+
1821
/* Variable shared for nrf and nrf2 clock control */
1922
static atomic_t m_hfclk_refcnt;
2023

@@ -86,7 +89,14 @@ static int32_t m_lfclk_wait(void)
8689
return -NRF_EFAULT;
8790
}
8891

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

0 commit comments

Comments
 (0)