diff --git a/Makefile b/Makefile index 924a78d..962f6f5 100755 --- a/Makefile +++ b/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 diff --git a/README.md b/README.md index d5c5722..9a5e297 100644 --- a/README.md +++ b/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