From 7531280b42f74ab0953e3c4cc93ae9868721bf20 Mon Sep 17 00:00:00 2001 From: Matti Virkkunen Date: Tue, 24 Nov 2020 17:51:28 +0200 Subject: [PATCH] Document RISC-V a bit more --- README.md | 4 +++- rtt-target/src/lib.rs | 4 ++-- rtt-target/src/print.rs | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7cfe679..9d998f4 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,13 @@ Target side implementation of the RTT (Real-Time Transfer) I/O protocol. RTT imp While this crate is platform agnostic, some platform-specific code is needed for locking if you want to use the global `rprintln!` macro. -If using Cortex-M, there is built-in support with a feature flag: +If using Cortex-M or RISC-V, there is built-in support with a feature flag: ```toml # Cargo.toml rtt-target = { version = "x.y.z", features = ["cortex-m"] } +# or +rtt-target = { version = "x.y.z", features = ["riscv"] } ``` Otherwise, check the documentation for the `set_print_channel_cs` function. diff --git a/rtt-target/src/lib.rs b/rtt-target/src/lib.rs index 12275f6..4d81951 100644 --- a/rtt-target/src/lib.rs +++ b/rtt-target/src/lib.rs @@ -9,8 +9,8 @@ //! //! This crate is platform agnostic and can be used on any chip that supports background memory //! access via its debug interface. The printing macros require a critical section which is -//! platform-dependent. ARM Cortex-M has built-in support, which can be enabled with the "cortex-m" -//! feature flag. +//! platform-dependent. Built-in ARM Cortex-M support can be enabled with the "cortex-m" feature, +//! and RISC-V support can be enabled with the "riscv" feature. //! //! To interface with RTT from the host computer, a debug probe such as an ST-Link or J-Link is //! required. The normal debug protocol (e.g. SWD) is used to access RTT, so no extra connections diff --git a/rtt-target/src/print.rs b/rtt-target/src/print.rs index aab9c9a..0206135 100644 --- a/rtt-target/src/print.rs +++ b/rtt-target/src/print.rs @@ -218,6 +218,8 @@ macro_rules! rtt_init_print { "- Enable a platform support feature:\r\n", " # Cargo.toml\r\n", " rtt-target = { version = \"x.y.z\", features = [\"cortex-m\"] }\r\n", + " # or", + " rtt-target = { version = \"x.y.z\", features = [\"riscv\"] }\r\n", "- OR use set_print_channel_cs() instead if you want to provide your own locking.\r\n" )) };