diff --git a/right/Makefile b/right/Makefile index e0107cf..ec7edf1 100644 --- a/right/Makefile +++ b/right/Makefile @@ -22,16 +22,10 @@ PART = MK22FN512VLH12 # Defines the linker script to use for the application. LDSCRIPT = link/MK22FN512xxx12_flash.ld -# Address of the app vector table. The bootloader will take up the flash before this address. -BL_APP_VECTOR_TABLE_ADDRESS = 0xc000 - # Size of the heap and stack. HEAP_SIZE = 0x2000 STACK_SIZE = 0x0400 - # Preprocessor directives. -BUILD_FLAGS = -DCPU_$(PART)_cm4 -DBL_APP_VECTOR_TABLE_ADDRESS=$(BL_APP_VECTOR_TABLE_ADDRESS) -DUSB_STACK_BM -DBL_HAS_BOOTLOADER_CONFIG=1 - # Set the compiler CPU and FPU options. CPU = -mcpu=cortex-m4 FPU = -mfpu=fpv4-sp-d16 -mfloat-abi=hard @@ -39,6 +33,12 @@ FPU = -mfpu=fpv4-sp-d16 -mfloat-abi=hard # Command for flashing the right half of the keyboard. FLASH_CMD = node ../lib/agent/packages/usb/update-device-firmware.js $(PROJECT_OBJ:.axf=.hex) +# Preprocessor directives. +BUILD_FLAGS = -DCPU_$(PART)_cm4 -DUSB_STACK_BM -DBL_HAS_BOOTLOADER_CONFIG=1 + +# Address of the app vector table. The bootloader will take up the flash before this address. +BL_APP_VECTOR_TABLE_ADDRESS = 0xc000 + # Source files. SOURCE = $(wildcard src/*.c) \ $(wildcard src/*/*.c) \ diff --git a/scripts/Makedefs.mk b/scripts/Makedefs.mk index f01f6fc..6b281ea 100644 --- a/scripts/Makedefs.mk +++ b/scripts/Makedefs.mk @@ -19,8 +19,11 @@ SEMIHOSTING ?= 0 # Build directory. BUILD_DIR ?= build_make - # Preprocessor directives. -BUILD_FLAGS += -D__NEWLIB__ -D__USE_CMSIS -D__MCUXPRESSO -DCPU_$(PART) -D__STARTUP_CLEAR_BSS +# Set default value (no bootloader) for the bootloader vector table address. +BL_APP_VECTOR_TABLE_ADDRESS ?= 0 + +# Preprocessor directives. +BUILD_FLAGS += -D__NEWLIB__ -D__USE_CMSIS -D__MCUXPRESSO -DCPU_$(PART) -D__STARTUP_CLEAR_BSS -DBL_APP_VECTOR_TABLE_ADDRESS=$(BL_APP_VECTOR_TABLE_ADDRESS) # Path to project object file. PROJECT_OBJ = $(BUILD_DIR)/$(PROJECT_NAME).axf @@ -86,9 +89,6 @@ ifdef TRAVIS CFLAGS += -Werror endif -# Set default value for the bootloader vector table address. -BL_APP_VECTOR_TABLE_ADDRESS ?= 0 - # The flags passed to the linker. LDFLAGS = --specs=nano.specs -mthumb $(CPU) $(FPU) -T $(LDSCRIPT) -Wl,-Map=$(PROJECT_OBJ:.axf=.map),--gc-sections,-print-memory-usage,-no-wchar-size-warning,--defsym=__heap_size__=$(HEAP_SIZE),--defsym=__stack_size__=$(STACK_SIZE),--defsym=__bl_app_vector_table_address__=$(BL_APP_VECTOR_TABLE_ADDRESS)