drivers: debug: Moved nrf_etr from misc

Moved the nrf_etr driver from the drive/misc folder into the recently
established driver/debug folder where it is a better fit. Moved the
associated files such as bindings and headers accordingly as well.

Signed-off-by: Karsten Koenig <karsten.koenig@nordicsemi.no>
This commit is contained in:
Karsten Koenig
2025-10-03 13:51:17 +02:00
committed by Benjamin Cabé
parent 7a1e82a335
commit d833556ee5
16 changed files with 81 additions and 82 deletions

View File

@@ -119,7 +119,7 @@ When using logs, this method has the following advantages:
Proxy core is using Nordic specific peripheral (TBM) to get ETR buffer busyness and send data over
UART. Nordic specific driver for ETR buffer is located in
:zephyr_file:`drivers/misc/coresight/nrf_etr.c`.
:zephyr_file:`drivers/debug/debug_nrf_etr.c`.
Configuration
-------------
@@ -175,7 +175,7 @@ in :zephyr_file:`subsys/logging/frontends/log_frontend_stmesp_demux.c`.
``Proxy`` is using Nordic specific peripheral (TBM) to get ETR buffer busyness and read and
decode data and send human-readable data over UART. Nordic specific driver for ETR buffer is
located in :zephyr_file:`drivers/misc/coresight/nrf_etr.c`. It is using :ref:`cs_trace_defmt` and
located in :zephyr_file:`drivers/debug/debug_nrf_etr.c`. It is using :ref:`cs_trace_defmt` and
:ref:`mipi_stp_decoder` and above-mentioned demultiplexer to decode messages.
Logging messages contains read-only format string used in the logging macros thus they cannot be

View File

@@ -5,4 +5,5 @@ zephyr_library()
# zephyr-keep-sorted-start
zephyr_library_sources_ifdef(CONFIG_DEBUG_SILABS_PTI debug_silabs_pti.c)
zephyr_library_sources_ifdef(CONFIG_DEBUG_NRF_ETR debug_nrf_etr.c)
# zephyr-keep-sorted-stop

View File

@@ -15,6 +15,7 @@ config DEBUG_DRIVER_INIT_PRIORITY
Debug drivers initialization priority.
# zephyr-keep-sorted-start
source "drivers/debug/Kconfig.nrf"
source "drivers/debug/Kconfig.silabs"
# zephyr-keep-sorted-stop

View File

