From 9f2f9ccd3b30f993f93e026afd99b66a95b1658a Mon Sep 17 00:00:00 2001 From: rusefi Date: Sun, 27 Jan 2019 17:53:11 -0500 Subject: [PATCH] configurable FLASH_ADDR --- firmware/config/boards/STM32F407VET6_Mini.bat | 3 ++- firmware/controllers/flash_main.cpp | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/firmware/config/boards/STM32F407VET6_Mini.bat b/firmware/config/boards/STM32F407VET6_Mini.bat index 0d7f52d162..63728aaedb 100644 --- a/firmware/config/boards/STM32F407VET6_Mini.bat +++ b/firmware/config/boards/STM32F407VET6_Mini.bat @@ -3,7 +3,8 @@ echo "Compiling for https://rusefi.com/forum/viewtopic.php?f=4&t=1498" cd ../.. rem TODO: somehow this -DDUMMY is helping us to not mess up the parameters, why?! rem https://github.com/rusefi/rusefi/issues/684 -set EXTRA_PARAMS="-DDUMMY -DEFI_COMMUNICATION_PIN=GPIOB_9 -DSTM32_PLLM_VALUE=25 -DDEFAULT_ENGINE_TYPE=MINIMAL_PINS" +rem this board has only 512K flash so using custom FLASH_ADDR +set EXTRA_PARAMS="-DDUMMY -DEFI_COMMUNICATION_PIN=GPIOB_9 -DSTM32_PLLM_VALUE=25 -DDEFAULT_ENGINE_TYPE=MINIMAL_PINS -DFLASH_ADDR=0x08070000" make -j8 clean make -j8 rm -f build/rusefi.dfu diff --git a/firmware/controllers/flash_main.cpp b/firmware/controllers/flash_main.cpp index 1864b3b14b..8a980223d7 100644 --- a/firmware/controllers/flash_main.cpp +++ b/firmware/controllers/flash_main.cpp @@ -39,7 +39,9 @@ extern engine_configuration_s *engineConfiguration; * todo: an ideal solution would be to define this address in the .ld / .icf mapping file */ +#ifndef FLASH_ADDR #define FLASH_ADDR 0x080E0000 +#endif #define PERSISTENT_SIZE sizeof(persistent_config_container_s)