-
Notifications
You must be signed in to change notification settings - Fork 3
/
common.mk
37 lines (25 loc) · 929 Bytes
/
common.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
### OpenOCD
# Location of OpenOCD Board .cfg files
OPENOCD_BOARD_DIR = /usr/local/Cellar/open-ocd/0.9.0/share/openocd/scripts/board
# OpenOCD board config file
OPENOCD_BOARD_CFG = stm32f0discovery.cfg
# Flashes your board using OpenOCD
openocd: all
openocd -f $(OPENOCD_BOARD_DIR)/$(OPENOCD_BOARD_CFG) -f $(ROOTDIR)/openocd/stm32f0-flash.cfg \
-c "stm_flash `pwd`/$(BUILDDIR)/$(PROJECT).bin" -c shutdown
### stm32flash
SERIAL_PORT = /dev/tty.usbserial-DJ005LMJ
serialflash: all
#stm32flash -w $(BUILDDIR)/$(PROJECT).hex -v $(SERIAL_PORT)
stm32loader.py -evw -b 57600 -p $(SERIAL_PORT) $(BUILDDIR)/$(PROJECT).bin
### dfu-util
dfu: all
dfu-util -a 0 -s 0x08000000 -R -D $(BUILDDIR)/$(PROJECT).bin
### st-link
stlink: all
st-flash write $(BUILDDIR)/$(PROJECT).bin 0x8000000
### blhost
blhost: all
blhost -u -- flash-erase-all
blhost -u -- write-memory 0 $(BUILDDIR)/$(PROJECT).bin
blhost -u -- reset