forked from PX4/PX4-Bootloader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.f7
40 lines (29 loc) · 1.14 KB
/
Makefile.f7
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
38
39
40
#
# PX4 bootloader build rules for STM32F7 targets.
# Since the STM32F7 is not supported fully in libopencm3 at this time,
# this build is a bit of a hack to use the similar IP blocks of the F469
# for RCC and USB by telling libopencm3 it is an STM32F4
OPENOCD ?= openocd
JTAGCONFIG ?= interface/olimex-jtag-tiny.cfg
#JTAGCONFIG ?= interface/jtagkey-tiny.cfg
# 5 seconds / 5000 ms default delay
PX4_BOOTLOADER_DELAY ?= 5000
SRCS = $(COMMON_SRCS) main_f7.c
FLAGS += -g -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-sp-d16 \
-DTARGET_HW_$(TARGET_HW) \
-DSTM32F4 \
-T$(LINKER_FILE) \
-L$(LIBOPENCM3)/lib \
-lopencm3_stm32f4 \
$(EXTRAFLAGS)
ELF = $(TARGET_FILE_NAME).elf
BINARY = $(TARGET_FILE_NAME).bin
all: $(ELF) $(BINARY)
$(ELF): $(SRCS) $(MAKEFILE_LIST)
$(CC) -o $@ $(SRCS) $(FLAGS)
$(BINARY): $(ELF)
$(OBJCOPY) -O binary $(ELF) $(BINARY)
#upload: all flash flash-bootloader
upload: all flash-bootloader
flash-bootloader:
$(OPENOCD) --search ../px4_bootloader -f $(JTAGCONFIG) -f stm32f4x.cfg -c init -c "reset halt" -c "flash write_image erase $(BINARY) 0x08000000" -c "reset run" -c shutdown