mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-08-03 18:19:05 +00:00
Instantiate RTT UART instances from devicetree nodes instead of from Kconfig symbols. While RTT is implemented using software, not hardware, it is emulating a hardware device, and thus should be configured through devicetree. This allows the simulated UART device to be selected via devicetree aliases and chosen nodes. The following devicetree snippet will instantiate RTT channels 0 and 2 as UART devices. ``` / { rtt0: rtt_terminal { compatible = "segger,rtt-uart"; label = "rtt_terminal"; status = "okay"; }; rtt2: rtt_secondary { compatible = "segger,rtt-uart"; label = "rtt_app_specific"; status = "okay"; }; }; ``` Fixes the RTT portion of #10621. Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
54 lines
1.6 KiB
Plaintext
54 lines
1.6 KiB
Plaintext
# Virtual UART RTT driver option
|
|
|
|
# Copyright (c) 2019 omSquare s.r.o.
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
menuconfig UART_RTT
|
|
bool "Enable UART RTT driver"
|
|
depends on USE_SEGGER_RTT
|
|
help
|
|
This option enables access RTT channel as UART device.
|
|
|
|
if UART_RTT
|
|
|
|
# Workaround for not being able to have commas in macro arguments
|
|
DT_COMPAT_SEGGER_RTT_UART := segger,rtt-uart
|
|
|
|
config UART_RTT_0
|
|
def_bool $(dt_nodelabel_has_compat,rtt0,$(DT_COMPAT_SEGGER_RTT_UART))
|
|
depends on SEGGER_RTT_MAX_NUM_UP_BUFFERS >= 1 && SEGGER_RTT_MAX_NUM_DOWN_BUFFERS >= 1
|
|
depends on SEGGER_RTT_MODE_NO_BLOCK_SKIP
|
|
select SERIAL_HAS_DRIVER
|
|
select UART_RTT_DRIVER
|
|
help
|
|
Enable UART on (default) RTT channel 0. Default channel has to be configured in non-blocking skip mode.
|
|
|
|
config UART_RTT_1
|
|
def_bool $(dt_nodelabel_has_compat,rtt1,$(DT_COMPAT_SEGGER_RTT_UART))
|
|
depends on SEGGER_RTT_MAX_NUM_UP_BUFFERS >= 2 && SEGGER_RTT_MAX_NUM_DOWN_BUFFERS >= 2
|
|
select SERIAL_HAS_DRIVER
|
|
select UART_RTT_DRIVER
|
|
help
|
|
Enable UART on RTT channel 1
|
|
|
|
config UART_RTT_2
|
|
def_bool $(dt_nodelabel_has_compat,rtt2,$(DT_COMPAT_SEGGER_RTT_UART))
|
|
depends on SEGGER_RTT_MAX_NUM_UP_BUFFERS >= 3 && SEGGER_RTT_MAX_NUM_DOWN_BUFFERS >= 3
|
|
select SERIAL_HAS_DRIVER
|
|
select UART_RTT_DRIVER
|
|
help
|
|
Enable UART on RTT channel 2
|
|
|
|
config UART_RTT_3
|
|
def_bool $(dt_nodelabel_has_compat,rtt3,$(DT_COMPAT_SEGGER_RTT_UART))
|
|
depends on SEGGER_RTT_MAX_NUM_UP_BUFFERS >= 4 && SEGGER_RTT_MAX_NUM_DOWN_BUFFERS >= 4
|
|
select SERIAL_HAS_DRIVER
|
|
select UART_RTT_DRIVER
|
|
help
|
|
Enable UART on RTT channel 3
|
|
|
|
config UART_RTT_DRIVER
|
|
bool
|
|
|
|
endif
|