File tree Expand file tree Collapse file tree 4 files changed +80
-1
lines changed
Expand file tree Collapse file tree 4 files changed +80
-1
lines changed Original file line number Diff line number Diff line change 1+ if (CONFIG_USE_SEGGER_RTT)
2+
3+ zephyr_library()
4+ set (SEGGER_DIR ${ZEPHYR_CURRENT_MODULE_DIR} )
5+ zephyr_include_directories_ifdef(CONFIG_USE_SEGGER_RTT
6+ ${SEGGER_DIR} /SEGGER
7+ ${SEGGER_DIR} /Config
8+ .
9+ )
10+ zephyr_library_sources(
11+ ${SEGGER_DIR} /SEGGER/SEGGER_RTT.c
12+ SEGGER_RTT_zephyr.c
13+ )
14+ zephyr_library_sources_ifdef(CONFIG_SEGGER_SYSTEMVIEW ${SEGGER_DIR} /SEGGER/SEGGER_SYSVIEW.c)
15+ endif ()
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright (c) 2018 omSquare s.r.o.
3+ *
4+ * SPDX-License-Identifier: Apache-2.0
5+ */
6+
7+ #include <kernel.h>
8+ #include <init.h>
9+ #include "SEGGER_RTT.h"
10+
11+ /*
12+ * Common mutex for locking access to terminal buffer.
13+ * Note that SEGGER uses same lock macros for both SEGGER_RTT_Write and
14+ * SEGGER_RTT_Read functions. Because of this we are not able generally
15+ * separate up and down access using two mutexes until SEGGER library fix
16+ * this.
17+ *
18+ * If sharing access cause performance problems, consider using another
19+ * non terminal buffers.
20+ */
21+
22+ K_MUTEX_DEFINE (rtt_term_mutex );
23+
24+ static int rtt_init (const struct device * unused )
25+ {
26+ ARG_UNUSED (unused );
27+
28+ SEGGER_RTT_Init ();
29+
30+ return 0 ;
31+ }
32+
33+ SYS_INIT (rtt_init , PRE_KERNEL_1 , CONFIG_KERNEL_INIT_PRIORITY_OBJECTS );
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright (c) 2020 Intel Corporation
3+ *
4+ * SPDX-License-Identifier: Apache-2.0
5+ */
6+ #pragma once
7+
8+ #include <stdint.h>
9+ #include <irq.h>
10+
11+ #define SEGGER_SYSVIEW_GET_TIMESTAMP sysview_get_timestamp
12+ #define SEGGER_SYSVIEW_GET_INTERRUPT_ID sysview_get_interrupt
13+
14+ uint32_t sysview_get_timestamp (void );
15+ uint32_t sysview_get_interrupt (void );
16+
17+ #define SEGGER_SYSVIEW_RTT_BUFFER_SIZE CONFIG_SEGGER_SYSVIEW_RTT_BUFFER_SIZE
18+ #define SEGGER_SYSVIEW_POST_MORTEM_MODE CONFIG_SEGGER_SYSVIEW_POST_MORTEM_MODE
19+
20+ #if defined(CONFIG_SEGGER_SYSVIEW_SECTION_DTCM )
21+ #define SEGGER_SYSVIEW_SECTION ".dtcm_data"
22+ #endif
23+
24+ /* Lock SystemView (nestable) */
25+ #define SEGGER_SYSVIEW_LOCK () { \
26+ unsigned int __sysview_irq_key = \
27+ irq_lock()
28+
29+ /* Unlock SystemView (nestable) */
30+ #define SEGGER_SYSVIEW_UNLOCK () irq_unlock(__sysview_irq_key); \
31+ }
Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ manifest:
112112 revision : cdb9570901e87ab247aed0a96ccd8f94beee5834
113113 path : modules/lib/openthread
114114 - name : segger
115- revision : 38c79a447e4a47d413b4e8d34448316a5cece77c
115+ revision : 2aa031c081426dcd0626185af45c40bd05811b68
116116 path : modules/debug/segger
117117 - name : sof
118118 revision : 52dc9c5ad8d0d2a5df0bb51ea30e54f8d7890639
You can’t perform that action at this time.
0 commit comments