@@ -3,7 +3,7 @@
DT_COMPAT_NORDIC_NRF_TBM := nordic,nrf-tbm
config NRF_ETR
config DEBUG_NRF_ETR
bool "Coresight ETR handler (with Nordic TBM)"
depends on $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_TBM))
select NRFX_TBM
@@ -14,9 +14,9 @@ config NRF_ETR
data). Busyness is tracked using TBM (Trace Buffer Monitor) peripheral
which is specific to Nordic Semiconductor SoCs.
if NRF_ETR
if DEBUG_NRF_ETR
config NRF_ETR_DECODE
config DEBUG_NRF_ETR_DECODE
bool "Decode ETR content"
default y if LOG_FRONTEND_STMESP_FSC
select MIPI_STP_DECODER
@@ -29,14 +29,14 @@ config NRF_ETR_DECODE
In this mode, log messages stored by Coresight STM logging frontends are
decoded and printed in the human readable form.
config NRF_ETR_DECODE_DROP_PERIOD
config DEBUG_NRF_ETR_DECODE_DROP_PERIOD
int "Period of dropped messages notification"
default 5000
help
Period (in milliseconds) how often it is checked if any dropped messages
have occurred.
config NRF_ETR_DEBUG
config DEBUG_NRF_ETR_DEBUG
bool "Debug mode"
depends on !LOG_PRINTK
select MIPI_STP_DECODER
@@ -44,18 +44,18 @@ config NRF_ETR_DEBUG
help
In debug mode STPv2 decoded data is printed.
config NRF_ETR_STACK_SIZE
config DEBUG_NRF_ETR_STACK_SIZE
int "ETR thread stack size"
default 2048 if NRF_ETR_DECODE || NRF_ETR_DEBUG
default 2048 if DEBUG_NRF_ETR_DECODE || DEBUG_NRF_ETR_DEBUG
default 1024
config NRF_ETR_BACKOFF
config DEBUG_NRF_ETR_BACKOFF
int "Thread backoff time (ms)"
default 10
help
Determines how often attempt to dump the data is performed.
config NRF_ETR_FLUSH_TIMEOUT
config DEBUG_NRF_ETR_FLUSH_TIMEOUT
int "Backoff time during flushing (ms)"
default 100
help
@@ -63,10 +63,10 @@ config NRF_ETR_FLUSH_TIMEOUT
there is still a pending ETR data. This option specifies how often
thread is waking up to check. Given in milliseconds.
config NRF_ETR_SYNC_PERIOD
config DEBUG_NRF_ETR_SYNC_PERIOD
int "Period of custom synchronization frame"
default 0 if NRF_ETR_DECODE
default 0 if NRF_ETR_DEBUG
default 0 if DEBUG_NRF_ETR_DECODE
default 0 if DEBUG_NRF_ETR_DEBUG
default 16
help
To help find the synchronization when decoding the ETR content
@@ -74,25 +74,25 @@ config NRF_ETR_SYNC_PERIOD
sent on regular intervals. This frame is sent between Coresight formatter
frames. Use 0 to disable.
config NRF_ETR_SHELL
config DEBUG_NRF_ETR_SHELL
bool "Use shell"
select UART_ASYNC_API
select UART_ASYNC_RX_HELPER
select SHELL_LOG_BACKEND_CUSTOM
depends on NRF_ETR_DECODE
depends on DEBUG_NRF_ETR_DECODE
default y if SHELL
help
Enable shell with Coresight STM logging support.
if NRF_ETR_SHELL
if DEBUG_NRF_ETR_SHELL
config NRF_ETR_SHELL_PROMPT
config DEBUG_NRF_ETR_SHELL_PROMPT
string "Displayed prompt name"
default "uart:~$ "
help
Displayed prompt name for UART shell with Coresight STM logging.
config NRF_ETR_SHELL_ASYNC_RX_BUFFER_SIZE
config DEBUG_NRF_ETR_SHELL_ASYNC_RX_BUFFER_SIZE
int "Size of the RX buffer"
default 16
help
@@ -101,13 +101,13 @@ config NRF_ETR_SHELL_ASYNC_RX_BUFFER_SIZE
slow and may need to be increased if long messages are pasted directly
to the shell prompt.
config NRF_ETR_SHELL_ASYNC_RX_BUFFER_COUNT
config DEBUG_NRF_ETR_SHELL_ASYNC_RX_BUFFER_COUNT
int "Number of RX buffers"
default 4
range 2 64
help
Number of RX buffers.
endif # NRF_ETR_SHELL
endif # DEBUG_NRF_ETR_SHELL
endif # NRF_ETR
endif # DEBUG_NRF_ETR

View File

