STM32F7: Add build target to program via OpenOCD

This commit is contained in:
Keir Fraser
2019-11-26 12:48:00 +00:00
parent c5c81ce1ba
commit 5ed5bd0d32
2 changed files with 13 additions and 0 deletions

View File

@@ -71,6 +71,10 @@ endif
BAUD=115200
DEV=/dev/ttyUSB0
ocd: all
python3 scripts/telnet.py localhost 4444 \
"reset init ; flash write_image erase `pwd`/$(PROJ)-$(VER).hex ; reset"
flash: all
sudo stm32flash -b $(BAUD) -w $(PROJ)-$(VER).hex $(DEV)

9
scripts/telnet.py Normal file
View File

@@ -0,0 +1,9 @@
# Send a command over telnet to remote host:
# telnet.py <host> <port> <string>
import sys
import telnetlib
with telnetlib.Telnet(sys.argv[1], sys.argv[2]) as t:
t.write((sys.argv[3] + '\n').encode('utf-8'))