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 a mutex.
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 32 if SHELL_BACKEND_RTT
43	default 16
44
45config SEGGER_RTT_PRINTF_BUFFER_SIZE
46	int "Size of buffer for RTT printf to bulk-send chars via RTT"
47	default 64
48
49choice SEGGER_RTT_MODE
50	prompt "Mode for pre-initialized terminal channel (buffer 0)"
51	default SEGGER_RTT_MODE_NO_BLOCK_SKIP
52
53config SEGGER_RTT_MODE_NO_BLOCK_SKIP
54	bool "Skip. Do not block, output nothing."
55
56config SEGGER_RTT_MODE_NO_BLOCK_TRIM
57	bool "Trim: Do not block, output as much as fits."
58
59config SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL
60	bool "Block: Wait until there is space in the buffer."
61
62endchoice
63
64config SEGGER_RTT_MODE
65	int
66	default 2 if SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL
67	default 1 if SEGGER_RTT_MODE_NO_BLOCK_TRIM
68	default 0
69
70config SEGGER_RTT_MEMCPY_USE_BYTELOOP
71	bool "Use a simple byte-loop instead of standard memcpy"
72
73choice SEGGER_RTT_SECTION
74	prompt "Choose RTT data linker section"
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
85endchoice
86
87endif
88