@@ -16,7 +16,7 @@
#include <zephyr/debug/coresight/cs_trace_defmt.h>
#include <zephyr/debug/mipi_stp_decoder.h>
#include <zephyr/linker/devicetree_regions.h>
#include <zephyr/drivers/misc/coresight/nrf_etr.h>
#include <zephyr/drivers/debug/debug_nrf_etr.h>
#include <zephyr/drivers/serial/uart_async_rx.h>
#include <zephyr/sys/printk.h>
#include <dmm.h>
@@ -29,15 +29,15 @@ LOG_MODULE_REGISTER(cs_etr_tbm);
#define ETR_BUFFER_NODE DT_NODELABEL(etr_buffer)
#define DROP_CHECK_PERIOD \
COND_CODE_1(CONFIG_NRF_ETR_DECODE, \
(CONFIG_NRF_ETR_DECODE_DROP_PERIOD), (0))
COND_CODE_1(CONFIG_DEBUG_NRF_ETR_DECODE, \
(CONFIG_DEBUG_NRF_ETR_DECODE_DROP_PERIOD), (0))
#define MIN_DATA (2 * CORESIGHT_TRACE_FRAME_SIZE32)
/* Since ETR debug is a part of logging infrastructure, logging cannot be used
* for debugging. Printk is used (assuming CONFIG_LOG_PRINTK=n)
*/
#define DBG(...) IF_ENABLED(CONFIG_NRF_ETR_DEBUG, (printk(__VA_ARGS__)))
#define DBG(...) IF_ENABLED(CONFIG_DEBUG_NRF_ETR_DEBUG, (printk(__VA_ARGS__)))
/** @brief Macro for dumping debug data.
*
@@ -86,10 +86,10 @@ static const struct device *uart_dev = DEVICE_DT_GET(UART_NODE);
static uint32_t frame_buf0[CORESIGHT_TRACE_FRAME_SIZE32] DMM_MEMORY_SECTION(UART_NODE);
static uint32_t frame_buf1[CORESIGHT_TRACE_FRAME_SIZE32] DMM_MEMORY_SECTION(UART_NODE);
static uint32_t frame_buf_decode[CORESIGHT_TRACE_FRAME_SIZE32];
static uint32_t *frame_buf = IS_ENABLED(CONFIG_NRF_ETR_DECODE) ?
static uint32_t *frame_buf = IS_ENABLED(CONFIG_DEBUG_NRF_ETR_DECODE) ?
frame_buf_decode : frame_buf0;
K_KERNEL_STACK_DEFINE(etr_stack, CONFIG_NRF_ETR_STACK_SIZE);
K_KERNEL_STACK_DEFINE(etr_stack, CONFIG_DEBUG_NRF_ETR_STACK_SIZE);
static struct k_thread etr_thread;
BUILD_ASSERT((DT_REG_SIZE(ETR_BUFFER_NODE) % CONFIG_DCACHE_LINE_SIZE) == 0);
@@ -134,9 +134,10 @@ static const char *const hw_evts[] = {
"GD0 HS down", /* 31 Global domain high speed 0 down */
};
#ifdef CONFIG_NRF_ETR_SHELL
#ifdef CONFIG_DEBUG_NRF_ETR_SHELL
#define RX_BUF_SIZE \
(CONFIG_NRF_ETR_SHELL_ASYNC_RX_BUFFER_SIZE * CONFIG_NRF_ETR_SHELL_ASYNC_RX_BUFFER_COUNT)
(CONFIG_DEBUG_NRF_ETR_SHELL_ASYNC_RX_BUFFER_SIZE * \
CONFIG_DEBUG_NRF_ETR_SHELL_ASYNC_RX_BUFFER_COUNT)
static void etr_timer_handler(struct k_timer *timer);
K_TIMER_DEFINE(etr_timer, etr_timer_handler, NULL);
@@ -278,7 +279,7 @@ static void message_process(union log_frontend_stmesp_demux_packet packet)
*/
static void sync_loss(void)
{
if (IS_ENABLED(CONFIG_NRF_ETR_DECODE)) {
if (IS_ENABLED(CONFIG_DEBUG_NRF_ETR_DECODE)) {
mipi_stp_decoder_sync_loss();
log_frontend_stmesp_demux_reset();
oosync_cnt++;
@@ -292,7 +293,7 @@ static void sync_loss(void)
*/
static void on_resync(void)
{
if (IS_ENABLED(CONFIG_NRF_ETR_DECODE)) {
if (IS_ENABLED(CONFIG_DEBUG_NRF_ETR_DECODE)) {
in_sync = true;
}
}
@@ -365,7 +366,7 @@ static void decoder_cb(enum mipi_stp_decoder_ctrl_type type,
decoder_cb_debug(type, data, ts, marked);
if (!IS_ENABLED(CONFIG_NRF_ETR_DECODE)) {
if (!IS_ENABLED(CONFIG_DEBUG_NRF_ETR_DECODE)) {
return;
}
@@ -549,7 +550,7 @@ static void dump_frame(uint8_t *buf)
static void process(void)
{
static const uint32_t *const etr_buf = (uint32_t *)(DT_REG_ADDR(ETR_BUFFER_NODE));
static uint32_t sync_cnt;
static uint32_t sync_cnt = CONFIG_DEBUG_NRF_ETR_SYNC_PERIOD;
uint32_t pending;
/* If function is called in panic mode then it may interrupt ongoing
@@ -562,7 +563,7 @@ static void process(void)
*/
while ((pending = pending_data()) >= MIN_DATA) {
/* Do not read the data that has already been read but not yet processed. */
if (sync_cnt || (CONFIG_NRF_ETR_SYNC_PERIOD == 0)) {
if (sync_cnt || (CONFIG_DEBUG_NRF_ETR_SYNC_PERIOD == 0)) {
sync_cnt--;
sys_cache_data_invd_range((void *)&etr_buf[etr_rd_idx & wsize_mask],
CORESIGHT_TRACE_FRAME_SIZE);
@@ -572,11 +573,12 @@ static void process(void)
rd_idx_inc();
__sync_synchronize();
} else {
sync_cnt = CONFIG_NRF_ETR_SYNC_PERIOD;
sync_cnt = CONFIG_DEBUG_NRF_ETR_SYNC_PERIOD;
memset(frame_buf, 0xff, CORESIGHT_TRACE_FRAME_SIZE);
}
if (IS_ENABLED(CONFIG_NRF_ETR_DECODE) || IS_ENABLED(CONFIG_NRF_ETR_DEBUG)) {
if (IS_ENABLED(CONFIG_DEBUG_NRF_ETR_DECODE) ||
IS_ENABLED(CONFIG_DEBUG_NRF_ETR_DEBUG)) {
if ((pending >= (wsize_mask - MIN_DATA)) ||
(pending_data() >= (wsize_mask - MIN_DATA))) {
/* If before or after reading the frame it is close to full
@@ -586,7 +588,7 @@ static void process(void)
}
process_frame((uint8_t *)frame_buf, pending);
if (IS_ENABLED(CONFIG_NRF_ETR_DECODE)) {
if (IS_ENABLED(CONFIG_DEBUG_NRF_ETR_DECODE)) {
process_messages();
}
} else {
@@ -612,7 +614,7 @@ static int decoder_init(void)
}
once = true;
if (IS_ENABLED(CONFIG_NRF_ETR_DECODE)) {
if (IS_ENABLED(CONFIG_DEBUG_NRF_ETR_DECODE)) {
static const struct log_frontend_stmesp_demux_config config = {
.m_ids = stm_m_id,
.m_ids_cnt = ARRAY_SIZE(stm_m_id),
@@ -635,12 +637,12 @@ static int decoder_init(void)
return 0;
}
void nrf_etr_flush(void)
void debug_nrf_etr_flush(void)
{
int cnt = 4;
if (IS_ENABLED(CONFIG_NRF_ETR_DECODE) ||
IS_ENABLED(CONFIG_NRF_ETR_DEBUG)) {
if (IS_ENABLED(CONFIG_DEBUG_NRF_ETR_DECODE) ||
IS_ENABLED(CONFIG_DEBUG_NRF_ETR_DEBUG)) {
(void)decoder_init();
}
@@ -658,13 +660,13 @@ void nrf_etr_flush(void)
irq_unlock(k);
}
#ifndef CONFIG_NRF_ETR_SHELL
#ifndef CONFIG_DEBUG_NRF_ETR_SHELL
static void etr_thread_func(void *dummy1, void *dummy2, void *dummy3)
{
uint64_t checkpoint = 0;
if (IS_ENABLED(CONFIG_NRF_ETR_DECODE) ||
IS_ENABLED(CONFIG_NRF_ETR_DEBUG)) {
if (IS_ENABLED(CONFIG_DEBUG_NRF_ETR_DECODE) ||
IS_ENABLED(CONFIG_DEBUG_NRF_ETR_DEBUG)) {
int err;
err = decoder_init();
@@ -688,7 +690,7 @@ static void etr_thread_func(void *dummy1, void *dummy2, void *dummy3)
}
}
k_sleep(K_MSEC(CONFIG_NRF_ETR_BACKOFF));
k_sleep(K_MSEC(CONFIG_DEBUG_NRF_ETR_BACKOFF));
}
}
#endif
@@ -703,7 +705,7 @@ static void uart_event_handler(const struct device *dev, struct uart_event *evt,
case UART_TX_DONE:
k_sem_give(&uart_sem);
break;
#ifdef CONFIG_NRF_ETR_SHELL
#ifdef CONFIG_DEBUG_NRF_ETR_SHELL
case UART_RX_RDY:
uart_async_rx_on_rdy(&async_rx, evt->data.rx.buf, evt->data.rx.len);
shell_handler(SHELL_TRANSPORT_EVT_RX_RDY, shell_context);
@@ -729,7 +731,7 @@ static void uart_event_handler(const struct device *dev, struct uart_event *evt,
break;
case UART_RX_DISABLED:
break;
#endif /* CONFIG_NRF_ETR_SHELL */
#endif /* CONFIG_DEBUG_NRF_ETR_SHELL */
default:
__ASSERT_NO_MSG(0);
}
@@ -743,7 +745,7 @@ static void tbm_event_handler(nrf_tbm_event_t event)
tbm_full = true;
}
#ifdef CONFIG_NRF_ETR_SHELL
#ifdef CONFIG_DEBUG_NRF_ETR_SHELL
k_poll_signal_raise(&etr_shell.ctx->signals[SHELL_SIGNAL_LOG_MSG], 0);
#else
k_wakeup(&etr_thread);
@@ -767,14 +769,14 @@ int etr_process_init(void)
nrfx_isr, nrfx_tbm_irq_handler, 0);
irq_enable(DT_IRQN(DT_NODELABEL(tbm)));
#ifdef CONFIG_NRF_ETR_SHELL
#ifdef CONFIG_DEBUG_NRF_ETR_SHELL
uint32_t level = CONFIG_LOG_MAX_LEVEL;
static const struct shell_backend_config_flags cfg_flags =
SHELL_DEFAULT_BACKEND_CONFIG_FLAGS;
shell_init(&etr_shell, NULL, cfg_flags, true, level);
k_timer_start(&etr_timer, K_MSEC(CONFIG_NRF_ETR_BACKOFF), K_NO_WAIT);
if (IS_ENABLED(CONFIG_NRF_ETR_DECODE) || IS_ENABLED(CONFIG_NRF_ETR_DEBUG)) {
k_timer_start(&etr_timer, K_MSEC(CONFIG_DEBUG_NRF_ETR_BACKOFF), K_NO_WAIT);
if (IS_ENABLED(CONFIG_DEBUG_NRF_ETR_DECODE) || IS_ENABLED(CONFIG_DEBUG_NRF_ETR_DEBUG)) {
err = decoder_init();
if (err < 0) {
return err;
@@ -791,14 +793,14 @@ int etr_process_init(void)
SYS_INIT(etr_process_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
#ifdef CONFIG_NRF_ETR_SHELL
#ifdef CONFIG_DEBUG_NRF_ETR_SHELL
static void etr_timer_handler(struct k_timer *timer)
{
if (pending_data() >= MIN_DATA) {
k_poll_signal_raise(&etr_shell.ctx->signals[SHELL_SIGNAL_LOG_MSG], 0);
} else {
k_timer_start(timer, K_MSEC(CONFIG_NRF_ETR_BACKOFF), K_NO_WAIT);
k_timer_start(timer, K_MSEC(CONFIG_DEBUG_NRF_ETR_BACKOFF), K_NO_WAIT);
}
}
@@ -807,7 +809,7 @@ bool z_shell_log_backend_process(const struct shell_log_backend *backend)
ARG_UNUSED(backend);
process();
k_timer_start(&etr_timer, K_MSEC(CONFIG_NRF_ETR_BACKOFF), K_NO_WAIT);
k_timer_start(&etr_timer, K_MSEC(CONFIG_DEBUG_NRF_ETR_BACKOFF), K_NO_WAIT);
return false;
}
@@ -901,7 +903,7 @@ static int etr_shell_init(const struct shell_transport *transport, const void *c
static const struct uart_async_rx_config async_rx_config = {
.buffer = rx_buf,
.length = sizeof(rx_buf),
.buf_cnt = CONFIG_NRF_ETR_SHELL_ASYNC_RX_BUFFER_COUNT,
.buf_cnt = CONFIG_DEBUG_NRF_ETR_SHELL_ASYNC_RX_BUFFER_COUNT,
};
shell_context = context;
@@ -939,6 +941,6 @@ static struct shell_transport transport = {
};
static uint8_t shell_out_buffer[CONFIG_SHELL_PRINTF_BUFF_SIZE];
Z_SHELL_DEFINE(etr_shell, CONFIG_NRF_ETR_SHELL_PROMPT, &transport, shell_out_buffer, NULL,
Z_SHELL_DEFINE(etr_shell, CONFIG_DEBUG_NRF_ETR_SHELL_PROMPT, &transport, shell_out_buffer, NULL,
SHELL_FLAG_OLF_CRLF);
#endif /* CONFIG_NRF_ETR_SHELL */
#endif /* CONFIG_DEBUG_NRF_ETR_SHELL */

View File

@@ -15,5 +15,4 @@ add_subdirectory_ifdef(CONFIG_RENESAS_RX_EXTERNAL_INTERRUPT renesas_rx_external_
add_subdirectory_ifdef(CONFIG_NXP_RTXXX_DSP_CTRL nxp_rtxxx_dsp_ctrl)
add_subdirectory_ifdef(CONFIG_STM32N6_AXISRAM stm32n6_axisram)
add_subdirectory(coresight)
add_subdirectory(interconn)

View File

@@ -15,7 +15,6 @@ source "drivers/misc/timeaware_gpio/Kconfig"
source "drivers/misc/devmux/Kconfig"
source "drivers/misc/nordic_vpr_launcher/Kconfig"
source "drivers/misc/mcux_flexio/Kconfig"
source "drivers/misc/coresight/Kconfig"
source "drivers/misc/interconn/Kconfig"
source "drivers/misc/renesas_ra_external_interrupt/Kconfig"
source "drivers/misc/renesas_rx_external_interrupt/Kconfig"

View File

@@ -1,4 +0,0 @@
# Copyright (c) 2024 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0
zephyr_library_sources_ifdef(CONFIG_NRF_ETR nrf_etr.c)

View File

@@ -3,18 +3,18 @@
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef _ZEPHYR_DRIVERS_MISC_CORESIGHT_NRF_ETR_H_
#define _ZEPHYR_DRIVERS_MISC_CORESIGHT_NRF_ETR_H_
#ifndef _ZEPHYR_DRIVERS_DEBUG_CORESIGHT_NRF_ETR_H_
#define _ZEPHYR_DRIVERS_DEBUG_CORESIGHT_NRF_ETR_H_
#ifdef __cplusplus
extern "C" {
#endif
/** @brief Flush data from the ETR buffer. */
void nrf_etr_flush(void);
void debug_nrf_etr_flush(void);
#ifdef __cplusplus
}
#endif
#endif /* _ZEPHYR_DRIVERS_MISC_CORESIGHT_NRF_ETR_H_ */
#endif /* _ZEPHYR_DRIVERS_DEBUG_CORESIGHT_NRF_ETR_H_ */

View File

@@ -4,8 +4,8 @@
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_DRIVERS_MISC_CORESIGHT_STMESP_H_
#define ZEPHYR_INCLUDE_DRIVERS_MISC_CORESIGHT_STMESP_H_
#ifndef ZEPHYR_INCLUDE_DRIVERS_DEBUG_CORESIGHT_STMESP_H_
#define ZEPHYR_INCLUDE_DRIVERS_DEBUG_CORESIGHT_STMESP_H_
#include <zephyr/devicetree.h>
@@ -190,4 +190,4 @@ static inline int stmesp_get_port(uint32_t idx, STMESP_Type **port)
* @}
*/
#endif /* ZEPHYR_INCLUDE_DRIVERS_MISC_CORESIGHT_STMESP_H_ */
#endif /* ZEPHYR_INCLUDE_DRIVERS_DEBUG_CORESIGHT_STMESP_H_ */

View File

@@ -9,7 +9,7 @@
#include <errno.h>
#include <zephyr/types.h>
#ifdef CONFIG_LOG_FRONTEND_STMESP
#include <zephyr/drivers/misc/coresight/stmesp.h>
#include <zephyr/drivers/debug/stmesp.h>
#endif
#ifdef __cplusplus

View File

@@ -20,7 +20,7 @@ SB_CONFIG_APP_CPUPPR_RUN = None
SB_CONFIG_APP_CPUFLPR_RUN = None
# See definition of stm_m_id[] and stm_m_name[] in
# https://github.com/zephyrproject-rtos/zephyr/blob/main/drivers/misc/coresight/nrf_etr.c
# https://github.com/zephyrproject-rtos/zephyr/blob/main/drivers/debug/debug_nrf_etr.c
STM_M_ID = {
"sec": 33,
"app": 34,

View File

@@ -9,7 +9,7 @@ config NUM_IRQS
default 471
config SHELL_BACKEND_SERIAL
default n if NRF_ETR_SHELL
default n if DEBUG_NRF_ETR_SHELL
config POWER_DOMAIN
default y

View File

@@ -46,7 +46,7 @@ config LOG_FRONTEND_STMESP_DICT
config LOG_FRONTEND_STMESP_FSC
bool "Send fully self-contained messages"
select LOG_MSG_APPEND_RO_STRING_LOC if !(NRF_ETR || \
select LOG_MSG_APPEND_RO_STRING_LOC if !(DEBUG_NRF_ETR || \
SOC_NRF54H20_CPUPPR || SOC_NRF54H20_CPUFLPR)
config LOG_FRONTEND_STMESP_FLUSH_COUNT
@@ -70,7 +70,7 @@ config LOG_FRONTEND_STMESP_DICT_VER
config LOG_FRONTEND_STMESP_TURBO_LOG
bool "Optimize short_logs"
select LOG_CUSTOM_HEADER
default y if (NRF_ETR || SOC_NRF54H20_CPUPPR || SOC_NRF54H20_CPUFLPR) \
default y if (DEBUG_NRF_ETR || SOC_NRF54H20_CPUPPR || SOC_NRF54H20_CPUFLPR) \
&& LOG_FRONTEND_STMESP_FSC
help
When enabled, then logging messages with 0 and 1 numeric argument are

View File

@@ -11,8 +11,8 @@
#include <zephyr/logging/log_ctrl.h>
#include <zephyr/logging/log_msg.h>
#include <zephyr/sys/cbprintf.h>
#ifdef CONFIG_NRF_ETR
#include <zephyr/drivers/misc/coresight/nrf_etr.h>
#ifdef CONFIG_DEBUG_NRF_ETR
#include <zephyr/drivers/debug/debug_nrf_etr.h>
#endif
/* Only 32 bit platforms supported. */
@@ -574,15 +574,16 @@ void log_frontend_simple_2(const void *source, uint32_t level, const char *fmt,
void log_frontend_panic(void)
{
in_panic = true;
#ifdef CONFIG_NRF_ETR
nrf_etr_flush();
#ifdef CONFIG_DEBUG_NRF_ETR
debug_nrf_etr_flush();
#endif
}
void log_frontend_init(void)
{
#if defined(CONFIG_LOG_FRONTEND_STPESP_TURBO_SOURCE_PORT_ID) && !defined(CONFIG_NRF_ETR) && \
!defined(CONFIG_LOG_MSG_APPEND_RO_STRING_LOC)
#if defined(CONFIG_LOG_FRONTEND_STPESP_TURBO_SOURCE_PORT_ID) \
&& !defined(CONFIG_DEBUG_NRF_ETR) \
&& !defined(CONFIG_LOG_MSG_APPEND_RO_STRING_LOC)
/* Send location of section with constant source data. It is used by the
* application core to retrieve source names of log messages coming from
* coprocessors (FLPR and PPR).