Skip to content

Commit 7f7ccdb

Browse files
committed
soc: nordic: common: force CONSTLAT kconfig
Add an option to force constant latency mode at application startup. Signed-off-by: Jordan Yates <[email protected]>
1 parent 2d72d86 commit 7f7ccdb

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

soc/nordic/common/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,5 @@ if(CONFIG_TFM_PARTITION_PLATFORM)
3939
endif()
4040

4141
zephyr_library_sources_ifdef(CONFIG_NRF_SYS_EVENT nrf_sys_event.c)
42+
zephyr_library_sources_ifdef(CONFIG_NRF_FORCE_CONSTANT_LATENCY nrf_constlat.c)
4243
zephyr_library_sources_ifdef(CONFIG_MRAM_LATENCY mram_latency.c)

soc/nordic/common/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ config NRF_SYS_EVENT
2121
bool "nRF system event support"
2222
select NRFX_POWER if !NRF_PLATFORM_HALTIUM
2323

24+
config NRF_FORCE_CONSTANT_LATENCY
25+
bool "Force constant latency mode in system ON"
26+
depends on NRF_SYS_EVENT
27+
help
28+
Forcing constant latency mode minimises CPU wakeup latency and PPI task
29+
response time, at the cost of increased power consumption.
30+
2431
config MRAM_LATENCY
2532
bool "MRAM latency manager"
2633
depends on NRFS_HAS_MRAM_SERVICE

soc/nordic/common/nrf_constlat.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
* Copyright (c) 2025 Embeint Pty Ltd
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/init.h>
8+
9+
#include <nrf_sys_event.h>
10+
11+
static int nrf_const_lat(void)
12+
{
13+
return nrf_sys_event_request_global_constlat();
14+
}
15+
16+
/* Immediately after the SoC init functions */
17+
SYS_INIT(nrf_const_lat, PRE_KERNEL_1, 1);

0 commit comments

Comments
 (0)