mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-28 17:54:15 +01:00
Merge branch 'master' into bugfix-ground
This commit is contained in:
commit
1f88060671
5
.gitignore
vendored
5
.gitignore
vendored
@ -59,3 +59,8 @@ ground/uavobjgenerator/uavobjgenerator.pro.user
|
|||||||
ground/uavobjects/uavobjects.pro.user
|
ground/uavobjects/uavobjects.pro.user
|
||||||
ground/ground.pro.user
|
ground/ground.pro.user
|
||||||
|
|
||||||
|
# Ignore GNU global tags files
|
||||||
|
GPATH
|
||||||
|
GRTAGS
|
||||||
|
GSYMS
|
||||||
|
GTAGS
|
||||||
|
242
Makefile
242
Makefile
@ -1,9 +1,32 @@
|
|||||||
|
# Set up a default goal
|
||||||
|
.DEFAULT_GOAL := help
|
||||||
|
|
||||||
# Set up some macros for common directories within the tree
|
# Set up some macros for common directories within the tree
|
||||||
ROOT_DIR=$(CURDIR)
|
ROOT_DIR=$(CURDIR)
|
||||||
TOOLS_DIR=$(ROOT_DIR)/tools
|
TOOLS_DIR=$(ROOT_DIR)/tools
|
||||||
BUILD_DIR=$(ROOT_DIR)/build
|
BUILD_DIR=$(ROOT_DIR)/build
|
||||||
DL_DIR=$(ROOT_DIR)/downloads
|
DL_DIR=$(ROOT_DIR)/downloads
|
||||||
|
|
||||||
|
# Clean out undesirable variables from the environment and command-line
|
||||||
|
# to remove the chance that they will cause problems with our build
|
||||||
|
define SANITIZE_VAR
|
||||||
|
$(if $(filter-out undefined,$(origin $(1))),
|
||||||
|
$(info *NOTE* Sanitized $(2) variable '$(1)' from $(origin $(1)))
|
||||||
|
MAKEOVERRIDES = $(filter-out $(1)=%,$(MAKEOVERRIDES))
|
||||||
|
override $(1) :=
|
||||||
|
unexport $(1)
|
||||||
|
)
|
||||||
|
endef
|
||||||
|
|
||||||
|
# These specific variables can influence gcc in unexpected (and undesirable) ways
|
||||||
|
SANITIZE_GCC_VARS := TMPDIR GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH
|
||||||
|
SANITIZE_GCC_VARS += CFLAGS CPATH C_INCLUDE_PATH CPLUS_INCLUDE_PATH OBJC_INCLUDE_PATH DEPENDENCIES_OUTPUT
|
||||||
|
$(foreach var, $(SANITIZE_GCC_VARS), $(eval $(call SANITIZE_VAR,$(var),disallowed)))
|
||||||
|
|
||||||
|
# These specific variables used to be valid but now they make no sense
|
||||||
|
SANITIZE_DEPRECATED_VARS := USE_BOOTLOADER
|
||||||
|
$(foreach var, $(SANITIZE_DEPRECATED_VARS), $(eval $(call SANITIZE_VAR,$(var),deprecated)))
|
||||||
|
|
||||||
# We almost need to consider autoconf/automake instead of this
|
# We almost need to consider autoconf/automake instead of this
|
||||||
# I don't know if windows supports uname :-(
|
# I don't know if windows supports uname :-(
|
||||||
QT_SPEC=win32-g++
|
QT_SPEC=win32-g++
|
||||||
@ -36,11 +59,13 @@ export V1 := $(AT)
|
|||||||
else ifeq ($(V), 1)
|
else ifeq ($(V), 1)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
.PHONY: areyousureyoushouldberunningthis
|
.PHONY: help
|
||||||
areyousureyoushouldberunningthis:
|
help:
|
||||||
@echo
|
@echo
|
||||||
@echo " This Makefile will probably only work on Linux and Mac right now."
|
@echo " This Makefile is known to work on Linux and Mac in a standard shell environment."
|
||||||
@echo " If you're sure you want to be using this, you may wish to try the following targets:"
|
@echo " It also works on Windows by following the instructions in make/winx86/README.txt."
|
||||||
|
@echo
|
||||||
|
@echo " Here is a summary of the available targets:"
|
||||||
@echo
|
@echo
|
||||||
@echo " [Tool Installers]"
|
@echo " [Tool Installers]"
|
||||||
@echo " qt_sdk_install - Install the QT v4.6.2 tools"
|
@echo " qt_sdk_install - Install the QT v4.6.2 tools"
|
||||||
@ -49,20 +74,33 @@ areyousureyoushouldberunningthis:
|
|||||||
@echo
|
@echo
|
||||||
@echo " [Big Hammer]"
|
@echo " [Big Hammer]"
|
||||||
@echo " all - Generate UAVObjects, build openpilot firmware and gcs"
|
@echo " all - Generate UAVObjects, build openpilot firmware and gcs"
|
||||||
|
@echo " all_flight - Build all firmware, bootloaders and bootloader updaters"
|
||||||
|
@echo " all_fw - Build only firmware for all boards"
|
||||||
|
@echo " all_bl - Build only bootloaders for all boards"
|
||||||
|
@echo " all_blupd - Build only bootloader updaters for all boards"
|
||||||
|
@echo
|
||||||
@echo " all_clean - Remove your build directory ($(BUILD_DIR))"
|
@echo " all_clean - Remove your build directory ($(BUILD_DIR))"
|
||||||
|
@echo " all_flight_clean - Remove all firmware, bootloaders and bootloader updaters"
|
||||||
|
@echo " all_fw_clean - Remove firmware for all boards"
|
||||||
|
@echo " all_bl_clean - Remove bootlaoders for all boards"
|
||||||
|
@echo " all_blupd_clean - Remove bootloader updaters for all boards"
|
||||||
@echo
|
@echo
|
||||||
@echo " [Firmware]"
|
@echo " [Firmware]"
|
||||||
@echo " openpilot - Build firmware for the OpenPilot board"
|
@echo " <board> - Build firmware for <board>"
|
||||||
@echo " openpilot_clean - Delete all build output for the OpenPilot firmware"
|
@echo " supported boards are ($(FW_TARGETS))"
|
||||||
@echo " openpilot_program - Program the firmware onto the OpenPilot board"
|
@echo " <board>_clean - Remove firmware for <board>"
|
||||||
@echo " ahrs - Build firmware for the AHRS board"
|
@echo " <board>_program - Use OpenOCD + JTAG to write firmware to <board>"
|
||||||
@echo " ahrs_clean - Delete all build output for the AHRS firmware"
|
|
||||||
@echo " ahrs_program - Program the firmware onto the AHRS board"
|
|
||||||
@echo " coptercontrol - Build firmware for the CopterControl board"
|
|
||||||
@echo
|
@echo
|
||||||
@echo " NOTE: To build firmware to be chain loaded from a bootloader, use"
|
@echo " [Bootloader]"
|
||||||
@echo " make openpilot USE_BOOTLOADER=YES"
|
@echo " bl_<board> - Build bootloader for <board>"
|
||||||
@echo " Don't forget to do a clean between builds with/without bootloader"
|
@echo " supported boards are ($(BL_TARGETS))"
|
||||||
|
@echo " bl_<board>_clean - Remove bootloader for <board>"
|
||||||
|
@echo " bl_<board>_program - Use OpenOCD + JTAG to write bootloader to <board>"
|
||||||
|
@echo
|
||||||
|
@echo " [Bootloader Updater]"
|
||||||
|
@echo " blupd_<board> - Build bootloader updater for <board>"
|
||||||
|
@echo " supported boards are ($(BLUPD_TARGETS))"
|
||||||
|
@echo " blupd_<board>_clean - Remove bootloader updater for <board>"
|
||||||
@echo
|
@echo
|
||||||
@echo " [Simulation]"
|
@echo " [Simulation]"
|
||||||
@echo " sim_posix - Build OpenPilot simulation firmware for"
|
@echo " sim_posix - Build OpenPilot simulation firmware for"
|
||||||
@ -73,15 +111,14 @@ areyousureyoushouldberunningthis:
|
|||||||
@echo " sim_win32_clean - Delete all build output for the win32 simulation"
|
@echo " sim_win32_clean - Delete all build output for the win32 simulation"
|
||||||
@echo
|
@echo
|
||||||
@echo " [GCS]"
|
@echo " [GCS]"
|
||||||
@echo " gcs - Build the Ground Control System application"
|
@echo " gcs - Build the Ground Control System (GCS) application"
|
||||||
|
@echo " gcs_clean - Remove the Ground Control System (GCS) application"
|
||||||
@echo
|
@echo
|
||||||
@echo " [UAVObjects]"
|
@echo " [UAVObjects]"
|
||||||
@echo " uavobjects - Generate source files from the UAVObject definition XML files"
|
@echo " uavobjects - Generate source files from the UAVObject definition XML files"
|
||||||
@echo " uavobjects_test - parse xml-files - check for valid, duplicate ObjId's, ... "
|
@echo " uavobjects_test - parse xml-files - check for valid, duplicate ObjId's, ... "
|
||||||
@echo " uavobjects_flight - Generate flight source files from the UAVObject definition XML files"
|
@echo " uavobjects_<group> - Generate source files from a subset of the UAVObject definition XML files"
|
||||||
@echo " uavobjects_gcs - Generate groundstation source files from the UAVObject definition XML files"
|
@echo " supported groups are ($(UAVOBJ_TARGETS))"
|
||||||
@echo " uavobjects_python - Generate python source files from the UAVObject definition XML files"
|
|
||||||
@echo " uavobjects_matlab - Generate matlab source files from the UAVObject definition XML files"
|
|
||||||
@echo
|
@echo
|
||||||
@echo " Note: All tools will be installed into $(TOOLS_DIR)"
|
@echo " Note: All tools will be installed into $(TOOLS_DIR)"
|
||||||
@echo " All build output will be placed in $(BUILD_DIR)"
|
@echo " All build output will be placed in $(BUILD_DIR)"
|
||||||
@ -221,8 +258,9 @@ endif
|
|||||||
all_ground: openpilotgcs
|
all_ground: openpilotgcs
|
||||||
|
|
||||||
# Convenience target for the GCS
|
# Convenience target for the GCS
|
||||||
.PHONY: gcs
|
.PHONY: gcs gcs_clean
|
||||||
gcs: openpilotgcs
|
gcs: openpilotgcs
|
||||||
|
gcs_clean: openpilotgcs_clean
|
||||||
|
|
||||||
.PHONY: openpilotgcs
|
.PHONY: openpilotgcs
|
||||||
openpilotgcs: uavobjects_gcs
|
openpilotgcs: uavobjects_gcs
|
||||||
@ -244,6 +282,11 @@ else
|
|||||||
$(error $@ is currently only available on Windows)
|
$(error $@ is currently only available on Windows)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
.PHONY: openpilotgcs_clean
|
||||||
|
openpilotgcs_clean:
|
||||||
|
$(V0) @echo " CLEAN $@"
|
||||||
|
$(V1) [ ! -d "$(BUILD_DIR)/ground/openpilotgcs" ] || $(RM) -r "$(BUILD_DIR)/ground/openpilotgcs"
|
||||||
|
|
||||||
.PHONY: uavobjgenerator
|
.PHONY: uavobjgenerator
|
||||||
uavobjgenerator:
|
uavobjgenerator:
|
||||||
$(V1) mkdir -p $(BUILD_DIR)/ground/$@
|
$(V1) mkdir -p $(BUILD_DIR)/ground/$@
|
||||||
@ -252,8 +295,9 @@ uavobjgenerator:
|
|||||||
$(MAKE) --no-print-directory -w ; \
|
$(MAKE) --no-print-directory -w ; \
|
||||||
)
|
)
|
||||||
|
|
||||||
|
UAVOBJ_TARGETS := gcs flight python matlab java
|
||||||
.PHONY:uavobjects
|
.PHONY:uavobjects
|
||||||
uavobjects: uavobjects_gcs uavobjects_flight uavobjects_python uavobjects_matlab uavobjects_java
|
uavobjects: $(addprefix uavobjects_, $(UAVOBJ_TARGETS))
|
||||||
|
|
||||||
UAVOBJ_XML_DIR := $(ROOT_DIR)/shared/uavobjectdefinition
|
UAVOBJ_XML_DIR := $(ROOT_DIR)/shared/uavobjectdefinition
|
||||||
UAVOBJ_OUT_DIR := $(BUILD_DIR)/uavobject-synthetics
|
UAVOBJ_OUT_DIR := $(BUILD_DIR)/uavobject-synthetics
|
||||||
@ -270,6 +314,7 @@ uavobjects_test: $(UAVOBJ_OUT_DIR) uavobjgenerator
|
|||||||
$(V1) $(UAVOBJGENERATOR) -v -none $(UAVOBJ_XML_DIR) $(ROOT_DIR)
|
$(V1) $(UAVOBJGENERATOR) -v -none $(UAVOBJ_XML_DIR) $(ROOT_DIR)
|
||||||
|
|
||||||
uavobjects_clean:
|
uavobjects_clean:
|
||||||
|
$(V0) @echo " CLEAN $@"
|
||||||
$(V1) [ ! -d "$(UAVOBJ_OUT_DIR)" ] || $(RM) -r "$(UAVOBJ_OUT_DIR)"
|
$(V1) [ ! -d "$(UAVOBJ_OUT_DIR)" ] || $(RM) -r "$(UAVOBJ_OUT_DIR)"
|
||||||
|
|
||||||
##############################
|
##############################
|
||||||
@ -280,25 +325,38 @@ uavobjects_clean:
|
|||||||
|
|
||||||
FW_TARGETS := openpilot ahrs coptercontrol pipxtreme ins
|
FW_TARGETS := openpilot ahrs coptercontrol pipxtreme ins
|
||||||
BL_TARGETS := $(addprefix bl_, $(FW_TARGETS))
|
BL_TARGETS := $(addprefix bl_, $(FW_TARGETS))
|
||||||
|
BLUPD_TARGETS := $(addprefix blupd_, $(FW_TARGETS))
|
||||||
|
|
||||||
|
# FIXME: The INS build doesn't have a bootloader or bootloader
|
||||||
|
# updater yet so we need to filter them out to prevent errors.
|
||||||
|
BL_TARGETS := $(filter-out bl_ins, $(BL_TARGETS))
|
||||||
|
BLUPD_TARGETS := $(filter-out blupd_ins, $(BLUPD_TARGETS))
|
||||||
|
|
||||||
.PHONY: all_fw all_fw_clean
|
.PHONY: all_fw all_fw_clean
|
||||||
all_fw: $(addsuffix _bin, $(FW_TARGETS))
|
all_fw: $(addsuffix _bin, $(FW_TARGETS))
|
||||||
all_fw_clean: $(addsuffix _clean, $(FW_TARGETS))
|
all_fw_clean: $(addsuffix _clean, $(FW_TARGETS))
|
||||||
|
|
||||||
.PHONY: all_bw all_bw_clean
|
.PHONY: all_bl all_bl_clean
|
||||||
all_bl: $(addsuffix _elf, $(BL_TARGETS))
|
all_bl: $(addsuffix _bin, $(BL_TARGETS))
|
||||||
all_bl_clean: $(addsuffix _clean, $(BL_TARGETS))
|
all_bl_clean: $(addsuffix _clean, $(BL_TARGETS))
|
||||||
|
|
||||||
|
.PHONY: all_blupd all_blupd_clean
|
||||||
|
all_blupd: $(addsuffix _bin, $(BLUPD_TARGETS))
|
||||||
|
all_blupd_clean: $(addsuffix _clean, $(BLUPD_TARGETS))
|
||||||
|
|
||||||
.PHONY: all_flight all_flight_clean
|
.PHONY: all_flight all_flight_clean
|
||||||
all_flight: all_fw all_bl
|
all_flight: all_fw all_bl all_blupd
|
||||||
all_flight_clean: all_fw_clean all_bl_clean
|
all_flight_clean: all_fw_clean all_bl_clean all_blupd_clean
|
||||||
|
|
||||||
.PHONY: openpilot
|
.PHONY: openpilot
|
||||||
openpilot: openpilot_bin
|
openpilot: openpilot_bin
|
||||||
|
|
||||||
openpilot_%: uavobjects_flight
|
openpilot_%: uavobjects_flight
|
||||||
$(V1) mkdir -p $(BUILD_DIR)/openpilot/dep
|
$(V1) mkdir -p $(BUILD_DIR)/openpilot/dep
|
||||||
$(V1) cd $(ROOT_DIR)/flight/OpenPilot && $(MAKE) -r --no-print-directory OUTDIR="$(BUILD_DIR)/openpilot" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" $*
|
$(V1) cd $(ROOT_DIR)/flight/OpenPilot && \
|
||||||
|
$(MAKE) -r --no-print-directory \
|
||||||
|
OUTDIR="$(BUILD_DIR)/openpilot" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \
|
||||||
|
REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" $*
|
||||||
|
|
||||||
.PHONY: openpilot_clean
|
.PHONY: openpilot_clean
|
||||||
openpilot_clean:
|
openpilot_clean:
|
||||||
@ -306,23 +364,47 @@ openpilot_clean:
|
|||||||
$(V1) $(RM) -fr $(BUILD_DIR)/openpilot
|
$(V1) $(RM) -fr $(BUILD_DIR)/openpilot
|
||||||
|
|
||||||
.PHONY: bl_openpilot
|
.PHONY: bl_openpilot
|
||||||
bl_openpilot: bl_openpilot_elf
|
bl_openpilot: bl_openpilot_bin
|
||||||
|
bl_openpilot_bino: bl_openpilot_bin
|
||||||
|
|
||||||
bl_openpilot_%:
|
bl_openpilot_%:
|
||||||
$(V1) mkdir -p $(BUILD_DIR)/bl_openpilot/dep
|
$(V1) mkdir -p $(BUILD_DIR)/bl_openpilot/dep
|
||||||
$(V1) cd $(ROOT_DIR)/flight/Bootloaders/OpenPilot && $(MAKE) -r --no-print-directory OUTDIR="$(BUILD_DIR)/bl_openpilot" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" $*
|
$(V1) cd $(ROOT_DIR)/flight/Bootloaders/OpenPilot && \
|
||||||
|
$(MAKE) -r --no-print-directory \
|
||||||
|
OUTDIR="$(BUILD_DIR)/bl_openpilot" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \
|
||||||
|
REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" $*
|
||||||
|
|
||||||
.PHONY: bl_openpilot_clean
|
.PHONY: bl_openpilot_clean
|
||||||
bl_openpilot_clean:
|
bl_openpilot_clean:
|
||||||
$(V0) @echo " CLEAN $@"
|
$(V0) @echo " CLEAN $@"
|
||||||
$(V1) $(RM) -fr $(BUILD_DIR)/bl_openpilot
|
$(V1) $(RM) -fr $(BUILD_DIR)/bl_openpilot
|
||||||
|
|
||||||
|
.PHONY: blupd_openpilot
|
||||||
|
blupd_openpilot: blupd_openpilot_bin
|
||||||
|
|
||||||
|
blupd_openpilot_%: bl_openpilot_bino
|
||||||
|
$(V1) mkdir -p $(BUILD_DIR)/blupd_openpilot/dep
|
||||||
|
$(V1) cd $(ROOT_DIR)/flight/Bootloaders/BootloaderUpdater && \
|
||||||
|
$(MAKE) -r --no-print-directory \
|
||||||
|
OUTDIR="$(BUILD_DIR)/blupd_openpilot" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \
|
||||||
|
REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" \
|
||||||
|
BOARD=STM3210E_OP MODEL=HD MODEL_SUFFIX=_OP \
|
||||||
|
BLOBJ=$(BUILD_DIR)/bl_openpilot/OpenPilot_BL.bin.o $*
|
||||||
|
|
||||||
|
.PHONY: blupd_openpilot_clean
|
||||||
|
blupd_openpilot_clean:
|
||||||
|
$(V0) @echo " CLEAN $@"
|
||||||
|
$(V1) $(RM) -fr $(BUILD_DIR)/blupd_openpilot
|
||||||
|
|
||||||
.PHONY: ahrs
|
.PHONY: ahrs
|
||||||
ahrs: ahrs_bin
|
ahrs: ahrs_bin
|
||||||
|
|
||||||
ahrs_%: uavobjects_flight
|
ahrs_%: uavobjects_flight
|
||||||
$(V1) mkdir -p $(BUILD_DIR)/ahrs/dep
|
$(V1) mkdir -p $(BUILD_DIR)/ahrs/dep
|
||||||
$(V1) cd $(ROOT_DIR)/flight/AHRS && $(MAKE) -r --no-print-directory OUTDIR="$(BUILD_DIR)/ahrs" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" $*
|
$(V1) cd $(ROOT_DIR)/flight/AHRS && \
|
||||||
|
$(MAKE) -r --no-print-directory \
|
||||||
|
OUTDIR="$(BUILD_DIR)/ahrs" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \
|
||||||
|
REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" $*
|
||||||
|
|
||||||
.PHONY: ahrs_clean
|
.PHONY: ahrs_clean
|
||||||
ahrs_clean:
|
ahrs_clean:
|
||||||
@ -330,23 +412,47 @@ ahrs_clean:
|
|||||||
$(V1) $(RM) -fr $(BUILD_DIR)/ahrs
|
$(V1) $(RM) -fr $(BUILD_DIR)/ahrs
|
||||||
|
|
||||||
.PHONY: bl_ahrs
|
.PHONY: bl_ahrs
|
||||||
bl_ahrs: bl_ahrs_elf
|
bl_ahrs: bl_ahrs_bin
|
||||||
|
bl_ahrs_bino: bl_ahrs_bin
|
||||||
|
|
||||||
bl_ahrs_%:
|
bl_ahrs_%:
|
||||||
$(V1) mkdir -p $(BUILD_DIR)/bl_ahrs/dep
|
$(V1) mkdir -p $(BUILD_DIR)/bl_ahrs/dep
|
||||||
$(V1) cd $(ROOT_DIR)/flight/Bootloaders/AHRS && $(MAKE) -r --no-print-directory OUTDIR="$(BUILD_DIR)/bl_ahrs" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" $*
|
$(V1) cd $(ROOT_DIR)/flight/Bootloaders/AHRS && \
|
||||||
|
$(MAKE) -r --no-print-directory \
|
||||||
|
OUTDIR="$(BUILD_DIR)/bl_ahrs" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \
|
||||||
|
REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" $*
|
||||||
|
|
||||||
.PHONY: bl_ahrs_clean
|
.PHONY: bl_ahrs_clean
|
||||||
bl_ahrs_clean:
|
bl_ahrs_clean:
|
||||||
$(V0) @echo " CLEAN $@"
|
$(V0) @echo " CLEAN $@"
|
||||||
$(V1) $(RM) -fr $(BUILD_DIR)/bl_ahrs
|
$(V1) $(RM) -fr $(BUILD_DIR)/bl_ahrs
|
||||||
|
|
||||||
|
.PHONY: blupd_ahrs
|
||||||
|
blupd_ahrs: blupd_ahrs_bin
|
||||||
|
|
||||||
|
blupd_ahrs_%: bl_ahrs_bino bl_ahrs
|
||||||
|
$(V1) mkdir -p $(BUILD_DIR)/blupd_ahrs/dep
|
||||||
|
$(V1) cd $(ROOT_DIR)/flight/Bootloaders/BootloaderUpdater && \
|
||||||
|
$(MAKE) -r --no-print-directory \
|
||||||
|
OUTDIR="$(BUILD_DIR)/blupd_ahrs" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \
|
||||||
|
REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" \
|
||||||
|
BOARD=STM32103CB_AHRS MODEL=MD \
|
||||||
|
BLOBJ=$(BUILD_DIR)/bl_ahrs/AHRS_BL.bin.o $*
|
||||||
|
|
||||||
|
.PHONY: blupd_ahrs_clean
|
||||||
|
blupd_ahrs_clean:
|
||||||
|
$(V0) @echo " CLEAN $@"
|
||||||
|
$(V1) $(RM) -fr $(BUILD_DIR)/blupd_ahrs
|
||||||
|
|
||||||
.PHONY: coptercontrol
|
.PHONY: coptercontrol
|
||||||
coptercontrol: coptercontrol_bin
|
coptercontrol: coptercontrol_bin
|
||||||
|
|
||||||
coptercontrol_%: uavobjects_flight
|
coptercontrol_%: uavobjects_flight
|
||||||
$(V1) mkdir -p $(BUILD_DIR)/coptercontrol/dep
|
$(V1) mkdir -p $(BUILD_DIR)/coptercontrol/dep
|
||||||
$(V1) cd $(ROOT_DIR)/flight/CopterControl && $(MAKE) -r --no-print-directory OUTDIR="$(BUILD_DIR)/coptercontrol" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" $*
|
$(V1) cd $(ROOT_DIR)/flight/CopterControl && \
|
||||||
|
$(MAKE) -r --no-print-directory \
|
||||||
|
OUTDIR="$(BUILD_DIR)/coptercontrol" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \
|
||||||
|
REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" $*
|
||||||
|
|
||||||
.PHONY: coptercontrol_clean
|
.PHONY: coptercontrol_clean
|
||||||
coptercontrol_clean:
|
coptercontrol_clean:
|
||||||
@ -354,23 +460,47 @@ coptercontrol_clean:
|
|||||||
$(V1) $(RM) -fr $(BUILD_DIR)/coptercontrol
|
$(V1) $(RM) -fr $(BUILD_DIR)/coptercontrol
|
||||||
|
|
||||||
.PHONY: bl_coptercontrol
|
.PHONY: bl_coptercontrol
|
||||||
bl_coptercontrol: bl_coptercontrol_elf
|
bl_coptercontrol: bl_coptercontrol_bin
|
||||||
|
bl_coptercontrol_bino: bl_coptercontrol_bin
|
||||||
|
|
||||||
bl_coptercontrol_%:
|
bl_coptercontrol_%:
|
||||||
$(V1) mkdir -p $(BUILD_DIR)/bl_coptercontrol/dep
|
$(V1) mkdir -p $(BUILD_DIR)/bl_coptercontrol/dep
|
||||||
$(V1) cd $(ROOT_DIR)/flight/Bootloaders/CopterControl && $(MAKE) -r --no-print-directory OUTDIR="$(BUILD_DIR)/bl_coptercontrol" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" $*
|
$(V1) cd $(ROOT_DIR)/flight/Bootloaders/CopterControl && \
|
||||||
|
$(MAKE) -r --no-print-directory \
|
||||||
|
OUTDIR="$(BUILD_DIR)/bl_coptercontrol" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \
|
||||||
|
REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" $*
|
||||||
|
|
||||||
.PHONY: bl_coptercontrol_clean
|
.PHONY: bl_coptercontrol_clean
|
||||||
bl_coptercontrol_clean:
|
bl_coptercontrol_clean:
|
||||||
$(V0) @echo " CLEAN $@"
|
$(V0) @echo " CLEAN $@"
|
||||||
$(V1) $(RM) -fr $(BUILD_DIR)/bl_coptercontrol
|
$(V1) $(RM) -fr $(BUILD_DIR)/bl_coptercontrol
|
||||||
|
|
||||||
|
.PHONY: blupd_coptercontrol
|
||||||
|
blupd_coptercontrol: blupd_coptercontrol_bin
|
||||||
|
|
||||||
|
blupd_coptercontrol_%: bl_coptercontrol_bino
|
||||||
|
$(V1) mkdir -p $(BUILD_DIR)/blupd_coptercontrol/dep
|
||||||
|
$(V1) cd $(ROOT_DIR)/flight/Bootloaders/BootloaderUpdater && \
|
||||||
|
$(MAKE) -r --no-print-directory \
|
||||||
|
OUTDIR="$(BUILD_DIR)/blupd_coptercontrol" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \
|
||||||
|
REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" \
|
||||||
|
BOARD=STM32103CB_CC_Rev1 MODEL=MD MODEL_SUFFIX=_CC \
|
||||||
|
BLOBJ=$(BUILD_DIR)/bl_coptercontrol/CopterControl_BL.bin.o $*
|
||||||
|
|
||||||
|
.PHONY: blupd_coptercontrol_clean
|
||||||
|
blupd_coptercontrol_clean:
|
||||||
|
$(V0) @echo " CLEAN $@"
|
||||||
|
$(V1) $(RM) -fr $(BUILD_DIR)/blupd_coptercontrol
|
||||||
|
|
||||||
.PHONY: pipxtreme
|
.PHONY: pipxtreme
|
||||||
pipxtreme: pipxtreme_bin
|
pipxtreme: pipxtreme_bin
|
||||||
|
|
||||||
pipxtreme_%: uavobjects_flight
|
pipxtreme_%: uavobjects_flight
|
||||||
$(V1) mkdir -p $(BUILD_DIR)/pipxtreme/dep
|
$(V1) mkdir -p $(BUILD_DIR)/pipxtreme/dep
|
||||||
$(V1) cd $(ROOT_DIR)/flight/PipXtreme && $(MAKE) -r --no-print-directory OUTDIR="$(BUILD_DIR)/pipxtreme" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" $*
|
$(V1) cd $(ROOT_DIR)/flight/PipXtreme && \
|
||||||
|
$(MAKE) -r --no-print-directory \
|
||||||
|
OUTDIR="$(BUILD_DIR)/pipxtreme" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \
|
||||||
|
REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" $*
|
||||||
|
|
||||||
.PHONY: pipxtreme_clean
|
.PHONY: pipxtreme_clean
|
||||||
pipxtreme_clean:
|
pipxtreme_clean:
|
||||||
@ -378,23 +508,48 @@ pipxtreme_clean:
|
|||||||
$(V1) $(RM) -fr $(BUILD_DIR)/pipxtreme
|
$(V1) $(RM) -fr $(BUILD_DIR)/pipxtreme
|
||||||
|
|
||||||
.PHONY: bl_pipxtreme
|
.PHONY: bl_pipxtreme
|
||||||
bl_pipxtreme: bl_pipxtreme_elf
|
bl_pipxtreme: bl_pipxtreme_bin
|
||||||
|
bl_pipxtreme_bino: bl_pipxtreme_bin
|
||||||
|
|
||||||
bl_pipxtreme_%:
|
bl_pipxtreme_%:
|
||||||
$(V1) mkdir -p $(BUILD_DIR)/bl_pipxtreme/dep
|
$(V1) mkdir -p $(BUILD_DIR)/bl_pipxtreme/dep
|
||||||
$(V1) cd $(ROOT_DIR)/flight/Bootloaders/PipXtreme && $(MAKE) -r --no-print-directory OUTDIR="$(BUILD_DIR)/bl_pipxtreme" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" $*
|
$(V1) cd $(ROOT_DIR)/flight/Bootloaders/PipXtreme && \
|
||||||
|
$(MAKE) -r --no-print-directory \
|
||||||
|
OUTDIR="$(BUILD_DIR)/bl_pipxtreme" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \
|
||||||
|
REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" $*
|
||||||
|
|
||||||
.PHONY: bl_pipxtreme_clean
|
.PHONY: bl_pipxtreme_clean
|
||||||
bl_pipxtreme_clean:
|
bl_pipxtreme_clean:
|
||||||
$(V0) @echo " CLEAN $@"
|
$(V0) @echo " CLEAN $@"
|
||||||
$(V1) $(RM) -fr $(BUILD_DIR)/bl_pipxtreme
|
$(V1) $(RM) -fr $(BUILD_DIR)/bl_pipxtreme
|
||||||
|
|
||||||
|
.PHONY: blupd_pipxtreme
|
||||||
|
blupd_pipxtreme: blupd_pipxtreme_bin
|
||||||
|
|
||||||
|
blupd_pipxtreme_%: bl_pipxtreme_bino
|
||||||
|
$(V1) mkdir -p $(BUILD_DIR)/blupd_pipxtreme/dep
|
||||||
|
$(V1) cd $(ROOT_DIR)/flight/Bootloaders/BootloaderUpdater && \
|
||||||
|
$(MAKE) -r --no-print-directory \
|
||||||
|
OUTDIR="$(BUILD_DIR)/blupd_pipxtreme" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \
|
||||||
|
REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" \
|
||||||
|
BOARD=STM32103CB_PIPXTREME MODEL=MD MODEL_SUFFIX=_CC \
|
||||||
|
BLOBJ=$(BUILD_DIR)/bl_pipxtreme/PipXtreme_BL.bin.o $*
|
||||||
|
|
||||||
|
.PHONY: blupd_pipxtreme_clean
|
||||||
|
blupd_pipxtreme_clean:
|
||||||
|
$(V0) @echo " CLEAN $@"
|
||||||
|
$(V1) $(RM) -fr $(BUILD_DIR)/blupd_pipxtreme
|
||||||
|
|
||||||
|
|
||||||
.PHONY: ins
|
.PHONY: ins
|
||||||
ins: ins_bin
|
ins: ins_bin
|
||||||
|
|
||||||
ins_%: uavobjects_flight
|
ins_%: uavobjects_flight
|
||||||
$(V1) mkdir -p $(BUILD_DIR)/ins/dep
|
$(V1) mkdir -p $(BUILD_DIR)/ins/dep
|
||||||
$(V1) cd $(ROOT_DIR)/flight/INS && $(MAKE) -r --no-print-directory OUTDIR="$(BUILD_DIR)/ins" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" $*
|
$(V1) cd $(ROOT_DIR)/flight/INS && \
|
||||||
|
$(MAKE) -r --no-print-directory \
|
||||||
|
OUTDIR="$(BUILD_DIR)/ins" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \
|
||||||
|
REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" $*
|
||||||
|
|
||||||
.PHONY: ins_clean
|
.PHONY: ins_clean
|
||||||
ins_clean:
|
ins_clean:
|
||||||
@ -406,7 +561,10 @@ bl_ins: bl_ins_elf
|
|||||||
|
|
||||||
bl_ins_%:
|
bl_ins_%:
|
||||||
$(V1) mkdir -p $(BUILD_DIR)/bl_ins/dep
|
$(V1) mkdir -p $(BUILD_DIR)/bl_ins/dep
|
||||||
$(V1) cd $(ROOT_DIR)/flight/Bootloaders/INS && $(MAKE) -r --no-print-directory OUTDIR="$(BUILD_DIR)/bl_ins" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" $*
|
$(V1) cd $(ROOT_DIR)/flight/Bootloaders/INS && \
|
||||||
|
$(MAKE) -r --no-print-directory \
|
||||||
|
OUTDIR="$(BUILD_DIR)/bl_ins" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \
|
||||||
|
REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" $*
|
||||||
|
|
||||||
.PHONY: bl_ins_clean
|
.PHONY: bl_ins_clean
|
||||||
bl_ins_clean:
|
bl_ins_clean:
|
||||||
@ -419,11 +577,13 @@ sim_posix: sim_posix_elf
|
|||||||
|
|
||||||
sim_posix_%: uavobjects_flight
|
sim_posix_%: uavobjects_flight
|
||||||
$(V1) mkdir -p $(BUILD_DIR)/sitl_posix
|
$(V1) mkdir -p $(BUILD_DIR)/sitl_posix
|
||||||
$(V1) $(MAKE) --no-print-directory -C $(ROOT_DIR)/flight/OpenPilot --file=$(ROOT_DIR)/flight/OpenPilot/Makefile.posix $*
|
$(V1) $(MAKE) --no-print-directory \
|
||||||
|
-C $(ROOT_DIR)/flight/OpenPilot --file=$(ROOT_DIR)/flight/OpenPilot/Makefile.posix $*
|
||||||
|
|
||||||
.PHONY: sim_win32
|
.PHONY: sim_win32
|
||||||
sim_win32: sim_win32_exe
|
sim_win32: sim_win32_exe
|
||||||
|
|
||||||
sim_win32_%: uavobjects_flight
|
sim_win32_%: uavobjects_flight
|
||||||
$(V1) mkdir -p $(BUILD_DIR)/sitl_win32
|
$(V1) mkdir -p $(BUILD_DIR)/sitl_win32
|
||||||
$(V1) $(MAKE) --no-print-directory -C $(ROOT_DIR)/flight/OpenPilot --file=$(ROOT_DIR)/flight/OpenPilot/Makefile.win32 $*
|
$(V1) $(MAKE) --no-print-directory \
|
||||||
|
-C $(ROOT_DIR)/flight/OpenPilot --file=$(ROOT_DIR)/flight/OpenPilot/Makefile.win32 $*
|
||||||
|
@ -29,7 +29,6 @@ include $(TOP)/make/firmware-defs.mk
|
|||||||
# Set developer code and compile options
|
# Set developer code and compile options
|
||||||
# Set to YES for debugging
|
# Set to YES for debugging
|
||||||
DEBUG ?= NO
|
DEBUG ?= NO
|
||||||
USE_BOOTLOADER ?= YES
|
|
||||||
|
|
||||||
# Set to YES when using Code Sourcery toolchain
|
# Set to YES when using Code Sourcery toolchain
|
||||||
CODE_SOURCERY ?= YES
|
CODE_SOURCERY ?= YES
|
||||||
@ -50,11 +49,6 @@ MCU = cortex-m3
|
|||||||
CHIP = STM32F103CBT
|
CHIP = STM32F103CBT
|
||||||
BOARD = STM32103CB_AHRS
|
BOARD = STM32103CB_AHRS
|
||||||
MODEL = MD
|
MODEL = MD
|
||||||
ifeq ($(USE_BOOTLOADER), YES)
|
|
||||||
BOOT_MODEL = $(MODEL)_BL
|
|
||||||
else
|
|
||||||
BOOT_MODEL = $(MODEL)_NB
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.)
|
# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.)
|
||||||
OUTDIR = $(TOP)/build/ahrs
|
OUTDIR = $(TOP)/build/ahrs
|
||||||
@ -229,9 +223,8 @@ CDEFS = -DSTM32F10X_$(MODEL)
|
|||||||
CDEFS += -DUSE_STDPERIPH_DRIVER
|
CDEFS += -DUSE_STDPERIPH_DRIVER
|
||||||
CDEFS += -DUSE_$(BOARD)
|
CDEFS += -DUSE_$(BOARD)
|
||||||
CDEFS += -DIN_AHRS
|
CDEFS += -DIN_AHRS
|
||||||
ifeq ($(USE_BOOTLOADER), YES)
|
|
||||||
CDEFS += -DUSE_BOOTLOADER
|
CDEFS += -DUSE_BOOTLOADER
|
||||||
endif
|
|
||||||
# Place project-specific -D and/or -U options for
|
# Place project-specific -D and/or -U options for
|
||||||
# Assembler with preprocessor here.
|
# Assembler with preprocessor here.
|
||||||
#ADEFS = -DUSE_IRQ_ASM_WRAPPER
|
#ADEFS = -DUSE_IRQ_ASM_WRAPPER
|
||||||
@ -303,16 +296,17 @@ LDFLAGS += $(MATH_LIB)
|
|||||||
LDFLAGS += -lc -lgcc
|
LDFLAGS += -lc -lgcc
|
||||||
|
|
||||||
# Set linker-script name depending on selected submodel name
|
# Set linker-script name depending on selected submodel name
|
||||||
LDFLAGS +=-T$(LINKERSCRIPTPATH)/link_$(BOARD)_$(BOOT_MODEL).ld
|
LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_memory.ld
|
||||||
|
LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_sections.ld
|
||||||
|
|
||||||
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
|
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).bin
|
||||||
# Program
|
# Program
|
||||||
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
|
OOCD_CL+=-c "flash write_image erase $(OOCD_LOADFILE) 0x08002000 bin"
|
||||||
# Verify
|
# Verify
|
||||||
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
|
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE) 0x08002000 bin"
|
||||||
# reset target
|
# reset target
|
||||||
OOCD_CL+=-c "reset run"
|
OOCD_CL+=-c "reset run"
|
||||||
# # terminate OOCD after programming
|
# terminate OOCD after programming
|
||||||
OOCD_CL+=-c shutdown
|
OOCD_CL+=-c shutdown
|
||||||
|
|
||||||
|
|
||||||
@ -352,19 +346,12 @@ endif
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# Program the device.
|
# Program the device.
|
||||||
ifeq ($(USE_BOOTLOADER), YES)
|
|
||||||
# Program the device with OP Upload Tool".
|
|
||||||
program: $(OUTDIR)/$(TARGET).bin
|
|
||||||
@echo ${quote}Programming with OP Upload Tool${quote}
|
|
||||||
../../ground/src/experimental/upload-build-desktop/debug/OPUploadTool -d 1 -p $(OUTDIR)/$(TARGET).bin
|
|
||||||
else
|
|
||||||
ifeq ($(FLASH_TOOL),OPENOCD)
|
ifeq ($(FLASH_TOOL),OPENOCD)
|
||||||
# Program the device with Dominic Rath's OPENOCD in "batch-mode", needs cfg and "reset-script".
|
# Program the device with Dominic Rath's OPENOCD in "batch-mode", needs cfg and "reset-script".
|
||||||
program: $(OUTDIR)/$(TARGET).elf
|
program: $(OUTDIR)/$(TARGET).bin
|
||||||
@echo ${quote}Programming with OPENOCD${quote}
|
@echo ${quote}Programming with OPENOCD${quote}
|
||||||
$(OOCD_EXE) $(OOCD_CL)
|
$(OOCD_EXE) $(OOCD_CL)
|
||||||
endif
|
endif
|
||||||
endif
|
|
||||||
|
|
||||||
# Link: create ELF output file from object files.
|
# Link: create ELF output file from object files.
|
||||||
$(eval $(call LINK_TEMPLATE, $(OUTDIR)/$(TARGET).elf, $(ALLOBJ)))
|
$(eval $(call LINK_TEMPLATE, $(OUTDIR)/$(TARGET).elf, $(ALLOBJ)))
|
||||||
@ -393,12 +380,15 @@ $(eval $(call PARTIAL_COMPILE_TEMPLATE, SRC))
|
|||||||
# Compile: create assembler files from C source files. ARM only
|
# Compile: create assembler files from C source files. ARM only
|
||||||
$(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM))
|
$(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM))
|
||||||
|
|
||||||
.PHONY: elf lss sym hex bin
|
$(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin
|
||||||
|
|
||||||
|
.PHONY: elf lss sym hex bin bino
|
||||||
elf: $(OUTDIR)/$(TARGET).elf
|
elf: $(OUTDIR)/$(TARGET).elf
|
||||||
lss: $(OUTDIR)/$(TARGET).lss
|
lss: $(OUTDIR)/$(TARGET).lss
|
||||||
sym: $(OUTDIR)/$(TARGET).sym
|
sym: $(OUTDIR)/$(TARGET).sym
|
||||||
hex: $(OUTDIR)/$(TARGET).hex
|
hex: $(OUTDIR)/$(TARGET).hex
|
||||||
bin: $(OUTDIR)/$(TARGET).bin
|
bin: $(OUTDIR)/$(TARGET).bin
|
||||||
|
bino: $(OUTDIR)/$(TARGET).bin.o
|
||||||
|
|
||||||
# Display sizes of sections.
|
# Display sizes of sections.
|
||||||
$(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf))
|
$(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf))
|
||||||
@ -420,6 +410,7 @@ clean_list :
|
|||||||
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).bin
|
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).bin
|
||||||
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).sym
|
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).sym
|
||||||
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).lss
|
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).lss
|
||||||
|
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).bin.o
|
||||||
$(V1) $(REMOVE) $(ALLOBJ)
|
$(V1) $(REMOVE) $(ALLOBJ)
|
||||||
$(V1) $(REMOVE) $(LSTFILES)
|
$(V1) $(REMOVE) $(LSTFILES)
|
||||||
$(V1) $(REMOVE) $(DEPFILES)
|
$(V1) $(REMOVE) $(DEPFILES)
|
||||||
|
@ -29,7 +29,6 @@ include $(TOP)/make/firmware-defs.mk
|
|||||||
# Set developer code and compile options
|
# Set developer code and compile options
|
||||||
# Set to YES for debugging
|
# Set to YES for debugging
|
||||||
DEBUG ?= NO
|
DEBUG ?= NO
|
||||||
override USE_BOOTLOADER = NO
|
|
||||||
|
|
||||||
# Set to YES when using Code Sourcery toolchain
|
# Set to YES when using Code Sourcery toolchain
|
||||||
CODE_SOURCERY ?= YES
|
CODE_SOURCERY ?= YES
|
||||||
@ -208,9 +207,7 @@ DEBUGF = dwarf-2
|
|||||||
CDEFS = -DSTM32F10X_$(MODEL)
|
CDEFS = -DSTM32F10X_$(MODEL)
|
||||||
CDEFS += -DUSE_STDPERIPH_DRIVER
|
CDEFS += -DUSE_STDPERIPH_DRIVER
|
||||||
CDEFS += -DUSE_$(BOARD)
|
CDEFS += -DUSE_$(BOARD)
|
||||||
ifeq ($(USE_BOOTLOADER), YES)
|
|
||||||
CDEFS += -DUSE_BOOTLOADER
|
|
||||||
endif
|
|
||||||
# Place project-specific -D and/or -U options for
|
# Place project-specific -D and/or -U options for
|
||||||
# Assembler with preprocessor here.
|
# Assembler with preprocessor here.
|
||||||
#ADEFS = -DUSE_IRQ_ASM_WRAPPER
|
#ADEFS = -DUSE_IRQ_ASM_WRAPPER
|
||||||
@ -237,9 +234,10 @@ CSTANDARD = -std=gnu99
|
|||||||
# Flags for C and C++ (arm-elf-gcc/arm-elf-g++)
|
# Flags for C and C++ (arm-elf-gcc/arm-elf-g++)
|
||||||
|
|
||||||
ifeq ($(DEBUG),YES)
|
ifeq ($(DEBUG),YES)
|
||||||
CFLAGS = -g$(DEBUGF)
|
CFLAGS =
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
CFLAGS += -g$(DEBUGF)
|
||||||
CFLAGS += -O$(OPT)
|
CFLAGS += -O$(OPT)
|
||||||
ifeq ($(DEBUG),NO)
|
ifeq ($(DEBUG),NO)
|
||||||
CFLAGS += -fdata-sections -ffunction-sections
|
CFLAGS += -fdata-sections -ffunction-sections
|
||||||
@ -280,7 +278,7 @@ MATH_LIB = -lm
|
|||||||
# --cref: add cross reference to map file
|
# --cref: add cross reference to map file
|
||||||
LDFLAGS = -nostartfiles -Wl,-Map=$(OUTDIR)/$(TARGET).map,--cref,--gc-sections
|
LDFLAGS = -nostartfiles -Wl,-Map=$(OUTDIR)/$(TARGET).map,--cref,--gc-sections
|
||||||
ifeq ($(DEBUG),NO)
|
ifeq ($(DEBUG),NO)
|
||||||
LDFLAGS += -Wl,-static -Wl,-s
|
LDFLAGS += -Wl,-static
|
||||||
endif
|
endif
|
||||||
LDFLAGS += $(patsubst %,-L%,$(EXTRA_LIBDIRS))
|
LDFLAGS += $(patsubst %,-L%,$(EXTRA_LIBDIRS))
|
||||||
LDFLAGS += -lc
|
LDFLAGS += -lc
|
||||||
@ -289,13 +287,14 @@ LDFLAGS += $(MATH_LIB)
|
|||||||
LDFLAGS += -lc -lgcc
|
LDFLAGS += -lc -lgcc
|
||||||
|
|
||||||
# Set linker-script name depending on selected submodel name
|
# Set linker-script name depending on selected submodel name
|
||||||
LDFLAGS +=-T$(LINKERSCRIPTPATH)/link_stm32f10x_$(MODEL).ld
|
LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_memory.ld
|
||||||
|
LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_BL_sections.ld
|
||||||
|
|
||||||
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
|
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).bin
|
||||||
# Program
|
# Program
|
||||||
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
|
OOCD_CL+=-c "flash write_image erase $(OOCD_LOADFILE) 0x08000000 bin"
|
||||||
# Verify
|
# Verify
|
||||||
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
|
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE) 0x08000000 bin"
|
||||||
# reset target
|
# reset target
|
||||||
OOCD_CL+=-c "reset run"
|
OOCD_CL+=-c "reset run"
|
||||||
# terminate OOCD after programming
|
# terminate OOCD after programming
|
||||||
@ -339,7 +338,7 @@ endif
|
|||||||
# Program the device.
|
# Program the device.
|
||||||
ifeq ($(FLASH_TOOL),OPENOCD)
|
ifeq ($(FLASH_TOOL),OPENOCD)
|
||||||
# Program the device with Dominic Rath's OPENOCD in "batch-mode", needs cfg and "reset-script".
|
# Program the device with Dominic Rath's OPENOCD in "batch-mode", needs cfg and "reset-script".
|
||||||
program: $(OUTDIR)/$(TARGET).elf
|
program: $(OUTDIR)/$(TARGET).bin
|
||||||
@echo "Programming with OPENOCD"
|
@echo "Programming with OPENOCD"
|
||||||
$(OOCD_EXE) $(OOCD_CL)
|
$(OOCD_EXE) $(OOCD_CL)
|
||||||
endif
|
endif
|
||||||
@ -371,12 +370,15 @@ $(eval $(call PARTIAL_COMPILE_TEMPLATE, SRC))
|
|||||||
# Compile: create assembler files from C source files. ARM only
|
# Compile: create assembler files from C source files. ARM only
|
||||||
$(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM))
|
$(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM))
|
||||||
|
|
||||||
.PHONY: elf lss sym hex bin
|
$(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin
|
||||||
|
|
||||||
|
.PHONY: elf lss sym hex bin bino
|
||||||
elf: $(OUTDIR)/$(TARGET).elf
|
elf: $(OUTDIR)/$(TARGET).elf
|
||||||
lss: $(OUTDIR)/$(TARGET).lss
|
lss: $(OUTDIR)/$(TARGET).lss
|
||||||
sym: $(OUTDIR)/$(TARGET).sym
|
sym: $(OUTDIR)/$(TARGET).sym
|
||||||
hex: $(OUTDIR)/$(TARGET).hex
|
hex: $(OUTDIR)/$(TARGET).hex
|
||||||
bin: $(OUTDIR)/$(TARGET).bin
|
bin: $(OUTDIR)/$(TARGET).bin
|
||||||
|
bino: $(OUTDIR)/$(TARGET).bin.o
|
||||||
|
|
||||||
# Display sizes of sections.
|
# Display sizes of sections.
|
||||||
$(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf))
|
$(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf))
|
||||||
@ -398,6 +400,7 @@ clean_list :
|
|||||||
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).bin
|
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).bin
|
||||||
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).sym
|
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).sym
|
||||||
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).lss
|
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).lss
|
||||||
|
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).bin.o
|
||||||
$(V1) $(REMOVE) $(ALLOBJ)
|
$(V1) $(REMOVE) $(ALLOBJ)
|
||||||
$(V1) $(REMOVE) $(LSTFILES)
|
$(V1) $(REMOVE) $(LSTFILES)
|
||||||
$(V1) $(REMOVE) $(DEPFILES)
|
$(V1) $(REMOVE) $(DEPFILES)
|
||||||
|
@ -22,6 +22,9 @@
|
|||||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
#####
|
#####
|
||||||
|
|
||||||
|
WHEREAMI := $(dir $(lastword $(MAKEFILE_LIST)))
|
||||||
|
TOP := $(realpath $(WHEREAMI)/../../../)
|
||||||
|
include $(TOP)/make/firmware-defs.mk
|
||||||
|
|
||||||
# Set developer code and compile options
|
# Set developer code and compile options
|
||||||
# Set to YES to compile for debugging
|
# Set to YES to compile for debugging
|
||||||
@ -33,12 +36,6 @@ ENABLE_DEBUG_PINS ?= NO
|
|||||||
# Set to Yes to enable the AUX UART which is mapped on the S1 (Tx) and S2 (Rx) servo outputs
|
# Set to Yes to enable the AUX UART which is mapped on the S1 (Tx) and S2 (Rx) servo outputs
|
||||||
ENABLE_AUX_UART ?= NO
|
ENABLE_AUX_UART ?= NO
|
||||||
|
|
||||||
#
|
|
||||||
USE_BOOTLOADER ?= YES
|
|
||||||
|
|
||||||
# Set to the source bootloader binary
|
|
||||||
SOURCE_BL ?= NULL
|
|
||||||
|
|
||||||
# Set to YES when using Code Sourcery toolchain
|
# Set to YES when using Code Sourcery toolchain
|
||||||
CODE_SOURCERY ?= NO
|
CODE_SOURCERY ?= NO
|
||||||
|
|
||||||
@ -54,11 +51,6 @@ endif
|
|||||||
|
|
||||||
FLASH_TOOL = OPENOCD
|
FLASH_TOOL = OPENOCD
|
||||||
|
|
||||||
# YES enables -mthumb option to flags for source-files listed
|
|
||||||
# in SRC and CPPSRC
|
|
||||||
USE_THUMB_MODE = YES
|
|
||||||
|
|
||||||
|
|
||||||
# MCU name, submodel and board
|
# MCU name, submodel and board
|
||||||
# - MCU used for compiler-option (-mcpu)
|
# - MCU used for compiler-option (-mcpu)
|
||||||
# - MODEL used for linker-script name (-T) and passed as define
|
# - MODEL used for linker-script name (-T) and passed as define
|
||||||
@ -68,12 +60,6 @@ CHIP = STM32F103CBT
|
|||||||
BOARD ?= NULL
|
BOARD ?= NULL
|
||||||
MODEL ?= NULL
|
MODEL ?= NULL
|
||||||
|
|
||||||
ifeq ($(USE_BOOTLOADER), YES)
|
|
||||||
BOOT_MODEL = $(MODEL)_BL
|
|
||||||
else
|
|
||||||
BOOT_MODEL = $(MODEL)_NB
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.)
|
# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.)
|
||||||
OUTDIR = ../../../build/bootloaders/BootloaderUpdater
|
OUTDIR = ../../../build/bootloaders/BootloaderUpdater
|
||||||
|
|
||||||
@ -160,7 +146,7 @@ CPPSRCARM =
|
|||||||
# Even though the DOS/Win* filesystem matches both .s and .S the same,
|
# Even though the DOS/Win* filesystem matches both .s and .S the same,
|
||||||
# it will preserve the spelling of the filenames, and gcc itself does
|
# it will preserve the spelling of the filenames, and gcc itself does
|
||||||
# care about how the name is spelled on its command-line.
|
# care about how the name is spelled on its command-line.
|
||||||
ASRC = $(PIOSSTM32F10X)/startup_stm32f10x_$(MODEL).S
|
ASRC = $(PIOSSTM32F10X)/startup_stm32f10x_$(MODEL)$(MODEL_SUFFIX).S
|
||||||
|
|
||||||
# List Assembler source files here which must be assembled in ARM-Mode..
|
# List Assembler source files here which must be assembled in ARM-Mode..
|
||||||
ASRCARM =
|
ASRCARM =
|
||||||
@ -238,10 +224,7 @@ endif
|
|||||||
ifeq ($(ENABLE_AUX_UART), YES)
|
ifeq ($(ENABLE_AUX_UART), YES)
|
||||||
CDEFS += -DPIOS_ENABLE_AUX_UART
|
CDEFS += -DPIOS_ENABLE_AUX_UART
|
||||||
endif
|
endif
|
||||||
ifeq ($(USE_BOOTLOADER), YES)
|
|
||||||
CDEFS += -DUSE_BOOTLOADER
|
CDEFS += -DUSE_BOOTLOADER
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
# Place project-specific -D and/or -U options for
|
# Place project-specific -D and/or -U options for
|
||||||
# Assembler with preprocessor here.
|
# Assembler with preprocessor here.
|
||||||
@ -269,9 +252,10 @@ CSTANDARD = -std=gnu99
|
|||||||
# Flags for C and C++ (arm-elf-gcc/arm-elf-g++)
|
# Flags for C and C++ (arm-elf-gcc/arm-elf-g++)
|
||||||
|
|
||||||
ifeq ($(DEBUG),YES)
|
ifeq ($(DEBUG),YES)
|
||||||
CFLAGS = -g$(DEBUGF) -DDEBUG
|
CFLAGS = -DDEBUG
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
CFLAGS += -g$(DEBUGF)
|
||||||
CFLAGS += -O$(OPT)
|
CFLAGS += -O$(OPT)
|
||||||
ifeq ($(DEBUG),NO)
|
ifeq ($(DEBUG),NO)
|
||||||
CFLAGS += -ffunction-sections
|
CFLAGS += -ffunction-sections
|
||||||
@ -311,7 +295,7 @@ MATH_LIB = -lm
|
|||||||
# --cref: add cross reference to map file
|
# --cref: add cross reference to map file
|
||||||
LDFLAGS = -nostartfiles -Wl,-Map=$(OUTDIR)/$(TARGET).map,--cref,--gc-sections
|
LDFLAGS = -nostartfiles -Wl,-Map=$(OUTDIR)/$(TARGET).map,--cref,--gc-sections
|
||||||
ifeq ($(DEBUG),NO)
|
ifeq ($(DEBUG),NO)
|
||||||
LDFLAGS += -Wl,-static -Wl,-s
|
LDFLAGS += -Wl,-static
|
||||||
endif
|
endif
|
||||||
LDFLAGS += $(patsubst %,-L%,$(EXTRA_LIBDIRS))
|
LDFLAGS += $(patsubst %,-L%,$(EXTRA_LIBDIRS))
|
||||||
LDFLAGS += -lc
|
LDFLAGS += -lc
|
||||||
@ -320,63 +304,26 @@ LDFLAGS += $(MATH_LIB)
|
|||||||
LDFLAGS += -lc -lgcc
|
LDFLAGS += -lc -lgcc
|
||||||
|
|
||||||
# Set linker-script name depending on selected submodel name
|
# Set linker-script name depending on selected submodel name
|
||||||
LDFLAGS +=-T$(LINKERSCRIPTPATH)/link_$(BOARD)_$(BOOT_MODEL).ld
|
LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_memory.ld
|
||||||
|
LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_sections.ld
|
||||||
|
|
||||||
# Test if quotes are needed for the echo-command
|
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).bin
|
||||||
result = ${shell echo "test"}
|
|
||||||
ifeq (${result}, test)
|
|
||||||
quote = '
|
|
||||||
else
|
|
||||||
quote =
|
|
||||||
endif
|
|
||||||
|
|
||||||
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
|
|
||||||
# Program
|
# Program
|
||||||
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
|
OOCD_CL+=-c "flash write_image erase $(OOCD_LOADFILE) 0x08003000 bin"
|
||||||
# Verify
|
# Verify
|
||||||
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
|
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE) 0x08003000 bin"
|
||||||
# reset target
|
# reset target
|
||||||
OOCD_CL+=-c "reset run"
|
OOCD_CL+=-c "reset run"
|
||||||
# terminate OOCD after programming
|
# terminate OOCD after programming
|
||||||
OOCD_CL+=-c shutdown
|
OOCD_CL+=-c shutdown
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
# Define programs and commands.
|
# Define programs and commands.
|
||||||
CC = $(TCHAIN_PREFIX)gcc
|
|
||||||
CPP = $(TCHAIN_PREFIX)g++
|
|
||||||
AR = $(TCHAIN_PREFIX)ar
|
|
||||||
OBJCOPY = $(TCHAIN_PREFIX)objcopy
|
|
||||||
OBJDUMP = $(TCHAIN_PREFIX)objdump
|
|
||||||
SIZE = $(TCHAIN_PREFIX)size
|
|
||||||
NM = $(TCHAIN_PREFIX)nm
|
|
||||||
REMOVE = $(REMOVE_CMD) -f
|
REMOVE = $(REMOVE_CMD) -f
|
||||||
###SHELL = sh
|
###SHELL = sh
|
||||||
###COPY = cp
|
###COPY = cp
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Define Messages
|
|
||||||
# English
|
|
||||||
MSG_ERRORS_NONE = Errors: none
|
|
||||||
MSG_BEGIN = ${quote}-------- begin (mode: $(RUN_MODE)) --------${quote}
|
|
||||||
MSG_END = ${quote}-------- end --------${quote}
|
|
||||||
MSG_MODINIT = ${quote}**** Generating ModInit.c${quote}
|
|
||||||
MSG_SIZE_BEFORE = ${quote}Size before:${quote}
|
|
||||||
MSG_SIZE_AFTER = ${quote}Size after build:${quote}
|
|
||||||
MSG_LOAD_FILE = ${quote}Creating load file:${quote}
|
|
||||||
MSG_EXTENDED_LISTING = ${quote}Creating Extended Listing/Disassembly:${quote}
|
|
||||||
MSG_SYMBOL_TABLE = ${quote}Creating Symbol Table:${quote}
|
|
||||||
MSG_LINKING = ${quote}**** Linking :${quote}
|
|
||||||
MSG_COMPILING = ${quote}**** Compiling C :${quote}
|
|
||||||
MSG_COMPILING_ARM = ${quote}**** Compiling C (ARM-only):${quote}
|
|
||||||
MSG_COMPILINGCPP = ${quote}Compiling C++ :${quote}
|
|
||||||
MSG_COMPILINGCPP_ARM = ${quote}Compiling C++ (ARM-only):${quote}
|
|
||||||
MSG_ASSEMBLING = ${quote}**** Assembling:${quote}
|
|
||||||
MSG_ASSEMBLING_ARM = ${quote}****Assembling (ARM-only):${quote}
|
|
||||||
MSG_CLEANING = ${quote}Cleaning project:${quote}
|
|
||||||
MSG_FORMATERROR = ${quote}Can not handle output-format${quote}
|
|
||||||
MSG_ASMFROMC = ${quote}Creating asm-File from C-Source:${quote}
|
|
||||||
MSG_ASMFROMC_ARM = ${quote}Creating asm-File from C-Source (ARM-only):${quote}
|
|
||||||
|
|
||||||
# List of all source files.
|
# List of all source files.
|
||||||
ALLSRC = $(ASRCARM) $(ASRC) $(SRCARM) $(SRC) $(CPPSRCARM) $(CPPSRC)
|
ALLSRC = $(ASRCARM) $(ASRC) $(SRCARM) $(SRC) $(CPPSRCARM) $(CPPSRC)
|
||||||
# List of all source files without directory and file-extension.
|
# List of all source files without directory and file-extension.
|
||||||
@ -392,14 +339,7 @@ DEPFILES = $(addprefix $(OUTDIR)/dep/, $(addsuffix .o.d, $(ALLSRCBASE)))
|
|||||||
|
|
||||||
|
|
||||||
# Default target.
|
# Default target.
|
||||||
#all: begin gccversion sizebefore build sizeafter finished end
|
all: build
|
||||||
all: begin gccversion build sizeafter finished end
|
|
||||||
|
|
||||||
elf: $(OUTDIR)/$(TARGET).elf
|
|
||||||
lss: $(OUTDIR)/$(TARGET).lss
|
|
||||||
sym: $(OUTDIR)/$(TARGET).sym
|
|
||||||
hex: $(OUTDIR)/$(TARGET).hex
|
|
||||||
bin: $(OUTDIR)/$(TARGET).bin
|
|
||||||
|
|
||||||
ifeq ($(LOADFORMAT),ihex)
|
ifeq ($(LOADFORMAT),ihex)
|
||||||
build: elf hex sym
|
build: elf hex sym
|
||||||
@ -415,161 +355,56 @@ endif
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Eye candy.
|
|
||||||
begin:
|
|
||||||
## @echo
|
|
||||||
@echo $(MSG_BEGIN)
|
|
||||||
ifeq ($(SOURCE_BL), NULL)
|
|
||||||
@echo ${quote}Please specify the source bootloader binary with SOURCE_BL=source_name${quote}
|
|
||||||
@exit 2
|
|
||||||
endif
|
|
||||||
ifeq ($(BOARD), NULL)
|
|
||||||
@echo ${quote}Please specify the board name with BOARD=board_name (STM3210E_OP,STM32103CB_AHRS,STM32103CB_PIPXTREME,STM32103CB_CC_Rev1)${quote}
|
|
||||||
@exit 2
|
|
||||||
endif
|
|
||||||
ifeq ($(MODEL), NULL)
|
|
||||||
@echo ${quote}Please specify the chip model with MODEL=MD/HD${quote}
|
|
||||||
@exit 2
|
|
||||||
endif
|
|
||||||
python file_to_array.py $(SOURCE_BL) bl_array.h
|
|
||||||
#UNAME := $(shell python file_to_array.py $(SOURCE_BL) bl_array.h)
|
|
||||||
|
|
||||||
|
|
||||||
###########################################################################################################
|
|
||||||
|
|
||||||
finished:
|
|
||||||
## @echo $(MSG_ERRORS_NONE)
|
|
||||||
|
|
||||||
end:
|
|
||||||
@echo $(MSG_END)
|
|
||||||
## @echo
|
|
||||||
|
|
||||||
# Display sizes of sections.
|
|
||||||
ELFSIZE = $(SIZE) -A $(OUTDIR)/$(TARGET).elf
|
|
||||||
|
|
||||||
sizebefore:
|
|
||||||
# @if [ -f $(OUTDIR)/$(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); echo; fi
|
|
||||||
|
|
||||||
sizeafter:
|
|
||||||
# @if [ -f $(OUTDIR)/$(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi
|
|
||||||
@echo $(MSG_SIZE_AFTER)
|
|
||||||
$(ELFSIZE)
|
|
||||||
|
|
||||||
# Display compiler version information.
|
|
||||||
gccversion :
|
|
||||||
@$(CC) --version
|
|
||||||
# @echo $(ALLOBJ)
|
|
||||||
|
|
||||||
# Program the device.
|
# Program the device.
|
||||||
ifeq ($(FLASH_TOOL),OPENOCD)
|
ifeq ($(FLASH_TOOL),OPENOCD)
|
||||||
# Program the device with Dominic Rath's OPENOCD in "batch-mode", needs cfg and "reset-script".
|
# Program the device with Dominic Rath's OPENOCD in "batch-mode", needs cfg and "reset-script".
|
||||||
program: $(OUTDIR)/$(TARGET).elf
|
program: $(OUTDIR)/$(TARGET).bin
|
||||||
@echo ${quote}Programming with OPENOCD${quote}
|
@echo ${quote}Programming with OPENOCD${quote}
|
||||||
$(OOCD_EXE) $(OOCD_CL)
|
$(OOCD_EXE) $(OOCD_CL)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Create final output file (.hex) from ELF output file.
|
|
||||||
%.hex: %.elf
|
|
||||||
## @echo
|
|
||||||
@echo $(MSG_LOAD_FILE) $@
|
|
||||||
$(OBJCOPY) -O ihex $< $@
|
|
||||||
|
|
||||||
# Create final output file (.bin) from ELF output file.
|
|
||||||
%.bin: %.elf
|
|
||||||
## @echo
|
|
||||||
@echo $(MSG_LOAD_FILE) $@
|
|
||||||
$(OBJCOPY) -O binary $< $@
|
|
||||||
|
|
||||||
# Create extended listing file/disassambly from ELF output file.
|
|
||||||
# using objdump testing: option -C
|
|
||||||
%.lss: %.elf
|
|
||||||
## @echo
|
|
||||||
@echo $(MSG_EXTENDED_LISTING) $@
|
|
||||||
$(OBJDUMP) -h -S -C -r $< > $@
|
|
||||||
# $(OBJDUMP) -x -S $< > $@
|
|
||||||
|
|
||||||
# Create a symbol table from ELF output file.
|
|
||||||
%.sym: %.elf
|
|
||||||
## @echo
|
|
||||||
@echo $(MSG_SYMBOL_TABLE) $@
|
|
||||||
$(NM) -n $< > $@
|
|
||||||
|
|
||||||
# Link: create ELF output file from object files.
|
# Link: create ELF output file from object files.
|
||||||
.SECONDARY : $(TARGET).elf
|
$(eval $(call LINK_TEMPLATE, $(OUTDIR)/$(TARGET).elf, $(ALLOBJ) $(BLOBJ)))
|
||||||
.PRECIOUS : $(ALLOBJ)
|
|
||||||
%.elf: $(ALLOBJ)
|
|
||||||
@echo $(MSG_LINKING) $@
|
|
||||||
# use $(CC) for C-only projects or $(CPP) for C++-projects:
|
|
||||||
$(CC) $(THUMB) $(CFLAGS) $(ALLOBJ) --output $@ $(LDFLAGS)
|
|
||||||
# $(CPP) $(THUMB) $(CFLAGS) $(ALLOBJ) --output $@ $(LDFLAGS)
|
|
||||||
|
|
||||||
|
|
||||||
# Assemble: create object files from assembler source files.
|
# Assemble: create object files from assembler source files.
|
||||||
define ASSEMBLE_TEMPLATE
|
|
||||||
$(OUTDIR)/$(notdir $(basename $(1))).o : $(1)
|
|
||||||
## @echo
|
|
||||||
@echo $(MSG_ASSEMBLING) $$< to $$@
|
|
||||||
$(CC) -c $(THUMB) $$(ASFLAGS) $$< -o $$@
|
|
||||||
endef
|
|
||||||
$(foreach src, $(ASRC), $(eval $(call ASSEMBLE_TEMPLATE, $(src))))
|
$(foreach src, $(ASRC), $(eval $(call ASSEMBLE_TEMPLATE, $(src))))
|
||||||
|
|
||||||
# Assemble: create object files from assembler source files. ARM-only
|
# Assemble: create object files from assembler source files. ARM-only
|
||||||
define ASSEMBLE_ARM_TEMPLATE
|
|
||||||
$(OUTDIR)/$(notdir $(basename $(1))).o : $(1)
|
|
||||||
## @echo
|
|
||||||
@echo $(MSG_ASSEMBLING_ARM) $$< to $$@
|
|
||||||
$(CC) -c $$(ASFLAGS) $$< -o $$@
|
|
||||||
endef
|
|
||||||
$(foreach src, $(ASRCARM), $(eval $(call ASSEMBLE_ARM_TEMPLATE, $(src))))
|
$(foreach src, $(ASRCARM), $(eval $(call ASSEMBLE_ARM_TEMPLATE, $(src))))
|
||||||
|
|
||||||
|
|
||||||
# Compile: create object files from C source files.
|
# Compile: create object files from C source files.
|
||||||
define COMPILE_C_TEMPLATE
|
|
||||||
$(OUTDIR)/$(notdir $(basename $(1))).o : $(1)
|
|
||||||
## @echo
|
|
||||||
@echo $(MSG_COMPILING) $$< to $$@
|
|
||||||
$(CC) -c $(THUMB) $$(CFLAGS) $$(CONLYFLAGS) $$< -o $$@
|
|
||||||
endef
|
|
||||||
$(foreach src, $(SRC), $(eval $(call COMPILE_C_TEMPLATE, $(src))))
|
$(foreach src, $(SRC), $(eval $(call COMPILE_C_TEMPLATE, $(src))))
|
||||||
|
|
||||||
# Compile: create object files from C source files. ARM-only
|
# Compile: create object files from C source files. ARM-only
|
||||||
define COMPILE_C_ARM_TEMPLATE
|
|
||||||
$(OUTDIR)/$(notdir $(basename $(1))).o : $(1)
|
|
||||||
## @echo
|
|
||||||
@echo $(MSG_COMPILING_ARM) $$< to $$@
|
|
||||||
$(CC) -c $$(CFLAGS) $$(CONLYFLAGS) $$< -o $$@
|
|
||||||
endef
|
|
||||||
$(foreach src, $(SRCARM), $(eval $(call COMPILE_C_ARM_TEMPLATE, $(src))))
|
$(foreach src, $(SRCARM), $(eval $(call COMPILE_C_ARM_TEMPLATE, $(src))))
|
||||||
|
|
||||||
|
|
||||||
# Compile: create object files from C++ source files.
|
# Compile: create object files from C++ source files.
|
||||||
define COMPILE_CPP_TEMPLATE
|
|
||||||
$(OUTDIR)/$(notdir $(basename $(1))).o : $(1)
|
|
||||||
## @echo
|
|
||||||
@echo $(MSG_COMPILINGCPP) $$< to $$@
|
|
||||||
$(CC) -c $(THUMB) $$(CFLAGS) $$(CPPFLAGS) $$< -o $$@
|
|
||||||
endef
|
|
||||||
$(foreach src, $(CPPSRC), $(eval $(call COMPILE_CPP_TEMPLATE, $(src))))
|
$(foreach src, $(CPPSRC), $(eval $(call COMPILE_CPP_TEMPLATE, $(src))))
|
||||||
|
|
||||||
# Compile: create object files from C++ source files. ARM-only
|
# Compile: create object files from C++ source files. ARM-only
|
||||||
define COMPILE_CPP_ARM_TEMPLATE
|
|
||||||
$(OUTDIR)/$(notdir $(basename $(1))).o : $(1)
|
|
||||||
## @echo
|
|
||||||
@echo $(MSG_COMPILINGCPP_ARM) $$< to $$@
|
|
||||||
$(CC) -c $$(CFLAGS) $$(CPPFLAGS) $$< -o $$@
|
|
||||||
endef
|
|
||||||
$(foreach src, $(CPPSRCARM), $(eval $(call COMPILE_CPP_ARM_TEMPLATE, $(src))))
|
$(foreach src, $(CPPSRCARM), $(eval $(call COMPILE_CPP_ARM_TEMPLATE, $(src))))
|
||||||
|
|
||||||
|
|
||||||
# Compile: create assembler files from C source files. ARM/Thumb
|
# Compile: create assembler files from C source files. ARM/Thumb
|
||||||
$(SRC:.c=.s) : %.s : %.c
|
$(eval $(call PARTIAL_COMPILE_TEMPLATE, SRC))
|
||||||
@echo $(MSG_ASMFROMC) $< to $@
|
|
||||||
$(CC) $(THUMB) -S $(CFLAGS) $(CONLYFLAGS) $< -o $@
|
|
||||||
|
|
||||||
# Compile: create assembler files from C source files. ARM only
|
# Compile: create assembler files from C source files. ARM only
|
||||||
$(SRCARM:.c=.s) : %.s : %.c
|
$(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM))
|
||||||
@echo $(MSG_ASMFROMC_ARM) $< to $@
|
|
||||||
$(CC) -S $(CFLAGS) $(CONLYFLAGS) $< -o $@
|
$(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin
|
||||||
|
|
||||||
|
.PHONY: elf lss sym hex bin bino
|
||||||
|
elf: $(OUTDIR)/$(TARGET).elf
|
||||||
|
elf.stripped: $(OUTDIR)/$(TARGET).elf.stripped
|
||||||
|
lss: $(OUTDIR)/$(TARGET).lss
|
||||||
|
sym: $(OUTDIR)/$(TARGET).sym
|
||||||
|
hex: $(OUTDIR)/$(TARGET).hex
|
||||||
|
bin: $(OUTDIR)/$(TARGET).bin
|
||||||
|
bino: $(OUTDIR)/$(TARGET).bin.o
|
||||||
|
|
||||||
|
# Display sizes of sections.
|
||||||
|
$(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf))
|
||||||
|
.PHONY: size
|
||||||
|
size: $(OUTDIR)/$(TARGET).elf_size
|
||||||
|
|
||||||
# Generate Doxygen documents
|
# Generate Doxygen documents
|
||||||
docs:
|
docs:
|
||||||
@ -579,21 +414,21 @@ docs:
|
|||||||
clean: begin clean_list finished end
|
clean: begin clean_list finished end
|
||||||
|
|
||||||
clean_list :
|
clean_list :
|
||||||
## @echo
|
|
||||||
@echo $(MSG_CLEANING)
|
@echo $(MSG_CLEANING)
|
||||||
$(REMOVE) $(OUTDIR)/$(TARGET).map
|
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).map
|
||||||
$(REMOVE) $(OUTDIR)/$(TARGET).elf
|
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).elf
|
||||||
$(REMOVE) $(OUTDIR)/$(TARGET).hex
|
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).hex
|
||||||
$(REMOVE) $(OUTDIR)/$(TARGET).bin
|
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).bin
|
||||||
$(REMOVE) $(OUTDIR)/$(TARGET).sym
|
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).sym
|
||||||
$(REMOVE) $(OUTDIR)/$(TARGET).lss
|
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).lss
|
||||||
$(REMOVE) $(ALLOBJ)
|
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).bin.o
|
||||||
$(REMOVE) $(LSTFILES)
|
$(V1) $(REMOVE) $(ALLOBJ)
|
||||||
$(REMOVE) $(DEPFILES)
|
$(V1) $(REMOVE) $(LSTFILES)
|
||||||
$(REMOVE) $(SRC:.c=.s)
|
$(V1) $(REMOVE) $(DEPFILES)
|
||||||
$(REMOVE) $(SRCARM:.c=.s)
|
$(V1) $(REMOVE) $(SRC:.c=.s)
|
||||||
$(REMOVE) $(CPPSRC:.cpp=.s)
|
$(V1) $(REMOVE) $(SRCARM:.c=.s)
|
||||||
$(REMOVE) $(CPPSRCARM:.cpp=.s)
|
$(V1) $(REMOVE) $(CPPSRC:.cpp=.s)
|
||||||
|
$(V1) $(REMOVE) $(CPPSRCARM:.cpp=.s)
|
||||||
|
|
||||||
|
|
||||||
# Create output files directory
|
# Create output files directory
|
||||||
@ -611,9 +446,5 @@ else
|
|||||||
-include $(shell mkdir -p $(OUTDIR) 2>/dev/null) $(shell mkdir $(OUTDIR)/dep 2>/dev/null) $(wildcard $(OUTDIR)/dep/*)
|
-include $(shell mkdir -p $(OUTDIR) 2>/dev/null) $(shell mkdir $(OUTDIR)/dep 2>/dev/null) $(wildcard $(OUTDIR)/dep/*)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Listing of phony targets.
|
# Listing of phony targets.
|
||||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
|
.PHONY : all build clean clean_list program
|
||||||
build elf hex bin lss sym clean clean_list program
|
|
||||||
|
|
||||||
|
@ -1,105 +0,0 @@
|
|||||||
# Convert binary file to a hex encoded array for inclusion in C projects
|
|
||||||
|
|
||||||
import os
|
|
||||||
import struct
|
|
||||||
import sys
|
|
||||||
import logging
|
|
||||||
|
|
||||||
class BinToArray:
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def ConvertFileToArray(self, strInFile, strOutFile, integerSize, ignoreBytes, endianNess):
|
|
||||||
""" Reads binary file at location strInFile and writes out a C array of hex values
|
|
||||||
Parameters -
|
|
||||||
strInFile - Path and filename of binary file to convert
|
|
||||||
strOutFile - Path and filename of output. Suggested extension is .c or .cpp
|
|
||||||
integerSize - Size in bytes of output array elements. Array generated is always
|
|
||||||
of type uint8, uint16, uint32. These types would need to be defined using
|
|
||||||
typedef if they don't exist, or the user can replace the type name with the
|
|
||||||
appropriate keyword valid for the compiler size conventions
|
|
||||||
ignoreBytes - Number of bytes to ignore at the beginning of binary file. Helps
|
|
||||||
strip out file headers and only encode the payload/data.
|
|
||||||
endianNess - Only used for integerSize of 2 or 4. 'l' for Little Endian, 'b' for
|
|
||||||
Big Endian
|
|
||||||
"""
|
|
||||||
# Check integerSize value
|
|
||||||
if integerSize not in (1, 2, 4):
|
|
||||||
logging.debug("Integer Size parameter must be 1, 2 or 4")
|
|
||||||
return
|
|
||||||
# endif
|
|
||||||
# Open input file
|
|
||||||
try:
|
|
||||||
fileIn = open(strInFile, 'rb')
|
|
||||||
except IOError, err:
|
|
||||||
logging.debug("Could not open input file %s" % (strInFile))
|
|
||||||
return
|
|
||||||
# end try
|
|
||||||
# Open input file
|
|
||||||
try:
|
|
||||||
fileOut = open(strOutFile, 'w')
|
|
||||||
except IOError, err:
|
|
||||||
logging.debug("Could not open output file %s" % (strOutFile))
|
|
||||||
return
|
|
||||||
# end try
|
|
||||||
# Start array definition preamble
|
|
||||||
inFileName = os.path.basename(strInFile)
|
|
||||||
strVarType = "uint%d_t" % (integerSize * 8)
|
|
||||||
fileOut.write("// Array representation of binary file %s\n\n\n" % (inFileName))
|
|
||||||
fileOut.write("static %s dataArray[] = {\n" % strVarType)
|
|
||||||
# Convert and write array into C file
|
|
||||||
fileIn.seek(ignoreBytes)
|
|
||||||
if integerSize == 1:
|
|
||||||
bufChunk = fileIn.read(20)
|
|
||||||
while bufChunk != '':
|
|
||||||
fileOut.write(" ")
|
|
||||||
for byteVal in bufChunk:
|
|
||||||
fileOut.write("0x%02x, " % ord(byteVal))
|
|
||||||
# end for
|
|
||||||
fileOut.write("\n")
|
|
||||||
bufChunk = fileIn.read(20)
|
|
||||||
# end while
|
|
||||||
else:
|
|
||||||
if endianNess == 'l' and integerSize == 2:
|
|
||||||
endianFormatter = '<H'
|
|
||||||
maxWordsPerLine = 10
|
|
||||||
elif endianNess == 'l' and integerSize == 4:
|
|
||||||
endianFormatter = '<L'
|
|
||||||
maxWordsPerLine = 6
|
|
||||||
elif endianNess == 'b' and integerSize == 2:
|
|
||||||
endianFormatter = '>H'
|
|
||||||
maxWordsPerLine = 10
|
|
||||||
elif endianNess == 'b' and integerSize == 4:
|
|
||||||
endianFormatter = '>L'
|
|
||||||
maxWordsPerLine = 6
|
|
||||||
# endif
|
|
||||||
bufChunk = fileIn.read(integerSize)
|
|
||||||
i = 0
|
|
||||||
fileOut.write(" ")
|
|
||||||
while bufChunk != '':
|
|
||||||
wordVal = struct.unpack(endianFormatter, bufChunk)
|
|
||||||
if integerSize == 2:
|
|
||||||
fileOut.write("0x%04x, " % wordVal)
|
|
||||||
else:
|
|
||||||
fileOut.write("0x%08x, " % wordVal)
|
|
||||||
# endif
|
|
||||||
i += 1
|
|
||||||
if i == maxWordsPerLine:
|
|
||||||
fileOut.write("\n ")
|
|
||||||
i = 0
|
|
||||||
# endif
|
|
||||||
bufChunk = fileIn.read(integerSize)
|
|
||||||
# end while
|
|
||||||
# end if
|
|
||||||
# Close array definition
|
|
||||||
fileOut.write("\n };\n")
|
|
||||||
fileIn.close()
|
|
||||||
fileOut.close()
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
print(sys.argv[0])
|
|
||||||
logging.basicConfig(level=logging.DEBUG)
|
|
||||||
converter = BinToArray()
|
|
||||||
converter.ConvertFileToArray(
|
|
||||||
sys.argv[1], sys.argv[2], 4, 0, 'l')
|
|
||||||
|
|
@ -27,13 +27,25 @@
|
|||||||
*/
|
*/
|
||||||
/* Bootloader Includes */
|
/* Bootloader Includes */
|
||||||
#include <pios.h>
|
#include <pios.h>
|
||||||
#include <bl_array.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#define MAX_WRI_RETRYS 3
|
#define MAX_WRI_RETRYS 3
|
||||||
/* Prototype of PIOS_Board_Init() function */
|
/* Prototype of PIOS_Board_Init() function */
|
||||||
extern void PIOS_Board_Init(void);
|
extern void PIOS_Board_Init(void);
|
||||||
extern void FLASH_Download();
|
extern void FLASH_Download();
|
||||||
void error(int);
|
void error(int);
|
||||||
|
|
||||||
|
/* The ADDRESSES of the _binary_* symbols are the important
|
||||||
|
* data. This is non-intuitive for _binary_size where you
|
||||||
|
* might expect its value to hold the size but you'd be wrong.
|
||||||
|
*/
|
||||||
|
extern void _binary_start;
|
||||||
|
extern void _binary_end;
|
||||||
|
extern void _binary_size;
|
||||||
|
const uint32_t * embedded_image_start = (uint32_t *) &(_binary_start);
|
||||||
|
const uint32_t * embedded_image_end = (uint32_t *) &(_binary_end);
|
||||||
|
const uint32_t embedded_image_size = (uint32_t) &(_binary_size);
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
|
|
||||||
PIOS_SYS_Init();
|
PIOS_SYS_Init();
|
||||||
@ -43,63 +55,70 @@ int main() {
|
|||||||
PIOS_LED_Off(LED1);
|
PIOS_LED_Off(LED1);
|
||||||
|
|
||||||
/// Self overwrite check
|
/// Self overwrite check
|
||||||
uint32_t base_adress = SCB->VTOR;
|
uint32_t base_address = SCB->VTOR;
|
||||||
if (0x08000000 + (sizeof(dataArray)) > base_adress)
|
if ((0x08000000 + embedded_image_size) > base_address)
|
||||||
error(LED1);
|
error(LED1);
|
||||||
///
|
///
|
||||||
FLASH_Unlock();
|
FLASH_Unlock();
|
||||||
|
|
||||||
/// Bootloader memory space erase
|
/// Bootloader memory space erase
|
||||||
uint32_t pageAdress;
|
uint32_t pageAddress;
|
||||||
pageAdress = 0x08000000;
|
pageAddress = 0x08000000;
|
||||||
uint8_t fail = FALSE;
|
bool fail = false;
|
||||||
while ((pageAdress < base_adress) || (fail == TRUE)) {
|
while ((pageAddress < base_address) && (fail == false)) {
|
||||||
for (int retry = 0; retry < MAX_DEL_RETRYS; ++retry) {
|
for (int retry = 0; retry < MAX_DEL_RETRYS; ++retry) {
|
||||||
if (FLASH_ErasePage(pageAdress) == FLASH_COMPLETE) {
|
if (FLASH_ErasePage(pageAddress) == FLASH_COMPLETE) {
|
||||||
fail = FALSE;
|
fail = false;
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
fail = TRUE;
|
fail = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef STM32F10X_HD
|
#ifdef STM32F10X_HD
|
||||||
pageAdress += 2048;
|
pageAddress += 2048;
|
||||||
#elif defined (STM32F10X_MD)
|
#elif defined (STM32F10X_MD)
|
||||||
pageAdress += 1024;
|
pageAddress += 1024;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fail == TRUE)
|
if (fail == true)
|
||||||
error(LED1);
|
error(LED1);
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
|
|
||||||
/// Bootloader programing
|
/// Bootloader programing
|
||||||
for (int x = 0; x < sizeof(dataArray)/sizeof(uint32_t); ++x) {
|
for (uint32_t offset = 0; offset < embedded_image_size/sizeof(uint32_t); ++offset) {
|
||||||
int result = 0;
|
bool result = false;
|
||||||
PIOS_LED_Toggle(LED1);
|
PIOS_LED_Toggle(LED1);
|
||||||
for (int retry = 0; retry < MAX_WRI_RETRYS; ++retry) {
|
for (uint8_t retry = 0; retry < MAX_WRI_RETRYS; ++retry) {
|
||||||
if (result == 0) {
|
if (result == false) {
|
||||||
result = (FLASH_ProgramWord(0x08000000 + (x * 4), dataArray[x])
|
result = (FLASH_ProgramWord(0x08000000 + (offset * 4), embedded_image_start[offset])
|
||||||
== FLASH_COMPLETE) ? 1 : 0;
|
== FLASH_COMPLETE) ? true : false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (result == 0)
|
if (result == false)
|
||||||
error(LED1);
|
error(LED1);
|
||||||
}
|
}
|
||||||
///
|
///
|
||||||
for (int x=0;x<3;++x) {
|
for (uint8_t x = 0; x < 3; ++x) {
|
||||||
PIOS_LED_On(LED1);
|
PIOS_LED_On(LED1);
|
||||||
PIOS_DELAY_WaitmS(1000);
|
PIOS_DELAY_WaitmS(1000);
|
||||||
PIOS_LED_Off(LED1);
|
PIOS_LED_Off(LED1);
|
||||||
PIOS_DELAY_WaitmS(1000);
|
PIOS_DELAY_WaitmS(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Invalidate the bootloader updater so we won't run
|
||||||
|
/// the update again on the next power cycle.
|
||||||
|
FLASH_ProgramWord(base_address, 0);
|
||||||
|
FLASH_Lock();
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
PIOS_DELAY_WaitmS(1000);
|
PIOS_DELAY_WaitmS(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void error(int led) {
|
void error(int led) {
|
||||||
for (;;) {
|
for (;;) {
|
||||||
PIOS_LED_On(led);
|
PIOS_LED_On(led);
|
||||||
|
@ -36,10 +36,6 @@ ENABLE_DEBUG_PINS ?= NO
|
|||||||
# Set to Yes to enable the AUX UART which is mapped on the S1 (Tx) and S2 (Rx) servo outputs
|
# Set to Yes to enable the AUX UART which is mapped on the S1 (Tx) and S2 (Rx) servo outputs
|
||||||
ENABLE_AUX_UART ?= NO
|
ENABLE_AUX_UART ?= NO
|
||||||
|
|
||||||
#
|
|
||||||
override USE_BOOTLOADER = NO
|
|
||||||
|
|
||||||
|
|
||||||
# Set to YES when using Code Sourcery toolchain
|
# Set to YES when using Code Sourcery toolchain
|
||||||
CODE_SOURCERY ?= NO
|
CODE_SOURCERY ?= NO
|
||||||
|
|
||||||
@ -60,12 +56,6 @@ MCU = cortex-m3
|
|||||||
CHIP = STM32F103CBT
|
CHIP = STM32F103CBT
|
||||||
BOARD = STM32103CB_CC_Rev1
|
BOARD = STM32103CB_CC_Rev1
|
||||||
MODEL = MD
|
MODEL = MD
|
||||||
ifeq ($(USE_BOOTLOADER), YES)
|
|
||||||
BOOT_MODEL = $(MODEL)_BL
|
|
||||||
|
|
||||||
else
|
|
||||||
BOOT_MODEL = $(MODEL)_NB
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.)
|
# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.)
|
||||||
OUTDIR = $(TOP)/build/bl_coptercontrol
|
OUTDIR = $(TOP)/build/bl_coptercontrol
|
||||||
@ -268,10 +258,6 @@ endif
|
|||||||
ifeq ($(ENABLE_AUX_UART), YES)
|
ifeq ($(ENABLE_AUX_UART), YES)
|
||||||
CDEFS += -DPIOS_ENABLE_AUX_UART
|
CDEFS += -DPIOS_ENABLE_AUX_UART
|
||||||
endif
|
endif
|
||||||
ifeq ($(USE_BOOTLOADER), YES)
|
|
||||||
CDEFS += -DUSE_BOOTLOADER
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
# Place project-specific -D and/or -U options for
|
# Place project-specific -D and/or -U options for
|
||||||
# Assembler with preprocessor here.
|
# Assembler with preprocessor here.
|
||||||
@ -299,9 +285,10 @@ CSTANDARD = -std=gnu99
|
|||||||
# Flags for C and C++ (arm-elf-gcc/arm-elf-g++)
|
# Flags for C and C++ (arm-elf-gcc/arm-elf-g++)
|
||||||
|
|
||||||
ifeq ($(DEBUG),YES)
|
ifeq ($(DEBUG),YES)
|
||||||
CFLAGS = -g$(DEBUGF) -DDEBUG
|
CFLAGS += -DDEBUG
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
CFLAGS += -g$(DEBUGF)
|
||||||
CFLAGS += -O$(OPT)
|
CFLAGS += -O$(OPT)
|
||||||
ifeq ($(DEBUG),NO)
|
ifeq ($(DEBUG),NO)
|
||||||
CFLAGS += -ffunction-sections
|
CFLAGS += -ffunction-sections
|
||||||
@ -341,7 +328,7 @@ MATH_LIB = -lm
|
|||||||
# --cref: add cross reference to map file
|
# --cref: add cross reference to map file
|
||||||
LDFLAGS = -nostartfiles -Wl,-Map=$(OUTDIR)/$(TARGET).map,--cref,--gc-sections
|
LDFLAGS = -nostartfiles -Wl,-Map=$(OUTDIR)/$(TARGET).map,--cref,--gc-sections
|
||||||
ifeq ($(DEBUG),NO)
|
ifeq ($(DEBUG),NO)
|
||||||
LDFLAGS += -Wl,-static -Wl,-s
|
LDFLAGS += -Wl,-static
|
||||||
endif
|
endif
|
||||||
LDFLAGS += $(patsubst %,-L%,$(EXTRA_LIBDIRS))
|
LDFLAGS += $(patsubst %,-L%,$(EXTRA_LIBDIRS))
|
||||||
LDFLAGS += -lc
|
LDFLAGS += -lc
|
||||||
@ -350,13 +337,14 @@ LDFLAGS += $(MATH_LIB)
|
|||||||
LDFLAGS += -lc -lgcc
|
LDFLAGS += -lc -lgcc
|
||||||
|
|
||||||
# Set linker-script name depending on selected submodel name
|
# Set linker-script name depending on selected submodel name
|
||||||
LDFLAGS +=-T$(LINKERSCRIPTPATH)/link_stm32f10x_$(MODEL).ld
|
LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_memory.ld
|
||||||
|
LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_BL_sections.ld
|
||||||
|
|
||||||
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
|
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).bin
|
||||||
# Program
|
# Program
|
||||||
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
|
OOCD_CL+=-c "flash write_image erase $(OOCD_LOADFILE) 0x08000000 bin"
|
||||||
# Verify
|
# Verify
|
||||||
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
|
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE) 0x08000000 bin"
|
||||||
# reset target
|
# reset target
|
||||||
OOCD_CL+=-c "reset run"
|
OOCD_CL+=-c "reset run"
|
||||||
# terminate OOCD after programming
|
# terminate OOCD after programming
|
||||||
@ -408,7 +396,7 @@ ${OUTDIR}/InitMods.c: Makefile
|
|||||||
# Program the device.
|
# Program the device.
|
||||||
ifeq ($(FLASH_TOOL),OPENOCD)
|
ifeq ($(FLASH_TOOL),OPENOCD)
|
||||||
# Program the device with Dominic Rath's OPENOCD in "batch-mode", needs cfg and "reset-script".
|
# Program the device with Dominic Rath's OPENOCD in "batch-mode", needs cfg and "reset-script".
|
||||||
program: $(OUTDIR)/$(TARGET).elf
|
program: $(OUTDIR)/$(TARGET).bin
|
||||||
@echo ${quote}Programming with OPENOCD${quote}
|
@echo ${quote}Programming with OPENOCD${quote}
|
||||||
$(OOCD_EXE) $(OOCD_CL)
|
$(OOCD_EXE) $(OOCD_CL)
|
||||||
endif
|
endif
|
||||||
@ -444,12 +432,15 @@ $(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM))
|
|||||||
docs:
|
docs:
|
||||||
doxygen $(DOXYGENDIR)/doxygen.cfg
|
doxygen $(DOXYGENDIR)/doxygen.cfg
|
||||||
|
|
||||||
.PHONY: elf lss sym hex bin
|
$(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin
|
||||||
|
|
||||||
|
.PHONY: elf lss sym hex bin bino
|
||||||
elf: $(OUTDIR)/$(TARGET).elf
|
elf: $(OUTDIR)/$(TARGET).elf
|
||||||
lss: $(OUTDIR)/$(TARGET).lss
|
lss: $(OUTDIR)/$(TARGET).lss
|
||||||
sym: $(OUTDIR)/$(TARGET).sym
|
sym: $(OUTDIR)/$(TARGET).sym
|
||||||
hex: $(OUTDIR)/$(TARGET).hex
|
hex: $(OUTDIR)/$(TARGET).hex
|
||||||
bin: $(OUTDIR)/$(TARGET).bin
|
bin: $(OUTDIR)/$(TARGET).bin
|
||||||
|
bino: $(OUTDIR)/$(TARGET).bin.o
|
||||||
|
|
||||||
# Display sizes of sections.
|
# Display sizes of sections.
|
||||||
$(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf))
|
$(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf))
|
||||||
@ -467,6 +458,7 @@ clean_list :
|
|||||||
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).bin
|
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).bin
|
||||||
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).sym
|
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).sym
|
||||||
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).lss
|
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).lss
|
||||||
|
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).bin.o
|
||||||
$(V1) $(REMOVE) $(ALLOBJ)
|
$(V1) $(REMOVE) $(ALLOBJ)
|
||||||
$(V1) $(REMOVE) $(LSTFILES)
|
$(V1) $(REMOVE) $(LSTFILES)
|
||||||
$(V1) $(REMOVE) $(DEPFILES)
|
$(V1) $(REMOVE) $(DEPFILES)
|
||||||
|
@ -36,10 +36,6 @@ ENABLE_DEBUG_PINS ?= NO
|
|||||||
# Set to Yes to enable the AUX UART which is mapped on the S1 (Tx) and S2 (Rx) servo outputs
|
# Set to Yes to enable the AUX UART which is mapped on the S1 (Tx) and S2 (Rx) servo outputs
|
||||||
ENABLE_AUX_UART ?= NO
|
ENABLE_AUX_UART ?= NO
|
||||||
|
|
||||||
#
|
|
||||||
override USE_BOOTLOADER = NO
|
|
||||||
|
|
||||||
|
|
||||||
# Set to YES when using Code Sourcery toolchain
|
# Set to YES when using Code Sourcery toolchain
|
||||||
CODE_SOURCERY ?= NO
|
CODE_SOURCERY ?= NO
|
||||||
|
|
||||||
@ -60,12 +56,6 @@ MCU = cortex-m3
|
|||||||
CHIP = STM32F103RET
|
CHIP = STM32F103RET
|
||||||
BOARD = STM3210E_OP
|
BOARD = STM3210E_OP
|
||||||
MODEL = HD
|
MODEL = HD
|
||||||
ifeq ($(USE_BOOTLOADER), YES)
|
|
||||||
BOOT_MODEL = $(MODEL)_BL
|
|
||||||
|
|
||||||
else
|
|
||||||
BOOT_MODEL = $(MODEL)_NB
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.)
|
# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.)
|
||||||
OUTDIR = $(TOP)/build/bl_openpilot
|
OUTDIR = $(TOP)/build/bl_openpilot
|
||||||
@ -193,7 +183,7 @@ CPPSRCARM =
|
|||||||
# Even though the DOS/Win* filesystem matches both .s and .S the same,
|
# Even though the DOS/Win* filesystem matches both .s and .S the same,
|
||||||
# it will preserve the spelling of the filenames, and gcc itself does
|
# it will preserve the spelling of the filenames, and gcc itself does
|
||||||
# care about how the name is spelled on its command-line.
|
# care about how the name is spelled on its command-line.
|
||||||
ASRC = $(PIOSSTM32F10X)/startup_stm32f10x_$(MODEL).S
|
ASRC = $(PIOSSTM32F10X)/startup_stm32f10x_$(MODEL)_OP.S
|
||||||
|
|
||||||
# List Assembler source files here which must be assembled in ARM-Mode..
|
# List Assembler source files here which must be assembled in ARM-Mode..
|
||||||
ASRCARM =
|
ASRCARM =
|
||||||
@ -271,10 +261,6 @@ endif
|
|||||||
ifeq ($(ENABLE_AUX_UART), YES)
|
ifeq ($(ENABLE_AUX_UART), YES)
|
||||||
CDEFS += -DPIOS_ENABLE_AUX_UART
|
CDEFS += -DPIOS_ENABLE_AUX_UART
|
||||||
endif
|
endif
|
||||||
ifeq ($(USE_BOOTLOADER), YES)
|
|
||||||
CDEFS += -DUSE_BOOTLOADER
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
# Place project-specific -D and/or -U options for
|
# Place project-specific -D and/or -U options for
|
||||||
# Assembler with preprocessor here.
|
# Assembler with preprocessor here.
|
||||||
@ -302,9 +288,10 @@ CSTANDARD = -std=gnu99
|
|||||||
# Flags for C and C++ (arm-elf-gcc/arm-elf-g++)
|
# Flags for C and C++ (arm-elf-gcc/arm-elf-g++)
|
||||||
|
|
||||||
ifeq ($(DEBUG),YES)
|
ifeq ($(DEBUG),YES)
|
||||||
CFLAGS = -g$(DEBUGF) -DDEBUG
|
CFLAGS = -DDEBUG
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
CFLAGS += -g$(DEBUGF)
|
||||||
CFLAGS += -O$(OPT)
|
CFLAGS += -O$(OPT)
|
||||||
ifeq ($(DEBUG),NO)
|
ifeq ($(DEBUG),NO)
|
||||||
CFLAGS += -ffunction-sections
|
CFLAGS += -ffunction-sections
|
||||||
@ -344,7 +331,7 @@ MATH_LIB = -lm
|
|||||||
# --cref: add cross reference to map file
|
# --cref: add cross reference to map file
|
||||||
LDFLAGS = -nostartfiles -Wl,-Map=$(OUTDIR)/$(TARGET).map,--cref,--gc-sections
|
LDFLAGS = -nostartfiles -Wl,-Map=$(OUTDIR)/$(TARGET).map,--cref,--gc-sections
|
||||||
ifeq ($(DEBUG),NO)
|
ifeq ($(DEBUG),NO)
|
||||||
LDFLAGS += -Wl,-static -Wl,-s
|
LDFLAGS += -Wl,-static
|
||||||
endif
|
endif
|
||||||
LDFLAGS += $(patsubst %,-L%,$(EXTRA_LIBDIRS))
|
LDFLAGS += $(patsubst %,-L%,$(EXTRA_LIBDIRS))
|
||||||
LDFLAGS += -lc
|
LDFLAGS += -lc
|
||||||
@ -353,13 +340,14 @@ LDFLAGS += $(MATH_LIB)
|
|||||||
LDFLAGS += -lc -lgcc
|
LDFLAGS += -lc -lgcc
|
||||||
|
|
||||||
# Set linker-script name depending on selected submodel name
|
# Set linker-script name depending on selected submodel name
|
||||||
LDFLAGS +=-T$(LINKERSCRIPTPATH)/link_stm32f10x_$(MODEL).ld
|
LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_memory.ld
|
||||||
|
LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_BL_sections.ld
|
||||||
|
|
||||||
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
|
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).bin
|
||||||
# Program
|
# Program
|
||||||
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
|
OOCD_CL+=-c "flash write_image erase $(OOCD_LOADFILE) 0x08000000 bin"
|
||||||
# Verify
|
# Verify
|
||||||
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
|
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE) 0x08000000 bin"
|
||||||
# reset target
|
# reset target
|
||||||
OOCD_CL+=-c "reset run"
|
OOCD_CL+=-c "reset run"
|
||||||
# terminate OOCD after programming
|
# terminate OOCD after programming
|
||||||
@ -411,7 +399,7 @@ ${OUTDIR}/InitMods.c: Makefile
|
|||||||
# Program the device.
|
# Program the device.
|
||||||
ifeq ($(FLASH_TOOL),OPENOCD)
|
ifeq ($(FLASH_TOOL),OPENOCD)
|
||||||
# Program the device with Dominic Rath's OPENOCD in "batch-mode", needs cfg and "reset-script".
|
# Program the device with Dominic Rath's OPENOCD in "batch-mode", needs cfg and "reset-script".
|
||||||
program: $(OUTDIR)/$(TARGET).elf
|
program: $(OUTDIR)/$(TARGET).bin
|
||||||
@echo ${quote}Programming with OPENOCD${quote}
|
@echo ${quote}Programming with OPENOCD${quote}
|
||||||
$(OOCD_EXE) $(OOCD_CL)
|
$(OOCD_EXE) $(OOCD_CL)
|
||||||
endif
|
endif
|
||||||
@ -443,12 +431,15 @@ $(eval $(call PARTIAL_COMPILE_TEMPLATE, SRC))
|
|||||||
# Compile: create assembler files from C source files. ARM only
|
# Compile: create assembler files from C source files. ARM only
|
||||||
$(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM))
|
$(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM))
|
||||||
|
|
||||||
.PHONY: elf lss sym hex bin
|
$(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin
|
||||||
|
|
||||||
|
.PHONY: elf lss sym hex bin bino
|
||||||
elf: $(OUTDIR)/$(TARGET).elf
|
elf: $(OUTDIR)/$(TARGET).elf
|
||||||
lss: $(OUTDIR)/$(TARGET).lss
|
lss: $(OUTDIR)/$(TARGET).lss
|
||||||
sym: $(OUTDIR)/$(TARGET).sym
|
sym: $(OUTDIR)/$(TARGET).sym
|
||||||
hex: $(OUTDIR)/$(TARGET).hex
|
hex: $(OUTDIR)/$(TARGET).hex
|
||||||
bin: $(OUTDIR)/$(TARGET).bin
|
bin: $(OUTDIR)/$(TARGET).bin
|
||||||
|
bino: $(OUTDIR)/$(TARGET).bin.o
|
||||||
|
|
||||||
# Display sizes of sections.
|
# Display sizes of sections.
|
||||||
$(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf))
|
$(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf))
|
||||||
@ -470,6 +461,7 @@ clean_list :
|
|||||||
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).bin
|
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).bin
|
||||||
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).sym
|
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).sym
|
||||||
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).lss
|
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).lss
|
||||||
|
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).bin.o
|
||||||
$(V1) $(REMOVE) $(ALLOBJ)
|
$(V1) $(REMOVE) $(ALLOBJ)
|
||||||
$(V1) $(REMOVE) $(LSTFILES)
|
$(V1) $(REMOVE) $(LSTFILES)
|
||||||
$(V1) $(REMOVE) $(DEPFILES)
|
$(V1) $(REMOVE) $(DEPFILES)
|
||||||
|
@ -36,10 +36,6 @@ ENABLE_DEBUG_PINS ?= NO
|
|||||||
# Set to Yes to enable the AUX UART which is mapped on the S1 (Tx) and S2 (Rx) servo outputs
|
# Set to Yes to enable the AUX UART which is mapped on the S1 (Tx) and S2 (Rx) servo outputs
|
||||||
ENABLE_AUX_UART ?= NO
|
ENABLE_AUX_UART ?= NO
|
||||||
|
|
||||||
#
|
|
||||||
override USE_BOOTLOADER = NO
|
|
||||||
|
|
||||||
|
|
||||||
# Set to YES when using Code Sourcery toolchain
|
# Set to YES when using Code Sourcery toolchain
|
||||||
CODE_SOURCERY ?= NO
|
CODE_SOURCERY ?= NO
|
||||||
|
|
||||||
@ -60,12 +56,6 @@ MCU = cortex-m3
|
|||||||
CHIP = STM32F103CBT
|
CHIP = STM32F103CBT
|
||||||
BOARD = STM32103CB_PIPXTREME
|
BOARD = STM32103CB_PIPXTREME
|
||||||
MODEL = MD
|
MODEL = MD
|
||||||
ifeq ($(USE_BOOTLOADER), YES)
|
|
||||||
BOOT_MODEL = $(MODEL)_BL
|
|
||||||
|
|
||||||
else
|
|
||||||
BOOT_MODEL = $(MODEL)_NB
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.)
|
# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.)
|
||||||
OUTDIR = $(TOP)/build/bl_pipxtreme
|
OUTDIR = $(TOP)/build/bl_pipxtreme
|
||||||
@ -267,10 +257,6 @@ endif
|
|||||||
ifeq ($(ENABLE_AUX_UART), YES)
|
ifeq ($(ENABLE_AUX_UART), YES)
|
||||||
CDEFS += -DPIOS_ENABLE_AUX_UART
|
CDEFS += -DPIOS_ENABLE_AUX_UART
|
||||||
endif
|
endif
|
||||||
ifeq ($(USE_BOOTLOADER), YES)
|
|
||||||
CDEFS += -DUSE_BOOTLOADER
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
# Place project-specific -D and/or -U options for
|
# Place project-specific -D and/or -U options for
|
||||||
# Assembler with preprocessor here.
|
# Assembler with preprocessor here.
|
||||||
@ -298,9 +284,10 @@ CSTANDARD = -std=gnu99
|
|||||||
# Flags for C and C++ (arm-elf-gcc/arm-elf-g++)
|
# Flags for C and C++ (arm-elf-gcc/arm-elf-g++)
|
||||||
|
|
||||||
ifeq ($(DEBUG),YES)
|
ifeq ($(DEBUG),YES)
|
||||||
CFLAGS = -g$(DEBUGF) -DDEBUG
|
CFLAGS = -DDEBUG
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
CFLAGS += -g$(DEBUGF)
|
||||||
CFLAGS += -O$(OPT)
|
CFLAGS += -O$(OPT)
|
||||||
ifeq ($(DEBUG),NO)
|
ifeq ($(DEBUG),NO)
|
||||||
CFLAGS += -ffunction-sections
|
CFLAGS += -ffunction-sections
|
||||||
@ -340,7 +327,7 @@ MATH_LIB = -lm
|
|||||||
# --cref: add cross reference to map file
|
# --cref: add cross reference to map file
|
||||||
LDFLAGS = -nostartfiles -Wl,-Map=$(OUTDIR)/$(TARGET).map,--cref,--gc-sections
|
LDFLAGS = -nostartfiles -Wl,-Map=$(OUTDIR)/$(TARGET).map,--cref,--gc-sections
|
||||||
ifeq ($(DEBUG),NO)
|
ifeq ($(DEBUG),NO)
|
||||||
LDFLAGS += -Wl,-static -Wl,-s
|
LDFLAGS += -Wl,-static
|
||||||
endif
|
endif
|
||||||
LDFLAGS += $(patsubst %,-L%,$(EXTRA_LIBDIRS))
|
LDFLAGS += $(patsubst %,-L%,$(EXTRA_LIBDIRS))
|
||||||
LDFLAGS += -lc
|
LDFLAGS += -lc
|
||||||
@ -349,13 +336,14 @@ LDFLAGS += $(MATH_LIB)
|
|||||||
LDFLAGS += -lc -lgcc
|
LDFLAGS += -lc -lgcc
|
||||||
|
|
||||||
# Set linker-script name depending on selected submodel name
|
# Set linker-script name depending on selected submodel name
|
||||||
LDFLAGS +=-T$(LINKERSCRIPTPATH)/link_stm32f10x_$(MODEL).ld
|
LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_memory.ld
|
||||||
|
LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_BL_sections.ld
|
||||||
|
|
||||||
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
|
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).bin
|
||||||
# Program
|
# Program
|
||||||
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
|
OOCD_CL+=-c "flash write_image erase $(OOCD_LOADFILE) 0x08000000 bin"
|
||||||
# Verify
|
# Verify
|
||||||
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
|
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE) 0x08000000 bin"
|
||||||
# reset target
|
# reset target
|
||||||
OOCD_CL+=-c "reset run"
|
OOCD_CL+=-c "reset run"
|
||||||
# terminate OOCD after programming
|
# terminate OOCD after programming
|
||||||
@ -407,7 +395,7 @@ ${OUTDIR}/InitMods.c: Makefile
|
|||||||
# Program the device.
|
# Program the device.
|
||||||
ifeq ($(FLASH_TOOL),OPENOCD)
|
ifeq ($(FLASH_TOOL),OPENOCD)
|
||||||
# Program the device with Dominic Rath's OPENOCD in "batch-mode", needs cfg and "reset-script".
|
# Program the device with Dominic Rath's OPENOCD in "batch-mode", needs cfg and "reset-script".
|
||||||
program: $(OUTDIR)/$(TARGET).elf
|
program: $(OUTDIR)/$(TARGET).bin
|
||||||
@echo ${quote}Programming with OPENOCD${quote}
|
@echo ${quote}Programming with OPENOCD${quote}
|
||||||
$(OOCD_EXE) $(OOCD_CL)
|
$(OOCD_EXE) $(OOCD_CL)
|
||||||
endif
|
endif
|
||||||
@ -439,12 +427,15 @@ $(eval $(call PARTIAL_COMPILE_TEMPLATE, SRC))
|
|||||||
# Compile: create assembler files from C source files. ARM only
|
# Compile: create assembler files from C source files. ARM only
|
||||||
$(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM))
|
$(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM))
|
||||||
|
|
||||||
.PHONY: elf lss sym hex bin
|
$(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin
|
||||||
|
|
||||||
|
.PHONY: elf lss sym hex bin bino
|
||||||
elf: $(OUTDIR)/$(TARGET).elf
|
elf: $(OUTDIR)/$(TARGET).elf
|
||||||
lss: $(OUTDIR)/$(TARGET).lss
|
lss: $(OUTDIR)/$(TARGET).lss
|
||||||
sym: $(OUTDIR)/$(TARGET).sym
|
sym: $(OUTDIR)/$(TARGET).sym
|
||||||
hex: $(OUTDIR)/$(TARGET).hex
|
hex: $(OUTDIR)/$(TARGET).hex
|
||||||
bin: $(OUTDIR)/$(TARGET).bin
|
bin: $(OUTDIR)/$(TARGET).bin
|
||||||
|
bino: $(OUTDIR)/$(TARGET).bin.o
|
||||||
|
|
||||||
# Display sizes of sections.
|
# Display sizes of sections.
|
||||||
$(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf))
|
$(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf))
|
||||||
@ -466,6 +457,7 @@ clean_list :
|
|||||||
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).bin
|
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).bin
|
||||||
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).sym
|
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).sym
|
||||||
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).lss
|
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).lss
|
||||||
|
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).bin.o
|
||||||
$(V1) $(REMOVE) $(ALLOBJ)
|
$(V1) $(REMOVE) $(ALLOBJ)
|
||||||
$(V1) $(REMOVE) $(LSTFILES)
|
$(V1) $(REMOVE) $(LSTFILES)
|
||||||
$(V1) $(REMOVE) $(DEPFILES)
|
$(V1) $(REMOVE) $(DEPFILES)
|
||||||
|
@ -38,9 +38,6 @@ ENABLE_DEBUG_PINS ?= NO
|
|||||||
# Set to Yes to enable the AUX UART which is mapped on the S1 (Tx) and S2 (Rx) servo outputs
|
# Set to Yes to enable the AUX UART which is mapped on the S1 (Tx) and S2 (Rx) servo outputs
|
||||||
ENABLE_AUX_UART ?= NO
|
ENABLE_AUX_UART ?= NO
|
||||||
|
|
||||||
#
|
|
||||||
USE_BOOTLOADER ?= YES
|
|
||||||
|
|
||||||
USE_SPEKTRUM ?= NO
|
USE_SPEKTRUM ?= NO
|
||||||
|
|
||||||
USE_I2C ?= NO
|
USE_I2C ?= NO
|
||||||
@ -68,12 +65,6 @@ MCU = cortex-m3
|
|||||||
CHIP = STM32F103CBT
|
CHIP = STM32F103CBT
|
||||||
BOARD = STM32103CB_CC_Rev1
|
BOARD = STM32103CB_CC_Rev1
|
||||||
MODEL = MD
|
MODEL = MD
|
||||||
ifeq ($(USE_BOOTLOADER), YES)
|
|
||||||
BOOT_MODEL = $(MODEL)_BL
|
|
||||||
|
|
||||||
else
|
|
||||||
BOOT_MODEL = $(MODEL)_NB
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.)
|
# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.)
|
||||||
OUTDIR = $(TOP)/build/coptercontrol
|
OUTDIR = $(TOP)/build/coptercontrol
|
||||||
@ -208,7 +199,6 @@ SRC += $(PIOSSTM32F10X)/pios_wdg.c
|
|||||||
|
|
||||||
# PIOS USB related files (seperated to make code maintenance more easy)
|
# PIOS USB related files (seperated to make code maintenance more easy)
|
||||||
SRC += $(PIOSSTM32F10X)/pios_usb_hid.c
|
SRC += $(PIOSSTM32F10X)/pios_usb_hid.c
|
||||||
#SRC += $(PIOSSTM32F10X)/pios_usb_hid_desc.c
|
|
||||||
SRC += $(PIOSSTM32F10X)/pios_usb_hid_istr.c
|
SRC += $(PIOSSTM32F10X)/pios_usb_hid_istr.c
|
||||||
SRC += $(PIOSSTM32F10X)/pios_usb_hid_prop.c
|
SRC += $(PIOSSTM32F10X)/pios_usb_hid_prop.c
|
||||||
SRC += $(PIOSSTM32F10X)/pios_usb_hid_pwr.c
|
SRC += $(PIOSSTM32F10X)/pios_usb_hid_pwr.c
|
||||||
@ -389,9 +379,7 @@ endif
|
|||||||
ifeq ($(ENABLE_AUX_UART), YES)
|
ifeq ($(ENABLE_AUX_UART), YES)
|
||||||
CDEFS += -DPIOS_ENABLE_AUX_UART
|
CDEFS += -DPIOS_ENABLE_AUX_UART
|
||||||
endif
|
endif
|
||||||
ifeq ($(USE_BOOTLOADER), YES)
|
|
||||||
CDEFS += -DUSE_BOOTLOADER
|
CDEFS += -DUSE_BOOTLOADER
|
||||||
endif
|
|
||||||
ifeq ($(ERASE_FLASH), YES)
|
ifeq ($(ERASE_FLASH), YES)
|
||||||
CDEFS += -DERASE_FLASH
|
CDEFS += -DERASE_FLASH
|
||||||
endif
|
endif
|
||||||
@ -481,13 +469,14 @@ LDFLAGS += $(MATH_LIB)
|
|||||||
LDFLAGS += -lc -lgcc
|
LDFLAGS += -lc -lgcc
|
||||||
|
|
||||||
# Set linker-script name depending on selected submodel name
|
# Set linker-script name depending on selected submodel name
|
||||||
LDFLAGS +=-T$(LINKERSCRIPTPATH)/link_$(BOARD)_$(BOOT_MODEL).ld
|
LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_memory.ld
|
||||||
|
LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_sections.ld
|
||||||
|
|
||||||
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
|
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).bin
|
||||||
# Program
|
# Program
|
||||||
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
|
OOCD_CL+=-c "flash write_image erase $(OOCD_LOADFILE) 0x08003000 bin"
|
||||||
# Verify
|
# Verify
|
||||||
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
|
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE) 0x08003000 bin"
|
||||||
# reset target
|
# reset target
|
||||||
OOCD_CL+=-c "reset run"
|
OOCD_CL+=-c "reset run"
|
||||||
# terminate OOCD after programming
|
# terminate OOCD after programming
|
||||||
@ -548,20 +537,12 @@ ${OUTDIR}/InitMods.c: Makefile
|
|||||||
# @$(PYTHON) $(PYMITETOOLS)/pmGenPmFeatures.py $(PYMITEPLAT)/pmfeatures.py > $(OUTDIR)/pmfeatures.h
|
# @$(PYTHON) $(PYMITETOOLS)/pmGenPmFeatures.py $(PYMITEPLAT)/pmfeatures.py > $(OUTDIR)/pmfeatures.h
|
||||||
# @$(PYTHON) $(PYMITETOOLS)/pmImgCreator.py -f $(PYMITEPLAT)/pmfeatures.py -c -u -o $(OUTDIR)/pmlibusr_img.c --native-file=$(OUTDIR)/pmlibusr_nat.c $(FLIGHTPLANS)/test.py
|
# @$(PYTHON) $(PYMITETOOLS)/pmImgCreator.py -f $(PYMITEPLAT)/pmfeatures.py -c -u -o $(OUTDIR)/pmlibusr_img.c --native-file=$(OUTDIR)/pmlibusr_nat.c $(FLIGHTPLANS)/test.py
|
||||||
|
|
||||||
# Program the device.
|
|
||||||
ifeq ($(USE_BOOTLOADER), YES)
|
|
||||||
# Program the device with OP Upload Tool".
|
|
||||||
program: $(OUTDIR)/$(TARGET).bin
|
|
||||||
@echo ${quote}Programming with OP Upload Tool${quote}
|
|
||||||
../../ground/src/experimental/upload-build-desktop/debug/OPUploadTool -d 0 -p $(OUTDIR)/$(TARGET).bin
|
|
||||||
else
|
|
||||||
ifeq ($(FLASH_TOOL),OPENOCD)
|
ifeq ($(FLASH_TOOL),OPENOCD)
|
||||||
# Program the device with Dominic Rath's OPENOCD in "batch-mode", needs cfg and "reset-script".
|
# Program the device with Dominic Rath's OPENOCD in "batch-mode", needs cfg and "reset-script".
|
||||||
program: $(OUTDIR)/$(TARGET).elf
|
program: $(OUTDIR)/$(TARGET).bin
|
||||||
@echo ${quote}Programming with OPENOCD${quote}
|
@echo ${quote}Programming with OPENOCD${quote}
|
||||||
$(OOCD_EXE) $(OOCD_CL)
|
$(OOCD_EXE) $(OOCD_CL)
|
||||||
endif
|
endif
|
||||||
endif
|
|
||||||
|
|
||||||
# Link: create ELF output file from object files.
|
# Link: create ELF output file from object files.
|
||||||
$(eval $(call LINK_TEMPLATE, $(OUTDIR)/$(TARGET).elf, $(ALLOBJ)))
|
$(eval $(call LINK_TEMPLATE, $(OUTDIR)/$(TARGET).elf, $(ALLOBJ)))
|
||||||
@ -590,12 +571,15 @@ $(eval $(call PARTIAL_COMPILE_TEMPLATE, SRC))
|
|||||||
# Compile: create assembler files from C source files. ARM only
|
# Compile: create assembler files from C source files. ARM only
|
||||||
$(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM))
|
$(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM))
|
||||||
|
|
||||||
.PHONY: elf lss sym hex bin
|
$(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin
|
||||||
|
|
||||||
|
.PHONY: elf lss sym hex bin bino
|
||||||
elf: $(OUTDIR)/$(TARGET).elf
|
elf: $(OUTDIR)/$(TARGET).elf
|
||||||
lss: $(OUTDIR)/$(TARGET).lss
|
lss: $(OUTDIR)/$(TARGET).lss
|
||||||
sym: $(OUTDIR)/$(TARGET).sym
|
sym: $(OUTDIR)/$(TARGET).sym
|
||||||
hex: $(OUTDIR)/$(TARGET).hex
|
hex: $(OUTDIR)/$(TARGET).hex
|
||||||
bin: $(OUTDIR)/$(TARGET).bin
|
bin: $(OUTDIR)/$(TARGET).bin
|
||||||
|
bino: $(OUTDIR)/$(TARGET).bin.o
|
||||||
|
|
||||||
# Display sizes of sections.
|
# Display sizes of sections.
|
||||||
$(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf))
|
$(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf))
|
||||||
@ -617,6 +601,7 @@ clean_list :
|
|||||||
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).bin
|
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).bin
|
||||||
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).sym
|
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).sym
|
||||||
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).lss
|
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).lss
|
||||||
|
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).bin.o
|
||||||
$(V1) $(REMOVE) $(wildcard $(OUTDIR)/*.c)
|
$(V1) $(REMOVE) $(wildcard $(OUTDIR)/*.c)
|
||||||
$(V1) $(REMOVE) $(wildcard $(OUTDIR)/*.h)
|
$(V1) $(REMOVE) $(wildcard $(OUTDIR)/*.h)
|
||||||
$(V1) $(REMOVE) $(ALLOBJ)
|
$(V1) $(REMOVE) $(ALLOBJ)
|
||||||
|
@ -50,8 +50,21 @@ uint32_t STOPWATCH_Init(u32 resolution, TIM_TypeDef* TIM) {
|
|||||||
case (uint32_t)TIM4:
|
case (uint32_t)TIM4:
|
||||||
STOPWATCH_TIMER_RCC = RCC_APB1Periph_TIM4;
|
STOPWATCH_TIMER_RCC = RCC_APB1Periph_TIM4;
|
||||||
break;
|
break;
|
||||||
|
case (uint32_t)TIM5:
|
||||||
|
STOPWATCH_TIMER_RCC = RCC_APB1Periph_TIM5;
|
||||||
|
break;
|
||||||
|
case (uint32_t)TIM6:
|
||||||
|
STOPWATCH_TIMER_RCC = RCC_APB1Periph_TIM6;
|
||||||
|
break;
|
||||||
|
case (uint32_t)TIM7:
|
||||||
|
STOPWATCH_TIMER_RCC = RCC_APB1Periph_TIM7;
|
||||||
|
break;
|
||||||
|
case (uint32_t)TIM8:
|
||||||
|
STOPWATCH_TIMER_RCC = RCC_APB2Periph_TIM8;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
STOPWATCH_TIMER_RCC = RCC_APB2Periph_TIM1;
|
/* Unsupported timer */
|
||||||
|
while(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// enable timer clock
|
// enable timer clock
|
||||||
|
@ -36,9 +36,6 @@ ENABLE_DEBUG_PINS ?= NO
|
|||||||
# Set to Yes to enable the AUX UART which is mapped on the S1 (Tx) and S2 (Rx) servo outputs
|
# Set to Yes to enable the AUX UART which is mapped on the S1 (Tx) and S2 (Rx) servo outputs
|
||||||
ENABLE_AUX_UART ?= NO
|
ENABLE_AUX_UART ?= NO
|
||||||
|
|
||||||
#
|
|
||||||
USE_BOOTLOADER ?= YES
|
|
||||||
|
|
||||||
USE_SPEKTRUM ?= NO
|
USE_SPEKTRUM ?= NO
|
||||||
|
|
||||||
|
|
||||||
@ -71,12 +68,6 @@ MCU = cortex-m3
|
|||||||
CHIP = STM32F103RET
|
CHIP = STM32F103RET
|
||||||
BOARD = STM3210E_OP
|
BOARD = STM3210E_OP
|
||||||
MODEL = HD
|
MODEL = HD
|
||||||
ifeq ($(USE_BOOTLOADER), YES)
|
|
||||||
BOOT_MODEL = $(MODEL)_BL
|
|
||||||
|
|
||||||
else
|
|
||||||
BOOT_MODEL = $(MODEL)_NB
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.)
|
# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.)
|
||||||
OUTDIR = $(TOP)/build/openpilot
|
OUTDIR = $(TOP)/build/openpilot
|
||||||
@ -377,9 +368,7 @@ endif
|
|||||||
ifeq ($(ENABLE_AUX_UART), YES)
|
ifeq ($(ENABLE_AUX_UART), YES)
|
||||||
CDEFS += -DPIOS_ENABLE_AUX_UART
|
CDEFS += -DPIOS_ENABLE_AUX_UART
|
||||||
endif
|
endif
|
||||||
ifeq ($(USE_BOOTLOADER), YES)
|
|
||||||
CDEFS += -DUSE_BOOTLOADER
|
CDEFS += -DUSE_BOOTLOADER
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(USE_SPEKTRUM), YES)
|
ifeq ($(USE_SPEKTRUM), YES)
|
||||||
CDEFS += -DUSE_SPEKTRUM
|
CDEFS += -DUSE_SPEKTRUM
|
||||||
@ -458,13 +447,14 @@ LDFLAGS += $(MATH_LIB)
|
|||||||
LDFLAGS += -lc -lgcc
|
LDFLAGS += -lc -lgcc
|
||||||
|
|
||||||
# Set linker-script name depending on selected submodel name
|
# Set linker-script name depending on selected submodel name
|
||||||
LDFLAGS +=-T$(LINKERSCRIPTPATH)/link_$(BOARD)_$(BOOT_MODEL).ld
|
LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_memory.ld
|
||||||
|
LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_sections.ld
|
||||||
|
|
||||||
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
|
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).bin
|
||||||
# Program
|
# Program
|
||||||
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
|
OOCD_CL+=-c "flash write_image erase $(OOCD_LOADFILE) 0x08005000 bin"
|
||||||
# Verify
|
# Verify
|
||||||
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
|
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE) 0x08005000 bin"
|
||||||
# reset target
|
# reset target
|
||||||
OOCD_CL+=-c "reset run"
|
OOCD_CL+=-c "reset run"
|
||||||
# terminate OOCD after programming
|
# terminate OOCD after programming
|
||||||
@ -527,19 +517,12 @@ ${OUTDIR}/pmlib_img.c ${OUTDIR}/pmlib_nat.c ${OUTDIR}/pmlibusr_img.c ${OUTDIR}/p
|
|||||||
@$(PYTHON) $(PYMITETOOLS)/pmImgCreator.py -f $(PYMITEPLAT)/pmfeatures.py -c -u -o $(OUTDIR)/pmlibusr_img.c --native-file=$(OUTDIR)/pmlibusr_nat.c $(FLIGHTPLANS)/test.py
|
@$(PYTHON) $(PYMITETOOLS)/pmImgCreator.py -f $(PYMITEPLAT)/pmfeatures.py -c -u -o $(OUTDIR)/pmlibusr_img.c --native-file=$(OUTDIR)/pmlibusr_nat.c $(FLIGHTPLANS)/test.py
|
||||||
|
|
||||||
# Program the device.
|
# Program the device.
|
||||||
ifeq ($(USE_BOOTLOADER), YES)
|
|
||||||
# Program the device with OP Upload Tool".
|
|
||||||
program: $(OUTDIR)/$(TARGET).bin
|
|
||||||
@echo ${quote}Programming with OP Upload Tool${quote}
|
|
||||||
../../ground/src/experimental/upload-build-desktop/debug/OPUploadTool -d 0 -p $(OUTDIR)/$(TARGET).bin
|
|
||||||
else
|
|
||||||
ifeq ($(FLASH_TOOL),OPENOCD)
|
ifeq ($(FLASH_TOOL),OPENOCD)
|
||||||
# Program the device with Dominic Rath's OPENOCD in "batch-mode", needs cfg and "reset-script".
|
# Program the device with Dominic Rath's OPENOCD in "batch-mode", needs cfg and "reset-script".
|
||||||
program: $(OUTDIR)/$(TARGET).elf
|
program: $(OUTDIR)/$(TARGET).bin
|
||||||
@echo ${quote}Programming with OPENOCD${quote}
|
@echo ${quote}Programming with OPENOCD${quote}
|
||||||
$(OOCD_EXE) $(OOCD_CL)
|
$(OOCD_EXE) $(OOCD_CL)
|
||||||
endif
|
endif
|
||||||
endif
|
|
||||||
|
|
||||||
# Link: create ELF output file from object files.
|
# Link: create ELF output file from object files.
|
||||||
$(eval $(call LINK_TEMPLATE, $(OUTDIR)/$(TARGET).elf, $(ALLOBJ)))
|
$(eval $(call LINK_TEMPLATE, $(OUTDIR)/$(TARGET).elf, $(ALLOBJ)))
|
||||||
@ -568,12 +551,15 @@ $(eval $(call PARTIAL_COMPILE_TEMPLATE, SRC))
|
|||||||
# Compile: create assembler files from C source files. ARM only
|
# Compile: create assembler files from C source files. ARM only
|
||||||
$(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM))
|
$(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM))
|
||||||
|
|
||||||
.PHONY: elf lss sym hex bin
|
$(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin
|
||||||
|
|
||||||
|
.PHONY: elf lss sym hex bin bino
|
||||||
elf: $(OUTDIR)/$(TARGET).elf
|
elf: $(OUTDIR)/$(TARGET).elf
|
||||||
lss: $(OUTDIR)/$(TARGET).lss
|
lss: $(OUTDIR)/$(TARGET).lss
|
||||||
sym: $(OUTDIR)/$(TARGET).sym
|
sym: $(OUTDIR)/$(TARGET).sym
|
||||||
hex: $(OUTDIR)/$(TARGET).hex
|
hex: $(OUTDIR)/$(TARGET).hex
|
||||||
bin: $(OUTDIR)/$(TARGET).bin
|
bin: $(OUTDIR)/$(TARGET).bin
|
||||||
|
bino: $(OUTDIR)/$(TARGET).bin.o
|
||||||
|
|
||||||
# Display sizes of sections.
|
# Display sizes of sections.
|
||||||
$(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf))
|
$(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf))
|
||||||
@ -595,6 +581,7 @@ clean_list :
|
|||||||
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).bin
|
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).bin
|
||||||
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).sym
|
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).sym
|
||||||
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).lss
|
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).lss
|
||||||
|
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).bin.o
|
||||||
$(V1) $(REMOVE) $(wildcard $(OUTDIR)/*.c)
|
$(V1) $(REMOVE) $(wildcard $(OUTDIR)/*.c)
|
||||||
$(V1) $(REMOVE) $(wildcard $(OUTDIR)/*.h)
|
$(V1) $(REMOVE) $(wildcard $(OUTDIR)/*.h)
|
||||||
$(V1) $(REMOVE) $(ALLOBJ)
|
$(V1) $(REMOVE) $(ALLOBJ)
|
||||||
|
@ -11,6 +11,8 @@
|
|||||||
#include "STM32103CB_CC_Rev1.h"
|
#include "STM32103CB_CC_Rev1.h"
|
||||||
#elif USE_STM3210E_INS
|
#elif USE_STM3210E_INS
|
||||||
#include "STM3210E_INS.h"
|
#include "STM3210E_INS.h"
|
||||||
|
#else
|
||||||
|
#error Board definition has not been provided.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* PIOS_BOARD_H_ */
|
#endif /* PIOS_BOARD_H_ */
|
||||||
|
@ -1,9 +1,3 @@
|
|||||||
MEMORY
|
|
||||||
{
|
|
||||||
FLASH (rx) : ORIGIN = 0x08002000, LENGTH = 116K
|
|
||||||
SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00005000
|
|
||||||
}
|
|
||||||
|
|
||||||
_estack = 0x20004FF0;
|
_estack = 0x20004FF0;
|
||||||
|
|
||||||
/* Section Definitions */
|
/* Section Definitions */
|
||||||
@ -15,17 +9,17 @@ SECTIONS
|
|||||||
*(.text .text.* .gnu.linkonce.t.*)
|
*(.text .text.* .gnu.linkonce.t.*)
|
||||||
*(.glue_7t) *(.glue_7)
|
*(.glue_7t) *(.glue_7)
|
||||||
*(.rodata .rodata* .gnu.linkonce.r.*)
|
*(.rodata .rodata* .gnu.linkonce.r.*)
|
||||||
} > FLASH
|
} > BL_FLASH
|
||||||
|
|
||||||
.ARM.extab :
|
.ARM.extab :
|
||||||
{
|
{
|
||||||
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
||||||
} > FLASH
|
} > BL_FLASH
|
||||||
|
|
||||||
.ARM.exidx :
|
.ARM.exidx :
|
||||||
{
|
{
|
||||||
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
||||||
} > FLASH
|
} > BL_FLASH
|
||||||
|
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
_etext = .;
|
_etext = .;
|
6
flight/PiOS/STM32F10x/link_STM32103CB_AHRS_memory.ld
Normal file
6
flight/PiOS/STM32F10x/link_STM32103CB_AHRS_memory.ld
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
MEMORY
|
||||||
|
{
|
||||||
|
BL_FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 8K
|
||||||
|
FLASH (rx) : ORIGIN = 0x08000000 + 8K, LENGTH = 128K - 8K
|
||||||
|
SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 20K
|
||||||
|
}
|
@ -1,9 +1,3 @@
|
|||||||
MEMORY
|
|
||||||
{
|
|
||||||
FLASH (rx) : ORIGIN = 0x08003000, LENGTH = 116K
|
|
||||||
SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00005000
|
|
||||||
}
|
|
||||||
|
|
||||||
_estack = 0x20004FF0;
|
_estack = 0x20004FF0;
|
||||||
|
|
||||||
/* Section Definitions */
|
/* Section Definitions */
|
97
flight/PiOS/STM32F10x/link_STM32103CB_CC_Rev1_BL_sections.ld
Normal file
97
flight/PiOS/STM32F10x/link_STM32103CB_CC_Rev1_BL_sections.ld
Normal file
@ -0,0 +1,97 @@
|
|||||||
|
/* Stub out these functions since we don't use them anyway */
|
||||||
|
PROVIDE ( vPortSVCHandler = 0 ) ;
|
||||||
|
PROVIDE ( xPortPendSVHandler = 0 ) ;
|
||||||
|
PROVIDE ( xPortSysTickHandler = 0 ) ;
|
||||||
|
|
||||||
|
_estack = 0x20004FF0;
|
||||||
|
|
||||||
|
/* Section Definitions */
|
||||||
|
SECTIONS
|
||||||
|
{
|
||||||
|
.text :
|
||||||
|
{
|
||||||
|
KEEP(*(.isr_vector .isr_vector.*))
|
||||||
|
*(.text .text.* .gnu.linkonce.t.*)
|
||||||
|
*(.glue_7t) *(.glue_7)
|
||||||
|
*(.rodata .rodata* .gnu.linkonce.r.*)
|
||||||
|
} > BL_FLASH
|
||||||
|
|
||||||
|
/* init sections */
|
||||||
|
.initcalluavobj.init :
|
||||||
|
{
|
||||||
|
. = ALIGN(4);
|
||||||
|
__uavobj_initcall_start = .;
|
||||||
|
KEEP(*(.initcalluavobj.init))
|
||||||
|
. = ALIGN(4);
|
||||||
|
__uavobj_initcall_end = .;
|
||||||
|
} > BL_FLASH
|
||||||
|
|
||||||
|
.ARM.extab :
|
||||||
|
{
|
||||||
|
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
||||||
|
} > BL_FLASH
|
||||||
|
|
||||||
|
.ARM.exidx :
|
||||||
|
{
|
||||||
|
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
||||||
|
} > BL_FLASH
|
||||||
|
|
||||||
|
. = ALIGN(4);
|
||||||
|
_etext = .;
|
||||||
|
_sidata = .;
|
||||||
|
|
||||||
|
.data : AT (_etext)
|
||||||
|
{
|
||||||
|
_sdata = .;
|
||||||
|
*(.data .data.*)
|
||||||
|
. = ALIGN(4);
|
||||||
|
_edata = . ;
|
||||||
|
} > SRAM
|
||||||
|
|
||||||
|
/* .bss section which is used for uninitialized data */
|
||||||
|
.bss (NOLOAD) :
|
||||||
|
{
|
||||||
|
_sbss = . ;
|
||||||
|
*(.bss .bss.*)
|
||||||
|
*(COMMON)
|
||||||
|
. = ALIGN(4);
|
||||||
|
_ebss = . ;
|
||||||
|
} > SRAM
|
||||||
|
|
||||||
|
. = ALIGN(4);
|
||||||
|
_end = . ;
|
||||||
|
|
||||||
|
/* Stabs debugging sections. */
|
||||||
|
.stab 0 : { *(.stab) }
|
||||||
|
.stabstr 0 : { *(.stabstr) }
|
||||||
|
.stab.excl 0 : { *(.stab.excl) }
|
||||||
|
.stab.exclstr 0 : { *(.stab.exclstr) }
|
||||||
|
.stab.index 0 : { *(.stab.index) }
|
||||||
|
.stab.indexstr 0 : { *(.stab.indexstr) }
|
||||||
|
.comment 0 : { *(.comment) }
|
||||||
|
/* DWARF debug sections.
|
||||||
|
Symbols in the DWARF debugging sections are relative to the beginning
|
||||||
|
of the section so we begin them at 0. */
|
||||||
|
/* DWARF 1 */
|
||||||
|
.debug 0 : { *(.debug) }
|
||||||
|
.line 0 : { *(.line) }
|
||||||
|
/* GNU DWARF 1 extensions */
|
||||||
|
.debug_srcinfo 0 : { *(.debug_srcinfo) }
|
||||||
|
.debug_sfnames 0 : { *(.debug_sfnames) }
|
||||||
|
/* DWARF 1.1 and DWARF 2 */
|
||||||
|
.debug_aranges 0 : { *(.debug_aranges) }
|
||||||
|
.debug_pubnames 0 : { *(.debug_pubnames) }
|
||||||
|
/* DWARF 2 */
|
||||||
|
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
|
||||||
|
.debug_abbrev 0 : { *(.debug_abbrev) }
|
||||||
|
.debug_line 0 : { *(.debug_line) }
|
||||||
|
.debug_frame 0 : { *(.debug_frame) }
|
||||||
|
.debug_str 0 : { *(.debug_str) }
|
||||||
|
.debug_loc 0 : { *(.debug_loc) }
|
||||||
|
.debug_macinfo 0 : { *(.debug_macinfo) }
|
||||||
|
/* SGI/MIPS DWARF 2 extensions */
|
||||||
|
.debug_weaknames 0 : { *(.debug_weaknames) }
|
||||||
|
.debug_funcnames 0 : { *(.debug_funcnames) }
|
||||||
|
.debug_typenames 0 : { *(.debug_typenames) }
|
||||||
|
.debug_varnames 0 : { *(.debug_varnames) }
|
||||||
|
}
|
@ -1,64 +0,0 @@
|
|||||||
MEMORY
|
|
||||||
{
|
|
||||||
FLASH (rx) : ORIGIN = 0x08003000, LENGTH = 116K
|
|
||||||
SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00005000
|
|
||||||
}
|
|
||||||
|
|
||||||
_estack = 0x20004FF0;
|
|
||||||
|
|
||||||
/* Section Definitions */
|
|
||||||
SECTIONS
|
|
||||||
{
|
|
||||||
.text :
|
|
||||||
{
|
|
||||||
KEEP(*(.isr_vector .isr_vector.*))
|
|
||||||
*(.text .text.* .gnu.linkonce.t.*)
|
|
||||||
*(.glue_7t) *(.glue_7)
|
|
||||||
*(.rodata .rodata* .gnu.linkonce.r.*)
|
|
||||||
} > FLASH
|
|
||||||
|
|
||||||
/* init sections */
|
|
||||||
.initcalluavobj.init :
|
|
||||||
{
|
|
||||||
. = ALIGN(4);
|
|
||||||
__uavobj_initcall_start = .;
|
|
||||||
KEEP(*(.initcalluavobj.init))
|
|
||||||
. = ALIGN(4);
|
|
||||||
__uavobj_initcall_end = .;
|
|
||||||
} >FLASH
|
|
||||||
|
|
||||||
.ARM.extab :
|
|
||||||
{
|
|
||||||
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
|
||||||
} > FLASH
|
|
||||||
|
|
||||||
.ARM.exidx :
|
|
||||||
{
|
|
||||||
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
|
||||||
} > FLASH
|
|
||||||
|
|
||||||
. = ALIGN(4);
|
|
||||||
_etext = .;
|
|
||||||
_sidata = .;
|
|
||||||
|
|
||||||
.data : AT (_etext)
|
|
||||||
{
|
|
||||||
_sdata = .;
|
|
||||||
*(.data .data.*)
|
|
||||||
. = ALIGN(4);
|
|
||||||
_edata = . ;
|
|
||||||
} > SRAM
|
|
||||||
|
|
||||||
/* .bss section which is used for uninitialized data */
|
|
||||||
.bss (NOLOAD) :
|
|
||||||
{
|
|
||||||
_sbss = . ;
|
|
||||||
*(.bss .bss.*)
|
|
||||||
*(COMMON)
|
|
||||||
. = ALIGN(4);
|
|
||||||
_ebss = . ;
|
|
||||||
} > SRAM
|
|
||||||
|
|
||||||
. = ALIGN(4);
|
|
||||||
_end = . ;
|
|
||||||
}
|
|
@ -1,64 +0,0 @@
|
|||||||
MEMORY
|
|
||||||
{
|
|
||||||
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 0x00020000
|
|
||||||
SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00005000
|
|
||||||
}
|
|
||||||
|
|
||||||
_estack = 0x20004FF0;
|
|
||||||
|
|
||||||
/* Section Definitions */
|
|
||||||
SECTIONS
|
|
||||||
{
|
|
||||||
.text :
|
|
||||||
{
|
|
||||||
KEEP(*(.isr_vector .isr_vector.*))
|
|
||||||
*(.text .text.* .gnu.linkonce.t.*)
|
|
||||||
*(.glue_7t) *(.glue_7)
|
|
||||||
*(.rodata .rodata* .gnu.linkonce.r.*)
|
|
||||||
} > FLASH
|
|
||||||
|
|
||||||
/* init sections */
|
|
||||||
.initcalluavobj.init :
|
|
||||||
{
|
|
||||||
. = ALIGN(4);
|
|
||||||
__uavobj_initcall_start = .;
|
|
||||||
KEEP(*(.initcalluavobj.init))
|
|
||||||
. = ALIGN(4);
|
|
||||||
__uavobj_initcall_end = .;
|
|
||||||
} >FLASH
|
|
||||||
|
|
||||||
.ARM.extab :
|
|
||||||
{
|
|
||||||
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
|
||||||
} > FLASH
|
|
||||||
|
|
||||||
.ARM.exidx :
|
|
||||||
{
|
|
||||||
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
|
||||||
} > FLASH
|
|
||||||
|
|
||||||
. = ALIGN(4);
|
|
||||||
_etext = .;
|
|
||||||
_sidata = .;
|
|
||||||
|
|
||||||
.data : AT (_etext)
|
|
||||||
{
|
|
||||||
_sdata = .;
|
|
||||||
*(.data .data.*)
|
|
||||||
. = ALIGN(4);
|
|
||||||
_edata = . ;
|
|
||||||
} > SRAM
|
|
||||||
|
|
||||||
/* .bss section which is used for uninitialized data */
|
|
||||||
.bss (NOLOAD) :
|
|
||||||
{
|
|
||||||
_sbss = . ;
|
|
||||||
*(.bss .bss.*)
|
|
||||||
*(COMMON)
|
|
||||||
. = ALIGN(4);
|
|
||||||
_ebss = . ;
|
|
||||||
} > SRAM
|
|
||||||
|
|
||||||
. = ALIGN(4);
|
|
||||||
_end = . ;
|
|
||||||
}
|
|
6
flight/PiOS/STM32F10x/link_STM32103CB_CC_Rev1_memory.ld
Normal file
6
flight/PiOS/STM32F10x/link_STM32103CB_CC_Rev1_memory.ld
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
MEMORY
|
||||||
|
{
|
||||||
|
BL_FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 12K
|
||||||
|
FLASH (rx) : ORIGIN = 0x08000000 + 12K, LENGTH = 128K - 12K
|
||||||
|
SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 20K
|
||||||
|
}
|
97
flight/PiOS/STM32F10x/link_STM32103CB_CC_Rev1_sections.ld
Normal file
97
flight/PiOS/STM32F10x/link_STM32103CB_CC_Rev1_sections.ld
Normal file
@ -0,0 +1,97 @@
|
|||||||
|
/* Stub out these functions since we don't use them anyway */
|
||||||
|
PROVIDE ( vPortSVCHandler = 0 ) ;
|
||||||
|
PROVIDE ( xPortPendSVHandler = 0 ) ;
|
||||||
|
PROVIDE ( xPortSysTickHandler = 0 ) ;
|
||||||
|
|
||||||
|
_estack = 0x20004FF0;
|
||||||
|
|
||||||
|
/* Section Definitions */
|
||||||
|
SECTIONS
|
||||||
|
{
|
||||||
|
.text :
|
||||||
|
{
|
||||||
|
KEEP(*(.isr_vector .isr_vector.*))
|
||||||
|
*(.text .text.* .gnu.linkonce.t.*)
|
||||||
|
*(.glue_7t) *(.glue_7)
|
||||||
|
*(.rodata .rodata* .gnu.linkonce.r.*)
|
||||||
|
} > FLASH
|
||||||
|
|
||||||
|
/* init sections */
|
||||||
|
.initcalluavobj.init :
|
||||||
|
{
|
||||||
|
. = ALIGN(4);
|
||||||
|
__uavobj_initcall_start = .;
|
||||||
|
KEEP(*(.initcalluavobj.init))
|
||||||
|
. = ALIGN(4);
|
||||||
|
__uavobj_initcall_end = .;
|
||||||
|
} >FLASH
|
||||||
|
|
||||||
|
.ARM.extab :
|
||||||
|
{
|
||||||
|
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
||||||
|
} > FLASH
|
||||||
|
|
||||||
|
.ARM.exidx :
|
||||||
|
{
|
||||||
|
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
||||||
|
} > FLASH
|
||||||
|
|
||||||
|
. = ALIGN(4);
|
||||||
|
_etext = .;
|
||||||
|
_sidata = .;
|
||||||
|
|
||||||
|
.data : AT (_etext)
|
||||||
|
{
|
||||||
|
_sdata = .;
|
||||||
|
*(.data .data.*)
|
||||||
|
. = ALIGN(4);
|
||||||
|
_edata = . ;
|
||||||
|
} > SRAM
|
||||||
|
|
||||||
|
/* .bss section which is used for uninitialized data */
|
||||||
|
.bss (NOLOAD) :
|
||||||
|
{
|
||||||
|
_sbss = . ;
|
||||||
|
*(.bss .bss.*)
|
||||||
|
*(COMMON)
|
||||||
|
. = ALIGN(4);
|
||||||
|
_ebss = . ;
|
||||||
|
} > SRAM
|
||||||
|
|
||||||
|
. = ALIGN(4);
|
||||||
|
_end = . ;
|
||||||
|
|
||||||
|
/* Stabs debugging sections. */
|
||||||
|
.stab 0 : { *(.stab) }
|
||||||
|
.stabstr 0 : { *(.stabstr) }
|
||||||
|
.stab.excl 0 : { *(.stab.excl) }
|
||||||
|
.stab.exclstr 0 : { *(.stab.exclstr) }
|
||||||
|
.stab.index 0 : { *(.stab.index) }
|
||||||
|
.stab.indexstr 0 : { *(.stab.indexstr) }
|
||||||
|
.comment 0 : { *(.comment) }
|
||||||
|
/* DWARF debug sections.
|
||||||
|
Symbols in the DWARF debugging sections are relative to the beginning
|
||||||
|
of the section so we begin them at 0. */
|
||||||
|
/* DWARF 1 */
|
||||||
|
.debug 0 : { *(.debug) }
|
||||||
|
.line 0 : { *(.line) }
|
||||||
|
/* GNU DWARF 1 extensions */
|
||||||
|
.debug_srcinfo 0 : { *(.debug_srcinfo) }
|
||||||
|
.debug_sfnames 0 : { *(.debug_sfnames) }
|
||||||
|
/* DWARF 1.1 and DWARF 2 */
|
||||||
|
.debug_aranges 0 : { *(.debug_aranges) }
|
||||||
|
.debug_pubnames 0 : { *(.debug_pubnames) }
|
||||||
|
/* DWARF 2 */
|
||||||
|
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
|
||||||
|
.debug_abbrev 0 : { *(.debug_abbrev) }
|
||||||
|
.debug_line 0 : { *(.debug_line) }
|
||||||
|
.debug_frame 0 : { *(.debug_frame) }
|
||||||
|
.debug_str 0 : { *(.debug_str) }
|
||||||
|
.debug_loc 0 : { *(.debug_loc) }
|
||||||
|
.debug_macinfo 0 : { *(.debug_macinfo) }
|
||||||
|
/* SGI/MIPS DWARF 2 extensions */
|
||||||
|
.debug_weaknames 0 : { *(.debug_weaknames) }
|
||||||
|
.debug_funcnames 0 : { *(.debug_funcnames) }
|
||||||
|
.debug_typenames 0 : { *(.debug_typenames) }
|
||||||
|
.debug_varnames 0 : { *(.debug_varnames) }
|
||||||
|
}
|
@ -1,8 +1,7 @@
|
|||||||
MEMORY
|
/* Stub out these functions since we don't use them anyway */
|
||||||
{
|
PROVIDE ( vPortSVCHandler = 0 ) ;
|
||||||
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 0x00020000
|
PROVIDE ( xPortPendSVHandler = 0 ) ;
|
||||||
SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00005000
|
PROVIDE ( xPortSysTickHandler = 0 ) ;
|
||||||
}
|
|
||||||
|
|
||||||
_estack = 0x20004FF0;
|
_estack = 0x20004FF0;
|
||||||
|
|
||||||
@ -15,17 +14,17 @@ SECTIONS
|
|||||||
*(.text .text.* .gnu.linkonce.t.*)
|
*(.text .text.* .gnu.linkonce.t.*)
|
||||||
*(.glue_7t) *(.glue_7)
|
*(.glue_7t) *(.glue_7)
|
||||||
*(.rodata .rodata* .gnu.linkonce.r.*)
|
*(.rodata .rodata* .gnu.linkonce.r.*)
|
||||||
} > FLASH
|
} > BL_FLASH
|
||||||
|
|
||||||
.ARM.extab :
|
.ARM.extab :
|
||||||
{
|
{
|
||||||
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
||||||
} > FLASH
|
} > BL_FLASH
|
||||||
|
|
||||||
.ARM.exidx :
|
.ARM.exidx :
|
||||||
{
|
{
|
||||||
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
||||||
} > FLASH
|
} > BL_FLASH
|
||||||
|
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
_etext = .;
|
_etext = .;
|
@ -0,0 +1,6 @@
|
|||||||
|
MEMORY
|
||||||
|
{
|
||||||
|
BL_FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 12K
|
||||||
|
FLASH (rx) : ORIGIN = 0x08000000 + 12K, LENGTH = 128K - 12K
|
||||||
|
SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 20K
|
||||||
|
}
|
@ -1,8 +1,7 @@
|
|||||||
MEMORY
|
/* Stub out these functions since we don't use them anyway */
|
||||||
{
|
PROVIDE ( vPortSVCHandler = 0 ) ;
|
||||||
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 0x00020000
|
PROVIDE ( xPortPendSVHandler = 0 ) ;
|
||||||
SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00005000
|
PROVIDE ( xPortSysTickHandler = 0 ) ;
|
||||||
}
|
|
||||||
|
|
||||||
_estack = 0x20004FF0;
|
_estack = 0x20004FF0;
|
||||||
|
|
@ -1,41 +1,3 @@
|
|||||||
/**
|
|
||||||
******************************************************************************
|
|
||||||
*
|
|
||||||
* @file link_stm32f10x_HD_NB.ld
|
|
||||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2009.
|
|
||||||
* @brief PiOS linker for the OpenPilot board
|
|
||||||
* @see The GNU Public License (GPL) Version 3
|
|
||||||
*
|
|
||||||
*****************************************************************************/
|
|
||||||
/*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but
|
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
||||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along
|
|
||||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/* Memory Spaces Definitions */
|
|
||||||
MEMORY
|
|
||||||
{
|
|
||||||
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K
|
|
||||||
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K
|
|
||||||
FLASHB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
|
||||||
EXTMEMB0 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
|
||||||
EXTMEMB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
|
||||||
EXTMEMB2 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
|
||||||
EXTMEMB3 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
|
||||||
}
|
|
||||||
|
|
||||||
/* This is the size of the stack for early init and for all FreeRTOS IRQs */
|
/* This is the size of the stack for early init and for all FreeRTOS IRQs */
|
||||||
_irq_stack_size = 0x400;
|
_irq_stack_size = 0x400;
|
||||||
|
|
||||||
@ -59,10 +21,10 @@ PROVIDE ( HardFault_Handler = 0 ) ;
|
|||||||
PROVIDE ( MemManage_Handler = 0 ) ;
|
PROVIDE ( MemManage_Handler = 0 ) ;
|
||||||
PROVIDE ( BusFault_Handler = 0 ) ;
|
PROVIDE ( BusFault_Handler = 0 ) ;
|
||||||
PROVIDE ( UsageFault_Handler = 0 ) ;
|
PROVIDE ( UsageFault_Handler = 0 ) ;
|
||||||
PROVIDE ( SVC_Handler = 0 ) ;
|
PROVIDE ( vPortSVCHandler = 0 ) ;
|
||||||
PROVIDE ( DebugMon_Handler = 0 ) ;
|
PROVIDE ( DebugMon_Handler = 0 ) ;
|
||||||
PROVIDE ( PendSV_Handler = 0 ) ;
|
PROVIDE ( xPortPendSVHandler = 0 ) ;
|
||||||
PROVIDE ( SysTick_Handler = 0 ) ;
|
PROVIDE ( xPortSysTickHandler = 0 ) ;
|
||||||
|
|
||||||
PROVIDE ( WWDG_IRQHandler = 0 ) ;
|
PROVIDE ( WWDG_IRQHandler = 0 ) ;
|
||||||
PROVIDE ( PVD_IRQHandler = 0 ) ;
|
PROVIDE ( PVD_IRQHandler = 0 ) ;
|
||||||
@ -207,7 +169,7 @@ SECTIONS
|
|||||||
{
|
{
|
||||||
KEEP(*(.isr_vector)) /* Startup code */
|
KEEP(*(.isr_vector)) /* Startup code */
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
} >FLASH
|
} > BL_FLASH
|
||||||
|
|
||||||
/* for some STRx devices, the beginning of the startup code is stored in the .flashtext section, which goes to FLASH */
|
/* for some STRx devices, the beginning of the startup code is stored in the .flashtext section, which goes to FLASH */
|
||||||
.flashtext :
|
.flashtext :
|
||||||
@ -215,7 +177,7 @@ SECTIONS
|
|||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
*(.flashtext) /* Startup code */
|
*(.flashtext) /* Startup code */
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
} >FLASH
|
} > BL_FLASH
|
||||||
|
|
||||||
|
|
||||||
/* init sections */
|
/* init sections */
|
||||||
@ -226,7 +188,7 @@ SECTIONS
|
|||||||
KEEP(*(.initcalluavobj.init))
|
KEEP(*(.initcalluavobj.init))
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
__uavobj_initcall_end = .;
|
__uavobj_initcall_end = .;
|
||||||
} >FLASH
|
} > BL_FLASH
|
||||||
|
|
||||||
/* the program code is stored in the .text section, which goes to Flash */
|
/* the program code is stored in the .text section, which goes to Flash */
|
||||||
.text :
|
.text :
|
||||||
@ -244,7 +206,7 @@ SECTIONS
|
|||||||
_etext = .;
|
_etext = .;
|
||||||
/* This is used by the startup in order to initialize the .data secion */
|
/* This is used by the startup in order to initialize the .data secion */
|
||||||
_sidata = _etext;
|
_sidata = _etext;
|
||||||
} >FLASH
|
} > BL_FLASH
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
11
flight/PiOS/STM32F10x/link_STM3210E_OP_memory.ld
Normal file
11
flight/PiOS/STM32F10x/link_STM3210E_OP_memory.ld
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
MEMORY
|
||||||
|
{
|
||||||
|
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K
|
||||||
|
BL_FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 20K
|
||||||
|
FLASH (rx) : ORIGIN = 0x08000000 + 20K, LENGTH = 512K - 20K
|
||||||
|
FLASHB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
||||||
|
EXTMEMB0 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
||||||
|
EXTMEMB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
||||||
|
EXTMEMB2 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
||||||
|
EXTMEMB3 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
||||||
|
}
|
@ -1,41 +1,3 @@
|
|||||||
/**
|
|
||||||
******************************************************************************
|
|
||||||
*
|
|
||||||
* @file link_stm32f10x_HD_BL.ld
|
|
||||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2009.
|
|
||||||
* @brief PiOS linker for the OpenPilot board
|
|
||||||
* @see The GNU Public License (GPL) Version 3
|
|
||||||
*
|
|
||||||
*****************************************************************************/
|
|
||||||
/*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but
|
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
||||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along
|
|
||||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/* Memory Spaces Definitions */
|
|
||||||
MEMORY
|
|
||||||
{
|
|
||||||
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K
|
|
||||||
FLASH (rx) : ORIGIN = 0x08005000, LENGTH = 492K
|
|
||||||
FLASHB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
|
||||||
EXTMEMB0 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
|
||||||
EXTMEMB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
|
||||||
EXTMEMB2 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
|
||||||
EXTMEMB3 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
|
||||||
}
|
|
||||||
|
|
||||||
/* This is the size of the stack for early init and for all FreeRTOS IRQs */
|
/* This is the size of the stack for early init and for all FreeRTOS IRQs */
|
||||||
_irq_stack_size = 0x400;
|
_irq_stack_size = 0x400;
|
||||||
|
|
||||||
@ -59,10 +21,10 @@ PROVIDE ( HardFault_Handler = 0 ) ;
|
|||||||
PROVIDE ( MemManage_Handler = 0 ) ;
|
PROVIDE ( MemManage_Handler = 0 ) ;
|
||||||
PROVIDE ( BusFault_Handler = 0 ) ;
|
PROVIDE ( BusFault_Handler = 0 ) ;
|
||||||
PROVIDE ( UsageFault_Handler = 0 ) ;
|
PROVIDE ( UsageFault_Handler = 0 ) ;
|
||||||
PROVIDE ( SVC_Handler = 0 ) ;
|
PROVIDE ( vPortSVCHandler = 0 ) ;
|
||||||
PROVIDE ( DebugMon_Handler = 0 ) ;
|
PROVIDE ( DebugMon_Handler = 0 ) ;
|
||||||
PROVIDE ( PendSV_Handler = 0 ) ;
|
PROVIDE ( xPortPendSVHandler = 0 ) ;
|
||||||
PROVIDE ( SysTick_Handler = 0 ) ;
|
PROVIDE ( xPortSysTickHandler = 0 ) ;
|
||||||
|
|
||||||
PROVIDE ( WWDG_IRQHandler = 0 ) ;
|
PROVIDE ( WWDG_IRQHandler = 0 ) ;
|
||||||
PROVIDE ( PVD_IRQHandler = 0 ) ;
|
PROVIDE ( PVD_IRQHandler = 0 ) ;
|
@ -51,4 +51,38 @@ SECTIONS
|
|||||||
|
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
_end = . ;
|
_end = . ;
|
||||||
|
|
||||||
|
/* Stabs debugging sections. */
|
||||||
|
.stab 0 : { *(.stab) }
|
||||||
|
.stabstr 0 : { *(.stabstr) }
|
||||||
|
.stab.excl 0 : { *(.stab.excl) }
|
||||||
|
.stab.exclstr 0 : { *(.stab.exclstr) }
|
||||||
|
.stab.index 0 : { *(.stab.index) }
|
||||||
|
.stab.indexstr 0 : { *(.stab.indexstr) }
|
||||||
|
.comment 0 : { *(.comment) }
|
||||||
|
/* DWARF debug sections.
|
||||||
|
Symbols in the DWARF debugging sections are relative to the beginning
|
||||||
|
of the section so we begin them at 0. */
|
||||||
|
/* DWARF 1 */
|
||||||
|
.debug 0 : { *(.debug) }
|
||||||
|
.line 0 : { *(.line) }
|
||||||
|
/* GNU DWARF 1 extensions */
|
||||||
|
.debug_srcinfo 0 : { *(.debug_srcinfo) }
|
||||||
|
.debug_sfnames 0 : { *(.debug_sfnames) }
|
||||||
|
/* DWARF 1.1 and DWARF 2 */
|
||||||
|
.debug_aranges 0 : { *(.debug_aranges) }
|
||||||
|
.debug_pubnames 0 : { *(.debug_pubnames) }
|
||||||
|
/* DWARF 2 */
|
||||||
|
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
|
||||||
|
.debug_abbrev 0 : { *(.debug_abbrev) }
|
||||||
|
.debug_line 0 : { *(.debug_line) }
|
||||||
|
.debug_frame 0 : { *(.debug_frame) }
|
||||||
|
.debug_str 0 : { *(.debug_str) }
|
||||||
|
.debug_loc 0 : { *(.debug_loc) }
|
||||||
|
.debug_macinfo 0 : { *(.debug_macinfo) }
|
||||||
|
/* SGI/MIPS DWARF 2 extensions */
|
||||||
|
.debug_weaknames 0 : { *(.debug_weaknames) }
|
||||||
|
.debug_funcnames 0 : { *(.debug_funcnames) }
|
||||||
|
.debug_typenames 0 : { *(.debug_typenames) }
|
||||||
|
.debug_varnames 0 : { *(.debug_varnames) }
|
||||||
}
|
}
|
@ -31,7 +31,6 @@
|
|||||||
#define PIOS_LED_H
|
#define PIOS_LED_H
|
||||||
|
|
||||||
/* Type Definitions */
|
/* Type Definitions */
|
||||||
|
|
||||||
#if (PIOS_LED_NUM == 1)
|
#if (PIOS_LED_NUM == 1)
|
||||||
typedef enum { LED1 = 0 } LedTypeDef;
|
typedef enum { LED1 = 0 } LedTypeDef;
|
||||||
#elif (PIOS_LED_NUM == 2)
|
#elif (PIOS_LED_NUM == 2)
|
||||||
@ -40,6 +39,8 @@ typedef enum { LED1 = 0, LED2 = 1 } LedTypeDef;
|
|||||||
typedef enum { LED1 = 0, LED2 = 1, LED3 = 2 } LedTypeDef;
|
typedef enum { LED1 = 0, LED2 = 1, LED3 = 2 } LedTypeDef;
|
||||||
#elif (PIOS_LED_NUM == 4)
|
#elif (PIOS_LED_NUM == 4)
|
||||||
typedef enum { LED1 = 0, LED2 = 1, LED3 = 2, LED4 = 3 } LedTypeDef;
|
typedef enum { LED1 = 0, LED2 = 1, LED3 = 2, LED4 = 3 } LedTypeDef;
|
||||||
|
#else
|
||||||
|
#error PIOS_LED_NUM not defined
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Public Functions */
|
/* Public Functions */
|
||||||
|
@ -29,9 +29,6 @@ include $(TOP)/make/firmware-defs.mk
|
|||||||
# Debugging (YES/NO) ?
|
# Debugging (YES/NO) ?
|
||||||
DEBUG ?= NO
|
DEBUG ?= NO
|
||||||
|
|
||||||
# Is this code a bootloader (YES/NO) ?
|
|
||||||
USE_BOOTLOADER ?= NO
|
|
||||||
|
|
||||||
# Use Code Sourcery toolchain (YES/NO) ?
|
# Use Code Sourcery toolchain (YES/NO) ?
|
||||||
CODE_SOURCERY ?= YES
|
CODE_SOURCERY ?= YES
|
||||||
|
|
||||||
@ -56,11 +53,6 @@ BOARD = STM32103CB_PIPXTREME
|
|||||||
#CHIP = STM32F103C8T
|
#CHIP = STM32F103C8T
|
||||||
#BOARD = STM32103C8_PIPXTREME
|
#BOARD = STM32103C8_PIPXTREME
|
||||||
MODEL = MD
|
MODEL = MD
|
||||||
ifeq ($(USE_BOOTLOADER), YES)
|
|
||||||
BOOT_MODEL = $(MODEL)_BL
|
|
||||||
else
|
|
||||||
BOOT_MODEL = $(MODEL)_NB
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.)
|
# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.)
|
||||||
OUTDIR = $(TOP)/build/pipxtreme
|
OUTDIR = $(TOP)/build/pipxtreme
|
||||||
@ -265,9 +257,7 @@ DEBUGF = dwarf-2
|
|||||||
CDEFS = -DSTM32F10X_$(MODEL)
|
CDEFS = -DSTM32F10X_$(MODEL)
|
||||||
CDEFS += -DUSE_STDPERIPH_DRIVER
|
CDEFS += -DUSE_STDPERIPH_DRIVER
|
||||||
CDEFS += -DUSE_$(BOARD)
|
CDEFS += -DUSE_$(BOARD)
|
||||||
ifeq ($(USE_BOOTLOADER), YES)
|
|
||||||
CDEFS += -DUSE_BOOTLOADER
|
CDEFS += -DUSE_BOOTLOADER
|
||||||
endif
|
|
||||||
|
|
||||||
# Place project-specific -D and/or -U options for
|
# Place project-specific -D and/or -U options for
|
||||||
# Assembler with preprocessor here.
|
# Assembler with preprocessor here.
|
||||||
@ -347,13 +337,14 @@ LDFLAGS += $(MATH_LIB)
|
|||||||
LDFLAGS += -lc -lgcc
|
LDFLAGS += -lc -lgcc
|
||||||
|
|
||||||
# Set linker-script name depending on selected submodel name
|
# Set linker-script name depending on selected submodel name
|
||||||
LDFLAGS +=-T$(LINKERSCRIPTPATH)/link_$(BOARD)_$(BOOT_MODEL).ld
|
LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_memory.ld
|
||||||
|
LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_sections.ld
|
||||||
|
|
||||||
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
|
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).bin
|
||||||
# Program
|
# Program
|
||||||
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
|
OOCD_CL+=-c "flash write_image erase $(OOCD_LOADFILE) 0x08003000 bin"
|
||||||
# Verify
|
# Verify
|
||||||
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
|
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE) 0x08003000 bin"
|
||||||
# reset target
|
# reset target
|
||||||
OOCD_CL+=-c "reset run"
|
OOCD_CL+=-c "reset run"
|
||||||
# terminate OOCD after programming
|
# terminate OOCD after programming
|
||||||
@ -395,19 +386,12 @@ endif
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# Program the device.
|
# Program the device.
|
||||||
ifeq ($(USE_BOOTLOADER), YES)
|
|
||||||
# Program the device with OP Upload Tool".
|
|
||||||
program: $(OUTDIR)/$(TARGET).bin
|
|
||||||
@echo ${quote}Programming with OP Upload Tool${quote}
|
|
||||||
../../ground/src/experimental/upload-build-desktop/debug/OPUploadTool -d 1 -p $(OUTDIR)/$(TARGET).bin
|
|
||||||
else
|
|
||||||
ifeq ($(FLASH_TOOL),OPENOCD)
|
ifeq ($(FLASH_TOOL),OPENOCD)
|
||||||
# Program the device with Dominic Rath's OPENOCD in "batch-mode", needs cfg and "reset-script".
|
# Program the device with Dominic Rath's OPENOCD in "batch-mode", needs cfg and "reset-script".
|
||||||
program: $(OUTDIR)/$(TARGET).elf
|
program: $(OUTDIR)/$(TARGET).bin
|
||||||
@echo ${quote}Programming with OPENOCD${quote}
|
@echo ${quote}Programming with OPENOCD${quote}
|
||||||
$(OOCD_EXE) $(OOCD_CL)
|
$(OOCD_EXE) $(OOCD_CL)
|
||||||
endif
|
endif
|
||||||
endif
|
|
||||||
|
|
||||||
# Link: create ELF output file from object files.
|
# Link: create ELF output file from object files.
|
||||||
$(eval $(call LINK_TEMPLATE, $(OUTDIR)/$(TARGET).elf, $(ALLOBJ)))
|
$(eval $(call LINK_TEMPLATE, $(OUTDIR)/$(TARGET).elf, $(ALLOBJ)))
|
||||||
@ -436,12 +420,15 @@ $(eval $(call PARTIAL_COMPILE_TEMPLATE, SRC))
|
|||||||
# Compile: create assembler files from C source files. ARM only
|
# Compile: create assembler files from C source files. ARM only
|
||||||
$(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM))
|
$(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM))
|
||||||
|
|
||||||
.PHONY: elf lss sym hex bin
|
$(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin
|
||||||
|
|
||||||
|
.PHONY: elf lss sym hex bin bino
|
||||||
elf: $(OUTDIR)/$(TARGET).elf
|
elf: $(OUTDIR)/$(TARGET).elf
|
||||||
lss: $(OUTDIR)/$(TARGET).lss
|
lss: $(OUTDIR)/$(TARGET).lss
|
||||||
sym: $(OUTDIR)/$(TARGET).sym
|
sym: $(OUTDIR)/$(TARGET).sym
|
||||||
hex: $(OUTDIR)/$(TARGET).hex
|
hex: $(OUTDIR)/$(TARGET).hex
|
||||||
bin: $(OUTDIR)/$(TARGET).bin
|
bin: $(OUTDIR)/$(TARGET).bin
|
||||||
|
bino: $(OUTDIR)/$(TARGET).bin.o
|
||||||
|
|
||||||
# Display sizes of sections.
|
# Display sizes of sections.
|
||||||
$(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf))
|
$(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf))
|
||||||
@ -463,6 +450,7 @@ clean_list :
|
|||||||
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).bin
|
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).bin
|
||||||
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).sym
|
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).sym
|
||||||
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).lss
|
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).lss
|
||||||
|
$(V1) $(REMOVE) $(OUTDIR)/$(TARGET).bin.o
|
||||||
$(V1) $(REMOVE) $(ALLOBJ)
|
$(V1) $(REMOVE) $(ALLOBJ)
|
||||||
$(V1) $(REMOVE) $(LSTFILES)
|
$(V1) $(REMOVE) $(LSTFILES)
|
||||||
$(V1) $(REMOVE) $(DEPFILES)
|
$(V1) $(REMOVE) $(DEPFILES)
|
||||||
|
38
flight/Project/gdb/bl_coptercontrol
Normal file
38
flight/Project/gdb/bl_coptercontrol
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
define connect
|
||||||
|
target remote localhost:3333
|
||||||
|
monitor cortex_m3 vector_catch all
|
||||||
|
file ./build/bl_coptercontrol/CopterControl_BL.elf
|
||||||
|
end
|
||||||
|
#monitor reset halt
|
||||||
|
|
||||||
|
define hook-step
|
||||||
|
monitor cortex_m3 maskisr on
|
||||||
|
end
|
||||||
|
define hookpost-step
|
||||||
|
monitor cortex_m3 maskisr off
|
||||||
|
end
|
||||||
|
|
||||||
|
define hook-stepi
|
||||||
|
monitor cortex_m3 maskisr on
|
||||||
|
end
|
||||||
|
|
||||||
|
define hookpost-stepi
|
||||||
|
monitor cortex_m3 maskisr off
|
||||||
|
end
|
||||||
|
|
||||||
|
define hook-next
|
||||||
|
monitor cortex_m3 maskisr on
|
||||||
|
end
|
||||||
|
|
||||||
|
define hookpost-next
|
||||||
|
monitor cortex_m3 maskisr off
|
||||||
|
end
|
||||||
|
|
||||||
|
define hook-finish
|
||||||
|
monitor cortex_m3 maskisr on
|
||||||
|
end
|
||||||
|
|
||||||
|
define hookpost-finish
|
||||||
|
monitor cortex_m3 maskisr off
|
||||||
|
end
|
||||||
|
|
@ -919,9 +919,9 @@ Neutral should be put at the bottom of the slider for the throttle.</string>
|
|||||||
<widget class="QLabel" name="RCInputConnected">
|
<widget class="QLabel" name="RCInputConnected">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>270</x>
|
<x>260</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>251</width>
|
<width>291</width>
|
||||||
<height>41</height>
|
<height>41</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@ -968,7 +968,7 @@ Neutral should be put at the bottom of the slider for the throttle.</string>
|
|||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>RC Receiver Type:</string>
|
<string>Receiver Type:</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="alignment">
|
<property name="alignment">
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
@ -9,6 +9,7 @@ OBJCOPY = $(TCHAIN_PREFIX)objcopy
|
|||||||
OBJDUMP = $(TCHAIN_PREFIX)objdump
|
OBJDUMP = $(TCHAIN_PREFIX)objdump
|
||||||
SIZE = $(TCHAIN_PREFIX)size
|
SIZE = $(TCHAIN_PREFIX)size
|
||||||
NM = $(TCHAIN_PREFIX)nm
|
NM = $(TCHAIN_PREFIX)nm
|
||||||
|
STRIP = $(TCHAIN_PREFIX)strip
|
||||||
|
|
||||||
THUMB = -mthumb
|
THUMB = -mthumb
|
||||||
|
|
||||||
@ -27,6 +28,8 @@ MSG_FORMATERROR := ${quote} Can not handle output-format${quote}
|
|||||||
MSG_MODINIT := ${quote} MODINIT ${quote}
|
MSG_MODINIT := ${quote} MODINIT ${quote}
|
||||||
MSG_SIZE := ${quote} SIZE ${quote}
|
MSG_SIZE := ${quote} SIZE ${quote}
|
||||||
MSG_LOAD_FILE := ${quote} BIN/HEX ${quote}
|
MSG_LOAD_FILE := ${quote} BIN/HEX ${quote}
|
||||||
|
MSG_BIN_OBJ := ${quote} BINO ${quote}
|
||||||
|
MSG_STRIP_FILE := ${quote} STRIP ${quote}
|
||||||
MSG_EXTENDED_LISTING := ${quote} LIS ${quote}
|
MSG_EXTENDED_LISTING := ${quote} LIS ${quote}
|
||||||
MSG_SYMBOL_TABLE := ${quote} NM ${quote}
|
MSG_SYMBOL_TABLE := ${quote} NM ${quote}
|
||||||
MSG_LINKING := ${quote} LD ${quote}
|
MSG_LINKING := ${quote} LD ${quote}
|
||||||
@ -53,11 +56,26 @@ gccversion :
|
|||||||
@echo $(MSG_LOAD_FILE) $(call toprel, $@)
|
@echo $(MSG_LOAD_FILE) $(call toprel, $@)
|
||||||
$(V1) $(OBJCOPY) -O ihex $< $@
|
$(V1) $(OBJCOPY) -O ihex $< $@
|
||||||
|
|
||||||
|
# Create stripped output file (.elf.stripped) from ELF output file.
|
||||||
|
%.elf.stripped: %.elf
|
||||||
|
@echo $(MSG_STRIP_FILE) $(call toprel, $@)
|
||||||
|
$(V1) $(STRIP) --strip-unneeded $< -o $@
|
||||||
|
|
||||||
# Create final output file (.bin) from ELF output file.
|
# Create final output file (.bin) from ELF output file.
|
||||||
%.bin: %.elf
|
%.bin: %.elf
|
||||||
@echo $(MSG_LOAD_FILE) $(call toprel, $@)
|
@echo $(MSG_LOAD_FILE) $(call toprel, $@)
|
||||||
$(V1) $(OBJCOPY) -O binary $< $@
|
$(V1) $(OBJCOPY) -O binary $< $@
|
||||||
|
|
||||||
|
%.bin.o: %.bin
|
||||||
|
@echo $(MSG_BIN_OBJ) $(call toprel, $@)
|
||||||
|
$(V1) $(OBJCOPY) -I binary -O elf32-littlearm --binary-architecture arm \
|
||||||
|
--rename-section .data=.rodata,alloc,load,readonly,data,contents \
|
||||||
|
--wildcard \
|
||||||
|
--redefine-sym _binary_$(subst :,_,$(subst -,_,$(subst .,_,$(subst /,_,$<))))_start=_binary_start \
|
||||||
|
--redefine-sym _binary_$(subst :,_,$(subst -,_,$(subst .,_,$(subst /,_,$<))))_end=_binary_end \
|
||||||
|
--redefine-sym _binary_$(subst :,_,$(subst -,_,$(subst .,_,$(subst /,_,$<))))_size=_binary_size \
|
||||||
|
$< $@
|
||||||
|
|
||||||
# Create extended listing file/disassambly from ELF output file.
|
# Create extended listing file/disassambly from ELF output file.
|
||||||
# using objdump testing: option -C
|
# using objdump testing: option -C
|
||||||
%.lss: %.elf
|
%.lss: %.elf
|
||||||
@ -144,10 +162,9 @@ $($(1):.c=.s) : %.s : %.c
|
|||||||
endef
|
endef
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# # Options for OpenOCD flash-programming
|
# Options for OpenOCD flash-programming
|
||||||
# see openocd.pdf/openocd.texi for further information
|
# see openocd.pdf/openocd.texi for further information
|
||||||
# #
|
|
||||||
# OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
|
|
||||||
# if OpenOCD is in the $PATH just set OPENOCDEXE=openocd
|
# if OpenOCD is in the $PATH just set OPENOCDEXE=openocd
|
||||||
OOCD_EXE=openocd
|
OOCD_EXE=openocd
|
||||||
# debug level
|
# debug level
|
||||||
@ -162,6 +179,3 @@ OOCD_CL+=-c init
|
|||||||
OOCD_CL+=-c targets
|
OOCD_CL+=-c targets
|
||||||
# commands to prepare flash-write
|
# commands to prepare flash-write
|
||||||
OOCD_CL+= -c "reset halt"
|
OOCD_CL+= -c "reset halt"
|
||||||
# flash erase
|
|
||||||
OOCD_CL+=-c "stm32x mass_erase 0"
|
|
||||||
# flash-write
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user