36 |
36 |
# load module ID constants
|
37 |
37 |
include $(AMIROBLT)/Target/Modules/moduleids.mk
|
38 |
38 |
|
39 |
|
# some flashing parameters
|
40 |
|
ifeq ($(OS),Windows_NT)
|
41 |
|
FLASH_PORT ?= COM4
|
42 |
|
else
|
43 |
|
# check whether /dev/ttyAMiRo0 exists
|
44 |
|
ifeq (,$(wildcard /dev/ttyAMiRo0))
|
45 |
|
# check whether /dev/ttyUSB0 exists
|
46 |
|
ifeq (,$(wildcard /dev/ttyUSB0))
|
47 |
|
# set to /dev/ttyAMiRo0 for meaningful error message
|
48 |
|
FLASH_PORT ?= /dev/ttyAMiRo0
|
49 |
|
else
|
50 |
|
# legacy support
|
51 |
|
FLASH_PORT ?= /dev/ttyUSB0
|
52 |
|
endif
|
53 |
|
else
|
54 |
|
FLASH_PORT ?= /dev/ttyAMiRo0
|
55 |
|
endif
|
|
39 |
# set the FLASH_PORT if no custom value has been specified
|
|
40 |
ifeq ($(FLASH_PORT),)
|
|
41 |
ifeq ($(OS),Windows_NT)
|
|
42 |
FLASH_PORT ?= COM4
|
|
43 |
else
|
|
44 |
# check whether /dev/ttyAMiRo0 exists
|
|
45 |
ifeq ($(wildcard /dev/ttyAMiRo0),)
|
|
46 |
# check whether /dev/ttyUSB0 exists
|
|
47 |
ifeq ($(wildcard /dev/ttyUSB0),)
|
|
48 |
# set to /dev/ttyAMiRo0 for meaningful error message
|
|
49 |
FLASH_PORT ?= /dev/ttyAMiRo0
|
|
50 |
else
|
|
51 |
# legacy support
|
|
52 |
FLASH_PORT ?= /dev/ttyUSB0
|
|
53 |
endif
|
|
54 |
else
|
|
55 |
FLASH_PORT ?= /dev/ttyAMiRo0
|
|
56 |
endif
|
|
57 |
endif
|
56 |
58 |
endif
|
|
59 |
# set the baud rate if no custom value has been specified
|
57 |
60 |
FLASH_BAUDRATE ?= 115200
|
58 |
61 |
|
59 |
62 |
# set the flashing tool, the command to call it, arguments, and file extensions
|
60 |
63 |
ifneq ($(wildcard $(AMIROBLT)/Host/Source/SerialBoot/build/SerialBoot),)
|
61 |
|
# if AMiRo-BLT project is available, use SerialBoot
|
62 |
|
FLASHTOOL := SerialBoot
|
63 |
|
FLASHTOOL_CMD := $(AMIROBLT)/Host/Source/SerialBoot/build/SerialBoot
|
64 |
|
FLASHTOOL_EXT := srec
|
65 |
|
FLASHTOOL_ARGS = -d$(FLASH_PORT) -b$(FLASH_BAUDRATE) $(foreach module,$(FLASH_MODULES),-T$($(module)_ID_HEX) $(BUILDDIR)/$(module).$(FLASHTOOL_EXT))
|
|
64 |
# if AMiRo-BLT project is available, use SerialBoot
|
|
65 |
FLASHTOOL := SerialBoot
|
|
66 |
FLASHTOOL_CMD := $(AMIROBLT)/Host/Source/SerialBoot/build/SerialBoot
|
|
67 |
FLASHTOOL_EXT := srec
|
|
68 |
FLASHTOOL_ARGS = -d$(FLASH_PORT) -b$(FLASH_BAUDRATE) $(foreach module,$(FLASH_MODULES),-T$($(module)_ID_HEX) $(BUILDDIR)/$(module).$(FLASHTOOL_EXT))
|
66 |
69 |
else
|
67 |
|
# the default tool to use is stm32flash
|
68 |
|
ifneq ($(words $(FLASH_MODULES)),1)
|
69 |
|
FLASH_MODULES := $(firstword $(FLASH_MODULES))
|
70 |
|
endif
|
71 |
|
FLASHTOOL := stm32flash
|
72 |
|
FLASHTOOL_CMD := stm32flash
|
73 |
|
FLASHTOOL_EXT := hex
|
74 |
|
FLASHTOOL_ARGS = $(FLASH_PORT) -i "rts,-dtr,-rts":"rts,dtr,-rts" -R -b $(FLASH_BAUDRATE) -w $(BUILDDIR)/$(FLASH_MODULES).$(FLASHTOOL_EXT)
|
|
70 |
# the default tool to use is stm32flash
|
|
71 |
ifneq ($(words $(FLASH_MODULES)),1)
|
|
72 |
FLASH_MODULES := $(firstword $(FLASH_MODULES))
|
|
73 |
endif
|
|
74 |
FLASHTOOL := stm32flash
|
|
75 |
FLASHTOOL_CMD := stm32flash
|
|
76 |
FLASHTOOL_EXT := hex
|
|
77 |
FLASHTOOL_ARGS = $(FLASH_PORT) -i "rts,-dtr,-rts":"rts,dtr,-rts" -R -b $(FLASH_BAUDRATE) -w $(BUILDDIR)/$(FLASH_MODULES).$(FLASHTOOL_EXT)
|
75 |
78 |
endif
|
76 |
79 |
|