From 21ff86c7b0dd25044c2d7e1a4cf06bc0fe198afb Mon Sep 17 00:00:00 2001 From: DevDoggo <devdoggo@protonmail.com> Date: Fri, 18 May 2018 21:02:24 +0200 Subject: [PATCH] Bare1.1 done --- compile.sh | 4 ++-- examples/bare1.rs | 9 ++++++++- gdb.sh | 4 ++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/compile.sh b/compile.sh index 476506a..a401588 100755 --- a/compile.sh +++ b/compile.sh @@ -1,5 +1,5 @@ #!/bin/bash #cargo build --target thumbv7em-none-eabihf --release -cargo build --target thumbv7em-none-eabihf --example bare0 -#cargo build --target thumbv7em-none-eabihf --example bare1 +#cargo build --target thumbv7em-none-eabihf --example bare0 +cargo build --target thumbv7em-none-eabihf --example bare1 diff --git a/examples/bare1.rs b/examples/bare1.rs index 696de88..549ad56 100644 --- a/examples/bare1.rs +++ b/examples/bare1.rs @@ -19,16 +19,19 @@ extern crate cortex_m_debug; #[inline(never)] fn main() { // ITM trace (fast) + cortex_m::asm::bkpt(); // start `itmdump` before `openocd` ipln!("ITM: Hello World"); + cortex_m::asm::bkpt(); // semihosting trace (slow) sprintln!("SEMIHOSTING: Hello World"); // to prevent returning loop { // cortex_m::asm::nop(); - // cortex_m::asm::bkpt(); + cortex_m::asm::bkpt(); + sprintln!("SEMIHOSTING: boye"); } } @@ -42,10 +45,14 @@ fn main() { // loop, (press pause/suspend to verify this). // what is the output in the ITM console // ** your answer here ** +// +// >> ITM: Hello World // // what is the output in the semihosting (openocd) console // ** your answer here ** // +// >> SEMIHOSTING: Hello World +// // commit your answers (bare1_1) // // 2. inspecting the assembly diff --git a/gdb.sh b/gdb.sh index 7468190..8c401f8 100755 --- a/gdb.sh +++ b/gdb.sh @@ -1,6 +1,6 @@ #!/bin/bash TARGET=thumbv7em-none-eabihf #arm-none-eabi-gdb target/$TARGET/release/examples/bare0 +#arm-none-eabi-gdb target/$TARGET/debug/examples/bare0 -arm-none-eabi-gdb target/$TARGET/debug/examples/bare0 -#arm-none-eabi-gdb target/$TARGET/debug/examples/bare1 +arm-none-eabi-gdb target/$TARGET/debug/examples/bare1 -- GitLab