1# Copyright (c) 2016 Nordic Semiconductor ASA
2# SPDX-License-Identifier: Apache-2.0
3
4config ZEPHYR_SEGGER_MODULE
5	bool
6
7config HAS_SEGGER_RTT
8	bool
9	help
10	  Indicates that the platform supports SEGGER J-Link RTT.
11
12config USE_SEGGER_RTT
13	bool "SEGGER RTT libraries."
14	depends on HAS_SEGGER_RTT
15	select STM32_ENABLE_DEBUG_SLEEP_STOP if SOC_FAMILY_STM32
16	help
17	  Enable Segger J-Link RTT libraries for platforms that support it.
18	  Selection of this option enables use of RTT for various subsystems.
19	  Note that by enabling this option, RTT buffers consume more RAM.
20
21if USE_SEGGER_RTT
22
23config SEGGER_RTT_CUSTOM_LOCKING
24	bool "Custom locking"
25	help
26	  Enable custom locking using Zephyr APIs.
27
28config SEGGER_RTT_MAX_NUM_UP_BUFFERS
29	int "Maximum number of up-buffers"
30	default 3
31
32config SEGGER_RTT_MAX_NUM_DOWN_BUFFERS
33	int "Maximum number of down-buffers"
34	default 3
35
36config SEGGER_RTT_BUFFER_SIZE_UP
37	int "Size of the buffer for terminal output of target, up to host"
38	default 1024
39
40config SEGGER_RTT_BUFFER_SIZE_DOWN
41	int "Size of the buffer for terminal input of target, from host"
42	default 16
43
44config SEGGER_RTT_PRINTF_BUFFER_SIZE
45	int "Size of buffer for RTT printf to bulk-send chars via RTT"
46	default 64
47
48choice SEGGER_RTT_MODE
49	prompt "Mode for pre-initialized terminal channel (buffer 0)"
50	default SEGGER_RTT_MODE_NO_BLOCK_SKIP
51
52config SEGGER_RTT_MODE_NO_BLOCK_SKIP
53	bool "Skip. Do not block, output nothing."
54
55config SEGGER_RTT_MODE_NO_BLOCK_TRIM
56	bool "Trim: Do not block, output as much as fits."
57
58config SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL
59	bool "Block: Wait until there is space in the buffer."
60
61endchoice
62
63config SEGGER_RTT_MODE
64	int
65	default 2 if SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL
66	default 1 if SEGGER_RTT_MODE_NO_BLOCK_TRIM
67	default 0
68
69config SEGGER_RTT_MEMCPY_USE_BYTELOOP
70	bool "Use a simple byte-loop instead of standard memcpy"
71
72choice SEGGER_RTT_SECTION
73	prompt "Choose RTT data linker section"
74	default SEGGER_RTT_SECTION_CUSTOM
75
76config SEGGER_RTT_SECTION_NONE
77	bool "Place RTT data in the default linker section"
78
79config SEGGER_RTT_SECTION_DTCM
80	bool "Place RTT data in the DTCM linker section"
81
82config SEGGER_RTT_SECTION_CCM
83	bool "Place RTT data in the CCM linker section"
84
85if CPU_CORTEX_M
86
87config SEGGER_RTT_SECTION_CUSTOM
88	bool "Place RTT data in custom linker section at RAM start"
89
90config SEGGER_RTT_SECTION_CUSTOM_DTS_REGION
91	bool "Place RTT data in custom linker section defined by a memory region in DTS"
92
93endif
94
95endchoice
96
97if SEGGER_RTT_SECTION_CUSTOM || SEGGER_RTT_SECTION_CUSTOM_DTS_REGION
98
99config SEGGER_RTT_SECTION_CUSTOM_NAME
100	string "Name of RTT data custom linker section"
101	default ".rtt_buff_data"
102
103endif
104
105choice SEGGER_RTT_INIT_MODE
106	prompt "RTT Initialization mode"
107	help
108		RTT initialization function can avoid re-init of Control Block
109		if another program (e.g. bootloader) has already initialized it.
110	default SEGGER_RTT_INIT_MODE_STRONG_CHECK if SEGGER_RTT_SECTION_CUSTOM
111	default SEGGER_RTT_INIT_MODE_STRONG_CHECK
112
113config SEGGER_RTT_INIT_MODE_ALWAYS
114	bool "RTT Initialization done without conditions"
115
116config SEGGER_RTT_INIT_MODE_STRONG_CHECK
117	bool "RTT Initialization done if full check on Control Block ID fails"
118
119config SEGGER_RTT_INIT_MODE_WEAK_CHECK
120	bool "RTT Initialization done if partial check on Control Block ID fails"
121
122endchoice
123
124endif
125