diff options
author | Marti Bolivar <mbolivar@leaflabs.com> | 2014-04-29 19:56:39 -0700 |
---|---|---|
committer | Marti Bolivar <mbolivar@leaflabs.com> | 2014-04-29 19:56:39 -0700 |
commit | 746d6fecf86572c9fe95dbbffdf541a8d3875dd0 (patch) | |
tree | 8dc7170e295756116dcdc9e973dee028b9cb2454 /Makefile | |
parent | 139e4b1a1ae547540d32aa66d47c4e69b1b57bbf (diff) | |
parent | 731e2ab24755b3706daf7d64eaa53f2ec0512277 (diff) | |
download | librambutan-746d6fecf86572c9fe95dbbffdf541a8d3875dd0.tar.gz librambutan-746d6fecf86572c9fe95dbbffdf541a8d3875dd0.zip |
Merge pull request #89 from Gregwar/bootloader-option
Adding BOOTLOADER option to support Robotis bootloader different ROM
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -32,6 +32,12 @@ BOARD_INCLUDE_DIR := $(MAKEDIR)/board-includes BOARD ?= maple MEMORY_TARGET ?= flash +# Chooses the bootloader, available: maple and robotis +BOOTLOADER ?= maple + +# This is the serial port used by robotis bootloader +ROBOTIS_PORT ?= /dev/ttyACM0 + # $(BOARD)- and $(MEMORY_TARGET)-specific configuration include $(MAKEDIR)/target-config.mk @@ -56,7 +62,8 @@ TARGET_FLAGS += -I$(LIBMAPLE_PATH)/include/libmaple \ TARGET_FLAGS += -I$(LIBRARIES_PATH) # for internal lib. includes, e.g. <Wire/WireBase.h> GLOBAL_CFLAGS := -Os -g3 -gdwarf-2 -nostdlib \ -ffunction-sections -fdata-sections \ - -Wl,--gc-sections $(TARGET_FLAGS) + -Wl,--gc-sections $(TARGET_FLAGS) \ + -DBOOTLOADER_$(BOOTLOADER) GLOBAL_CXXFLAGS := -fno-rtti -fno-exceptions -Wall $(TARGET_FLAGS) GLOBAL_ASFLAGS := -x assembler-with-cpp $(TARGET_FLAGS) LDFLAGS = $(TARGET_LDFLAGS) $(TOOLCHAIN_LDFLAGS) -mcpu=cortex-m3 -mthumb \ @@ -101,12 +108,19 @@ include $(SRCROOT)/build-targets.mk # USB ID for DFU upload -- FIXME: do something smarter with this BOARD_USB_VENDOR_ID := 1EAF BOARD_USB_PRODUCT_ID := 0003 + +ifeq ($(BOOTLOADER),maple) UPLOAD_ram := $(SUPPORT_PATH)/scripts/reset.py && \ sleep 1 && \ $(DFU) -a0 -d $(BOARD_USB_VENDOR_ID):$(BOARD_USB_PRODUCT_ID) -D $(BUILD_PATH)/$(BOARD).bin -R UPLOAD_flash := $(SUPPORT_PATH)/scripts/reset.py && \ sleep 1 && \ $(DFU) -a1 -d $(BOARD_USB_VENDOR_ID):$(BOARD_USB_PRODUCT_ID) -D $(BUILD_PATH)/$(BOARD).bin -R +endif + +ifeq ($(BOOTLOADER),robotis) +UPLOAD_flash := $(SUPPORT_PATH)/scripts/robotis-loader.py $(ROBOTIS_PORT) $(BUILD_PATH)/$(BOARD).bin +endif # Conditionally upload to whatever the last build was install: INSTALL_TARGET = $(shell cat $(BUILD_PATH)/build-type 2>/dev/null) |