Abstracted the .cfg file (in extra folder)
This commit is contained in:
parent
1faceda5b3
commit
8a17e1fe2c
5
Makefile
5
Makefile
|
@ -10,6 +10,9 @@ STD_PERIPH_LIB=Libraries
|
||||||
# location of OpenOCD Board .cfg files (only used with 'make program')
|
# location of OpenOCD Board .cfg files (only used with 'make program')
|
||||||
OPENOCD_BOARD_DIR=/usr/share/openocd/scripts/board
|
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!
|
# 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
|
$(OBJCOPY) -O binary $(PROJ_NAME).elf $(PROJ_NAME).bin
|
||||||
|
|
||||||
program: $(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:
|
clean:
|
||||||
rm -f *.o
|
rm -f *.o
|
||||||
|
|
|
@ -30,6 +30,7 @@ This template will serve as a quick-start for those who do not wish to use an ID
|
||||||
|
|
||||||
5. extra/
|
5. extra/
|
||||||
* This contains a procedure file used to write the image to the board via OpenOCD
|
* 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 the image on the board
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue