soc: nordic: nrf54h: Add STM data flushing in pre_sleep

In order to get all data from STMESP written to ETR and processed
on time we need to write dummy data before sleep.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
Krzysztof Chruściński 2024-04-25 13:41:55 +02:00 committed by Anas Nashif
commit 1dcd599982

View file

@ -10,6 +10,10 @@
#include <zephyr/kernel.h> #include <zephyr/kernel.h>
#include <zephyr/logging/log.h> #include <zephyr/logging/log.h>
#ifdef CONFIG_LOG_FRONTEND_STMESP
#include <zephyr/logging/log_frontend_stmesp.h>
#endif
#include <hal/nrf_hsfll.h> #include <hal/nrf_hsfll.h>
#include <hal/nrf_lrcconf.h> #include <hal/nrf_lrcconf.h>
#include <hal/nrf_spu.h> #include <hal/nrf_spu.h>
@ -112,6 +116,17 @@ static int trim_hsfll(void)
return 0; return 0;
} }
#if defined(CONFIG_ARM_ON_ENTER_CPU_IDLE_HOOK)
bool z_arm_on_enter_cpu_idle(void)
{
#ifdef CONFIG_LOG_FRONTEND_STMESP
log_frontend_stmesp_pre_sleep();
#endif
return true;
}
#endif
static int nordicsemi_nrf54h_init(void) static int nordicsemi_nrf54h_init(void)
{ {
int err; int err;