Add JLink RTT feature
* SEGGER J-Link RTT allows to do terminal I/O without any additional connection except the J-Link itself. See openocd patch (yet unmerged) at http://openocd.zylin.com/#/c/4055/8
This commit is contained in:
parent
63d2133a1e
commit
1ba6c3f4d7
|
@ -22,6 +22,7 @@ default-target = "targets/aarch64-vesper-metta.json"
|
||||||
unstable = []
|
unstable = []
|
||||||
realtime = []
|
realtime = []
|
||||||
noserial = []
|
noserial = []
|
||||||
|
jlink = ['jlink_rtt']
|
||||||
|
|
||||||
#[lib]
|
#[lib]
|
||||||
#name = "nucleus"
|
#name = "nucleus"
|
||||||
|
@ -36,9 +37,10 @@ bitflags = "1.0.1"
|
||||||
register = "0.3.2"
|
register = "0.3.2"
|
||||||
cortex-a = "2.4"
|
cortex-a = "2.4"
|
||||||
#embedded-serial = "0.5.0"
|
#embedded-serial = "0.5.0"
|
||||||
|
jlink_rtt = { version = "0.1.0", optional = true }
|
||||||
|
|
||||||
[profile.dev]
|
[profile.dev]
|
||||||
panic = "abort"
|
panic = "abort" # @todo try panic_rtt when feature jlink
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
panic = "abort"
|
panic = "abort"
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -52,7 +52,7 @@ OPENOCD = /usr/local/openocd-20ceec69/bin/openocd
|
||||||
all: kernel8.img
|
all: kernel8.img
|
||||||
|
|
||||||
target/$(TARGET)/release/vesper: $(SOURCES)
|
target/$(TARGET)/release/vesper: $(SOURCES)
|
||||||
cargo xbuild --target=$(TARGET_JSON) --release
|
cargo xbuild --target=$(TARGET_JSON) --release --features="jlink"
|
||||||
|
|
||||||
kernel8.img: target/$(TARGET)/release/vesper $(SOURCES)
|
kernel8.img: target/$(TARGET)/release/vesper $(SOURCES)
|
||||||
cp $< ./kernel8
|
cp $< ./kernel8
|
||||||
|
|
|
@ -33,7 +33,9 @@ pub mod platform;
|
||||||
mod sync;
|
mod sync;
|
||||||
mod write_to;
|
mod write_to;
|
||||||
|
|
||||||
// use core::fmt::Write;
|
use core::fmt::Write;
|
||||||
|
#[cfg(feature = "jlink")]
|
||||||
|
use jlink_rtt::Output;
|
||||||
use platform::{
|
use platform::{
|
||||||
display::{Color, Size2d},
|
display::{Color, Size2d},
|
||||||
gpio::GPIO,
|
gpio::GPIO,
|
||||||
|
@ -78,6 +80,9 @@ fn kmain() -> ! {
|
||||||
Err(_) => endless_sleep(),
|
Err(_) => endless_sleep(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let mut out = Output::new();
|
||||||
|
writeln!(out, "JLink RTT is working!"); // @todo RttConsole
|
||||||
|
|
||||||
println!("\n[0] UART is live!");
|
println!("\n[0] UART is live!");
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
Loading…
Reference in New Issue