-
Notifications
You must be signed in to change notification settings - Fork 554
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
David Sidrane
committed
Oct 31, 2016
1 parent
aa292c3
commit ac45014
Showing
8 changed files
with
705 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# | ||
# PX4 bootloader build rules for STM32F3 targets. | ||
# | ||
|
||
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_f3.c | ||
|
||
FLAGS += -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 \ | ||
-DTARGET_HW_$(TARGET_HW) \ | ||
-DSTM32F3 \ | ||
-T$(LINKER_FILE) \ | ||
-L$(LIBOPENCM3)/lib \ | ||
-lopencm3_stm32f3 \ | ||
$(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 stm32f3x.cfg -c init -c "reset halt" -c "flash write_image erase $(BINARY) 0x08000000" -c "reset run" -c shutdown |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.