From 03b58017f98449d3e2f13d6e55f821ceaad1e7ab Mon Sep 17 00:00:00 2001 From: podhrmic Date: Sun, 7 Dec 2014 08:32:47 +0100 Subject: [PATCH] [boards][stm32f4] Lisa MX luftboot support Added support for luftboot-like bootloader for Lisa MX 2.0 and 2.1 (the bootloader itself is in ext repository, this is only support in pprzi code) --- conf/boards/lisa_mx_2.0.makefile | 13 +++++++------ conf/boards/lisa_mx_2.1.makefile | 13 +++++++------ conf/flash_modes.xml | 1 + sw/airborne/arch/stm32/mcu_arch.c | 4 ++++ sw/tools/dfu/stm32_mem.py | 1 + 5 files changed, 20 insertions(+), 12 deletions(-) diff --git a/conf/boards/lisa_mx_2.0.makefile b/conf/boards/lisa_mx_2.0.makefile index 45c2726493..b318d5ae39 100644 --- a/conf/boards/lisa_mx_2.0.makefile +++ b/conf/boards/lisa_mx_2.0.makefile @@ -21,12 +21,13 @@ $(TARGET).LDSCRIPT=$(SRC_ARCH)/lisa-mx.ld # other possibilities: DFU-UTIL, SWD, JTAG_BMP, STLINK, SERIAL FLASH_MODE ?= SWD - -# -# -# some default values shared between different firmwares -# -# +HAS_LUFTBOOT ?= 0 +ifeq (,$(findstring $(HAS_LUFTBOOT),0 FALSE)) +$(TARGET).CFLAGS+=-DLUFTBOOT +$(TARGET).LDFLAGS+=-Wl,-Ttext=0x8004000 +DFU_ADDR = 0x8004000 +DFU_PRODUCT = Lisa/Lia +endif # diff --git a/conf/boards/lisa_mx_2.1.makefile b/conf/boards/lisa_mx_2.1.makefile index dca2fbc4d0..4ffd521105 100644 --- a/conf/boards/lisa_mx_2.1.makefile +++ b/conf/boards/lisa_mx_2.1.makefile @@ -21,12 +21,13 @@ $(TARGET).LDSCRIPT=$(SRC_ARCH)/lisa-mx.ld # other possibilities: DFU-UTIL, SWD, JTAG_BMP, STLINK, SERIAL FLASH_MODE ?= SWD - -# -# -# some default values shared between different firmwares -# -# +HAS_LUFTBOOT ?= 0 +ifeq (,$(findstring $(HAS_LUFTBOOT),0 FALSE)) +$(TARGET).CFLAGS+=-DLUFTBOOT +$(TARGET).LDFLAGS+=-Wl,-Ttext=0x8004000 +DFU_ADDR = 0x8004000 +DFU_PRODUCT = Lisa/Lia +endif # diff --git a/conf/flash_modes.xml b/conf/flash_modes.xml index 614bc97b39..26002b5882 100644 --- a/conf/flash_modes.xml +++ b/conf/flash_modes.xml @@ -44,6 +44,7 @@ + diff --git a/sw/airborne/arch/stm32/mcu_arch.c b/sw/airborne/arch/stm32/mcu_arch.c index 718f61cf51..d628c5731c 100644 --- a/sw/airborne/arch/stm32/mcu_arch.c +++ b/sw/airborne/arch/stm32/mcu_arch.c @@ -42,8 +42,12 @@ void mcu_arch_init(void) { #if LUFTBOOT PRINT_CONFIG_MSG("We are running luftboot, the interrupt vector is being relocated.") +#if defined STM32F4 + SCB_VTOR = 0x00004000; +#else SCB_VTOR = 0x00002000; #endif +#endif #if EXT_CLK == 8000000 #if defined(STM32F1) PRINT_CONFIG_MSG("Using 8MHz external clock to PLL it to 72MHz.") diff --git a/sw/tools/dfu/stm32_mem.py b/sw/tools/dfu/stm32_mem.py index 1547cdc78a..ebebb79759 100755 --- a/sw/tools/dfu/stm32_mem.py +++ b/sw/tools/dfu/stm32_mem.py @@ -153,6 +153,7 @@ if __name__ == "__main__": valid_manufacturers.append("TUDelft MavLab. 2012->13") valid_manufacturers.append("1 BIT SQUARED") valid_manufacturers.append("S.Krukowski") + valid_manufacturers.append("Paparazzi UAV") # list of tuples with possible stm32 (autopilot) devices stm32devs = []