#!/bin/bash
cd ~/stm/openocd
-./openocd -f interface/stlink-v2.cfg -f target/stm32f1x.cfg -c init -c 'arm semihosting enable' -c 'reset halt' -c 'reset run'
+src/openocd -s tcl -f interface/stlink-v2.cfg -f target/stm32f1x.cfg -c init -c 'arm semihosting enable' -c 'reset halt' -c 'reset run'
--- /dev/null
+#!/bin/sh
+set -e
+LD_LIBRARY_PATH=~/stm/stlink
+export LD_LIBRARY_PATH
+exec ~/stm/stlink/st-flash "$@"
all: $(BUILD_DIR)/$(TARGET).elf $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin
flash: all
- LD_LIBRARY_PATH=../stlink ../stlink/st-flash write $(BUILD_DIR)/$(TARGET).bin 0x8000000
+ ../bin/st-flash write $(BUILD_DIR)/$(TARGET).bin 0x8000000
#######################################
# build the application