aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2020-11-29 12:28:10 -0700
committerJosh Rahm <joshuarahm@gmail.com>2020-11-29 12:28:10 -0700
commit953b8db36d684829baa9cf669be1b799c8a01d46 (patch)
tree437dca42b3244c8af2ba9f453ad51779f0e4ad1e
parent1ec4e164df03fae8c42fd7aea2614fa836bcc2d7 (diff)
downloadstm32l4-953b8db36d684829baa9cf669be1b799c8a01d46.tar.gz
stm32l4-953b8db36d684829baa9cf669be1b799c8a01d46.tar.bz2
stm32l4-953b8db36d684829baa9cf669be1b799c8a01d46.zip
Switch flash program to openocd. It is more consistent than st-flash.
-rw-r--r--Makefile.preamble3
-rw-r--r--openocd.cfg2
2 files changed, 4 insertions, 1 deletions
diff --git a/Makefile.preamble b/Makefile.preamble
index f6e1370..62b221a 100644
--- a/Makefile.preamble
+++ b/Makefile.preamble
@@ -14,7 +14,8 @@ _$(PREFIX)_obs/main.bin: _$(PREFIX)_obs/main.elf
$(PREFIX)objcopy -O binary _$(PREFIX)_obs/main.elf _$(PREFIX)_obs/main.bin
flash: _$(PREFIX)_obs/main.bin
- st-flash write _$(PREFIX)_obs/main.bin 0x8000000
+ openocd -f openocd.cfg -c "program _arm-unknown-eabi-_obs/main.bin reset exit 0x08000000"
+ # st-flash write _$(PREFIX)_obs/main.bin 0x8000000
clean:
rm -rf _*_obs
diff --git a/openocd.cfg b/openocd.cfg
new file mode 100644
index 0000000..1fb1807
--- /dev/null
+++ b/openocd.cfg
@@ -0,0 +1,2 @@
+source [find interface/stlink-v2-1.cfg]
+source [find target/stm32l4x.cfg]