nRF System Events

Browse source code on GitHub

Overview

This sample demonstrates the use of the nrf_sys_event API to request and release global constant latency mode on Nordic Semiconductor SoCs.

The sample performs the following steps:

  1. Requests global constant latency mode.

  2. Requests global constant latency mode a second time (reference counting incremented).

  3. Releases global constant latency mode — mode remains active due to the outstanding request.

  4. Releases global constant latency mode again — mode is now disabled.

If CONFIG_NRF_SYS_EVENT_IRQ_LATENCY is enabled, the sample additionally measures interrupt latency for RRAMC (Resistive RAM Controller) access in three modes:

Default RRAMC mode

RRAMC enters low-power state with an approximately 15 µs wake-up time.

RRAMC woken by PPI

Uses the nrf_sys_event API to schedule a PPI wake-up before the expected interrupt.

RRAMC Standby mode

Uses the nrf_sys_event API to configure RRAMC to 0 µs wake-up time.

Requirements

The sample is supported on the following Nordic Semiconductor board targets:

  • nrf52dk/nrf52810

  • nrf52dk/nrf52832

  • nrf52833dk/nrf52820

  • nrf52833dk/nrf52833

  • nrf52840dk/nrf52811

  • nrf52840dk/nrf52840

  • nrf5340dk/nrf5340/cpuapp

  • nrf5340dk/nrf5340/cpunet

  • nrf54h20dk/nrf54h20/cpuapp

  • nrf54h20dk/nrf54h20/cpurad

  • nrf54l15dk/nrf54l15/cpuapp

  • nrf7120dk/nrf7120/cpuapp

Building and Running

west build -b nrf52840dk/nrf52840 samples/boards/nordic/nrf_sys_event
west flash

To test with forced constant latency mode enabled from boot (CONFIG_SOC_NRF_FORCE_CONSTLAT):

west build -b nrf52840dk/nrf52840 samples/boards/nordic/nrf_sys_event -- -DCONFIG_SOC_NRF_FORCE_CONSTLAT=y
west flash

To enable IRQ latency measurement for RRAMC (nrf54l15dk only):

west build -b nrf54l15dk/nrf54l15/cpuapp samples/boards/nordic/nrf_sys_event -- -DCONFIG_NRF_SYS_EVENT_IRQ_LATENCY=y
west flash

Sample Output

request global constant latency mode
constant latency mode enabled
request global constant latency mode again
release global constant latency mode
constant latency mode will remain enabled
release global constant latency mode again
constant latency mode will be disabled
constant latency mode disabled