From d547c5c5c9834dbb1dbe000b42e09b22f064f947 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 10 Apr 2020 21:47:17 +0200 Subject: Add demo1 stm32f103 example with blinky code --- sw/demo1/Makefile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 sw/demo1/Makefile (limited to 'sw/demo1/Makefile') diff --git a/sw/demo1/Makefile b/sw/demo1/Makefile new file mode 100644 index 0000000..1dcb47c --- /dev/null +++ b/sw/demo1/Makefile @@ -0,0 +1,18 @@ +.PHONY: all openocd debug + +OPENOCD := openocd +OPENOCD_CFG := /usr/share/openocd/scripts/target/stm32f1x.cfg +BIN := target/thumbv7em-none-eabihf/release/demo1 + +# Build and flash in release mode +all: + cargo build --release + $(OPENOCD) -f $(OPENOCD_CFG) -c "program $(BIN) reset exit" + +# Start a openocd session. +openocd: + $(OPENOCD) -f $(OPENOCD_CFG) + +# Start a gdb session. Works if a valid openocd session is existing. +debug: + arm-none-eabi-gdb $(BIN) -q -x utils/debug.gdb -- cgit v1.2.3