From c88a9ef272d6a099fa72de8d6aaeb23bc1a37d12 Mon Sep 17 00:00:00 2001 From: Florian Grandel Date: Mon, 5 Jun 2023 17:17:40 +0200 Subject: [PATCH] segger: rtt: disable unsupported shell/log features The RTT backend of the shell does not support several of the more advanced terminal features. This commit proposes to inactivate these features by default when RTT is selected as shell backend. Signed-off-by: Florian Grandel --- modules/segger/Kconfig | 1 + subsys/logging/backends/Kconfig.uart | 2 +- subsys/shell/Kconfig | 4 ++-- subsys/shell/backends/Kconfig.backends | 2 ++ 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/segger/Kconfig b/modules/segger/Kconfig index 665e3ff716c..1324df8cb81 100644 --- a/modules/segger/Kconfig +++ b/modules/segger/Kconfig @@ -38,6 +38,7 @@ config SEGGER_RTT_BUFFER_SIZE_UP config SEGGER_RTT_BUFFER_SIZE_DOWN int "Size of the buffer for terminal input of target, from host" + default 32 if SHELL_BACKEND_RTT default 16 config SEGGER_RTT_PRINTF_BUFFER_SIZE diff --git a/subsys/logging/backends/Kconfig.uart b/subsys/logging/backends/Kconfig.uart index 43b544ab66a..8c75df0ff47 100644 --- a/subsys/logging/backends/Kconfig.uart +++ b/subsys/logging/backends/Kconfig.uart @@ -4,7 +4,7 @@ config LOG_BACKEND_UART bool "UART backend" depends on UART_CONSOLE - default y if !SHELL_BACKEND_SERIAL + default y if !SHELL_BACKEND_SERIAL && !SHELL_BACKEND_RTT select LOG_OUTPUT help When enabled backend is using UART to output logs. diff --git a/subsys/shell/Kconfig b/subsys/shell/Kconfig index d155622e7bb..342608a76a0 100644 --- a/subsys/shell/Kconfig +++ b/subsys/shell/Kconfig @@ -90,7 +90,7 @@ config SHELL_ARGC_MAX config SHELL_TAB bool "The Tab button support in shell" - default y if !SHELL_MINIMAL + default y if !SHELL_MINIMAL && !SHELL_BACKEND_RTT help Enable using the Tab button in the shell. The button can be used for prompting commands, or for autocompletion. @@ -125,7 +125,7 @@ config SHELL_START_OBSCURED config SHELL_VT100_COMMANDS bool "VT100 commands in shell" - default y + default y if !SHELL_BACKEND_RTT help Enables VT100 commands in shell (e.g. cursor position, clear screen etc.). diff --git a/subsys/shell/backends/Kconfig.backends b/subsys/shell/backends/Kconfig.backends index af5291545ef..0423d57d0b3 100644 --- a/subsys/shell/backends/Kconfig.backends +++ b/subsys/shell/backends/Kconfig.backends @@ -16,6 +16,8 @@ DT_CHOSEN_Z_SHELL_UART := zephyr,shell-uart config SHELL_BACKEND_SERIAL bool "Serial backend" + # Serial (UART) requires interrupts and the RTT backend cannot be used from an ISR context. + default n if SHELL_BACKEND_RTT default "$(dt_chosen_enabled,$(DT_CHOSEN_Z_SHELL_UART))" if HAS_DTS default y if !HAS_DTS select SERIAL