diff --git a/boards/sim/sim/sim/configs/segger/defconfig b/boards/sim/sim/sim/configs/segger/defconfig index 46d496ac8b..ec0f4327ae 100644 --- a/boards/sim/sim/sim/configs/segger/defconfig +++ b/boards/sim/sim/sim/configs/segger/defconfig @@ -68,5 +68,6 @@ CONFIG_SCHED_WAITPID=y CONFIG_SEGGER_SYSVIEW=y CONFIG_START_MONTH=6 CONFIG_START_YEAR=2008 +CONFIG_STREAM_RTT=y CONFIG_SYSLOG_RTT=y CONFIG_SYSTEM_NSH=y diff --git a/drivers/segger/Kconfig b/drivers/segger/Kconfig index 5b81107519..434c3a0907 100644 --- a/drivers/segger/Kconfig +++ b/drivers/segger/Kconfig @@ -78,6 +78,13 @@ endchoice # SEGGER_RTT_MODE endif # SEGGER_RTT +config STREAM_RTT + bool "Stream to/from Segger J-Link RTT" + select SEGGER_RTT + default n + ---help--- + Use Segger J-Link RTT as a stream input and output. + if SEGGER_SYSVIEW config SEGGER_SYSVIEW_RTT_CHANNEL diff --git a/drivers/segger/Make.defs b/drivers/segger/Make.defs index 0849c4ebab..d58e1d3641 100644 --- a/drivers/segger/Make.defs +++ b/drivers/segger/Make.defs @@ -54,7 +54,7 @@ TARGET_ZIP += $(SGDIR)/RTT.zip endif -ifeq ($(CONFIG_SEGGER_RTT),y) +ifeq ($(CONFIG_STREAM_RTT),y) CSRCS += segger/stream_rtt.c endif diff --git a/drivers/segger/stream_rtt.c b/drivers/segger/stream_rtt.c index 8afe1e0797..1096fddc1c 100644 --- a/drivers/segger/stream_rtt.c +++ b/drivers/segger/stream_rtt.c @@ -25,7 +25,6 @@ #include #include -#include #include #include #include diff --git a/include/nuttx/segger/rtt.h b/include/nuttx/segger/rtt.h index 0d8f56a19f..2ad6f93469 100644 --- a/include/nuttx/segger/rtt.h +++ b/include/nuttx/segger/rtt.h @@ -36,6 +36,7 @@ * Type Declarations ****************************************************************************/ +#ifdef CONFIG_STREAM_RTT struct lib_rttoutstream_s { struct lib_outstream_s public; @@ -51,6 +52,7 @@ struct lib_rttinstream_s FAR char *buffer; int channel; }; +#endif /**************************************************************************** * Public Function Prototypes @@ -61,6 +63,7 @@ extern "C" { #endif +#ifdef CONFIG_STREAM_RTT /**************************************************************************** * Name: lib_rttoutstream_open *****************************************************************************/ @@ -86,6 +89,7 @@ void lib_rttinstream_open(FAR struct lib_rttinstream_s *stream, ****************************************************************************/ void lib_rttinstream_close(FAR struct lib_rttinstream_s *stream); +#endif #ifdef __cplusplus }