Skip to content

Instantly share code, notes, and snippets.

@zmarvel
Created June 23, 2019 04:35
Show Gist options
  • Save zmarvel/1e3f28c533ddfdea9eb9d94edb7f4a32 to your computer and use it in GitHub Desktop.
Save zmarvel/1e3f28c533ddfdea9eb9d94edb7f4a32 to your computer and use it in GitHub Desktop.
Helper make rules for ChibiOS projects
OPENOCD ?= /usr/bin/openocd/
OPENOCD_SCRIPTS ?= /usr/share/openocd/scripts
openocd: $(ELF)
$(OPENOCD) -s $(OPENOCD_SCRIPTS) \
-f interface/stlink-v2-1.cfg \
-f target/stm32l4x.cfg \
-c "telnet_port 4444" \
-c "gdb_port 3333"
download: $(ELF)
$(OPENOCD) -s $(OPENOCD_SCRIPTS) \
-f interface/stlink-v2-1.cfg \
-f target/stm32l4x.cfg \
-c "init" \
-c "targets" \
-c "reset halt" \
-c "program $< verify" \
-c "reset run" \
-c "exit"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment