Skip to content

Commit 51ba08d

Browse files
gordonklausnordicjm
authored andcommitted
samples: Fix mpsl/timeslot sample on nRF54H20
On this board, the high frequency crystal oscillator is required or timeslot requests will not be serviced in a timely manner. Signed-off-by: Gordon Klaus <[email protected]>
1 parent 74eb329 commit 51ba08d

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

samples/mpsl/timeslot/README.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ The timeslot session is closed when any key is pressed in the terminal.
4040
For the nRF54L Series ``mpsl_timer0`` is the ``timer10`` instance.
4141
For the nRF54H Series ``mpsl_timer0`` is the ``timer020`` instance.
4242

43+
.. note::
44+
For the nRF54H20, if you want to use ``MPSL_TIMESLOT_HFCLK_CFG_NO_GUARANTEE`` then you must request the HFXO earlier using the :c:func:`mpsl_clock_hfclk_request` function.
45+
4346
Building and running
4447
********************
4548

samples/mpsl/timeslot/src/main.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,23 @@ enum mpsl_timeslot_call {
5050
CLOSE_SESSION,
5151
};
5252

53+
#if defined(CONFIG_SOC_SERIES_NRF54HX)
54+
#define HFCLK_CFG MPSL_TIMESLOT_HFCLK_CFG_XTAL_GUARANTEED
55+
#else
56+
#define HFCLK_CFG MPSL_TIMESLOT_HFCLK_CFG_NO_GUARANTEE
57+
#endif /* CONFIG_SOC_SERIES_NRF54HX */
58+
5359
/* Timeslot requests */
5460
static mpsl_timeslot_request_t timeslot_request_earliest = {
5561
.request_type = MPSL_TIMESLOT_REQ_TYPE_EARLIEST,
56-
.params.earliest.hfclk = MPSL_TIMESLOT_HFCLK_CFG_NO_GUARANTEE,
62+
.params.earliest.hfclk = HFCLK_CFG,
5763
.params.earliest.priority = MPSL_TIMESLOT_PRIORITY_NORMAL,
5864
.params.earliest.length_us = TIMESLOT_LENGTH_US,
5965
.params.earliest.timeout_us = 1000000
6066
};
6167
static mpsl_timeslot_request_t timeslot_request_normal = {
6268
.request_type = MPSL_TIMESLOT_REQ_TYPE_NORMAL,
63-
.params.normal.hfclk = MPSL_TIMESLOT_HFCLK_CFG_NO_GUARANTEE,
69+
.params.normal.hfclk = HFCLK_CFG,
6470
.params.normal.priority = MPSL_TIMESLOT_PRIORITY_NORMAL,
6571
.params.normal.distance_us = TIMESLOT_REQUEST_DISTANCE_US,
6672
.params.normal.length_us = TIMESLOT_LENGTH_US

0 commit comments

Comments
 (0)