From 27a9173e128228bd4aef7f47490a61fb06909906 Mon Sep 17 00:00:00 2001
From: Per Lindgren <per.lindgren@ltu.se>
Date: Thu, 25 Jan 2018 01:18:57 +0100
Subject: [PATCH] itm_trace

---
 Makefile          | 14 +++++++++-----
 examples/bare1.rs |  4 +++-
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index 519294b..89989a7 100644
--- a/Makefile
+++ b/Makefile
@@ -1,15 +1,19 @@
 
-TARGETS = bare0 bare1 bare2 bare3 bare4 bare5 bare6 clk_out_itm
-DIR = target/thumbv7em-none-eabihf/debug/examples/
-ELFS = $(addprefix $(DIR), $(TARGETS))
+TARGETS = bare0 bare1 bare2 bare3 bare4 bare5 bare6
+DEV = target/thumbv7em-none-eabihf/debug/examples/
+REL = target/thumbv7em-none-eabihf/release/examples/
+ELFS = $(addprefix $(DEV), $(TARGETS))
 EELFS = $(addsuffix .elf, $(ELFS))
 
+ELFSR = $(addprefix $(REL), $(TARGETS))
+EELFSR = $(addsuffix .elf, $(ELFSR))
 .PHONY: all
 
-all: xargo $(EELFS) 
+all: xargo $(EELFS) $(EELFSR) 
 	
 xargo:
-	xargo build --examples
+	xargo build --examples	
+	xargo build --release --examples	
 		
 %.elf : % 
 	cp $< $@
diff --git a/examples/bare1.rs b/examples/bare1.rs
index 696de88..8847993 100644
--- a/examples/bare1.rs
+++ b/examples/bare1.rs
@@ -23,10 +23,12 @@ fn main() {
     ipln!("ITM: Hello World");
 
     // semihosting trace (slow)
-    sprintln!("SEMIHOSTING: Hello World");
+    //    sprintln!("SEMIHOSTING: Hello World");
 
     // to prevent returning
     loop {
+        ipln!("here");
+
         // cortex_m::asm::nop();
         // cortex_m::asm::bkpt();
     }
-- 
GitLab