Browse Source

Abstracted the .cfg file (in extra folder)

master
Mike Szczys 10 years ago
parent
commit
8a17e1fe2c
  1. 5
      Makefile
  2. 1
      README.md

5
Makefile

@ -10,6 +10,9 @@ STD_PERIPH_LIB=Libraries
# location of OpenOCD Board .cfg files (only used with 'make program')
OPENOCD_BOARD_DIR=/usr/share/openocd/scripts/board
# Configuration (cfg) file containing programming directives for OpenOCD
OPENOCD_PROC_FILE=extra/stm32f0-openocd.cfg
# that's it, no need to change anything below this line!
###################################################
@ -51,7 +54,7 @@ $(PROJ_NAME).elf: $(SRCS)
$(OBJCOPY) -O binary $(PROJ_NAME).elf $(PROJ_NAME).bin
program: $(PROJ_NAME).bin
openocd -f $(OPENOCD_BOARD_DIR)/stm32f0discovery.cfg -f extra/stm32f0-openocd.cfg -c "stm_flash `pwd`/$(PROJ_NAME).bin" -c shutdown
openocd -f $(OPENOCD_BOARD_DIR)/stm32f0discovery.cfg -f $(OPENOCD_PROC_FILE) -c "stm_flash `pwd`/$(PROJ_NAME).bin" -c shutdown
clean:
rm -f *.o

1
README.md

@ -30,6 +30,7 @@ This template will serve as a quick-start for those who do not wish to use an ID
5. extra/
* This contains a procedure file used to write the image to the board via OpenOCD
* **Abstracting the extra folder:** the .cfg file in the extra folder may be placed anywhere so that multiple projects can use one file. Just change the OPENOCD_PROC_FILE variable in the Make file to match the new location.
##Loading the image on the board

Loading…
Cancel
Save