diff --git a/firmware/bootloader/bootloader.h b/firmware/bootloader/bootloader.h new file mode 100644 index 0000000000..db6b7b25c1 --- /dev/null +++ b/firmware/bootloader/bootloader.h @@ -0,0 +1,17 @@ +#ifndef BOOTLOADER_H_ +#define BOOTLOADER_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Used to trick the linker to include bootloader code into the binary. +*/ +int initBootloader(void); + +#ifdef __cplusplus +} +#endif + +#endif /* BOOTLOADER_H_ */ diff --git a/firmware/bootloader/bootloader.mk b/firmware/bootloader/bootloader.mk new file mode 100644 index 0000000000..d8dbd5af08 --- /dev/null +++ b/firmware/bootloader/bootloader.mk @@ -0,0 +1,16 @@ +# Added if USE_BOOTLOADER=yes in Makefile +BOOTLOADERSRC= $(PROJECT_DIR)/bootloader/bootloader_storage.c + +ifeq ($(BOOTLOADERINC),) + BOOTLOADERINC=$(PROJECT_DIR)/bootloader +endif + +ifeq ($(LDSCRIPT),) + LDSCRIPT= config/stm32f4ems/STM32F407xG_CCM_bootloader.ld +endif + +# Add bootloader code to the firmware +DDEFS += -DEFI_BOOTLOADER_INCLUDE_CODE=TRUE + +# Relocate interrupt vectors for the new application start address +DDEFS += -DCORTEX_VTOR_INIT=0x8000