# HG changeset patch # User jdg@air # Date 1514940059 -3600 # Node ID 97eafbcb81a96c57745d2a799ef0ea5501aaee5d # Parent 4de447ee5d1b56208e6e3549479e7d5482fd5efd FIX move bootloader SFirmwareData at fixed address 0x0800A000 diff -r 4de447ee5d1b -r 97eafbcb81a9 .hgsubstate --- a/.hgsubstate Mon Jan 01 20:12:34 2018 +0100 +++ b/.hgsubstate Wed Jan 03 01:40:59 2018 +0100 @@ -1,4 +1,4 @@ -1080dd4fed734b6e5b078f5f0385126bb66339cd Common -939e6209ac1b4ab1c3b06d4b48d7bacbf705e985 Discovery +3ed4d297cbaed1465f372a638d270f476f999e54 Common +ad3cb392a8bf75862b05a9ce9293060a6f0f8e20 Discovery f090f36d55adb8a624a1ca33b240450d070883a2 Small_CPU 79e4fe685aa6efed243774b0453e2ce42a78e92a wiki diff -r 4de447ee5d1b -r 97eafbcb81a9 BootLoader/Inc/base_bootloader.h --- a/BootLoader/Inc/base_bootloader.h Mon Jan 01 20:12:34 2018 +0100 +++ b/BootLoader/Inc/base_bootloader.h Wed Jan 03 01:40:59 2018 +0100 @@ -40,9 +40,14 @@ #define BASE_BOOTLOADER_H /* Includes ------------------------------------------------------------------*/ + +#define STM32F429xx + #include "stm32f4xx_hal.h" + #include "tStructure.h" #include "settings.h" + /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ diff -r 4de447ee5d1b -r 97eafbcb81a9 BootLoader/Src/base_bootlader.c --- a/BootLoader/Src/base_bootlader.c Mon Jan 01 20:12:34 2018 +0100 +++ b/BootLoader/Src/base_bootlader.c Wed Jan 03 01:40:59 2018 +0100 @@ -191,27 +191,36 @@ */ /* Includes ------------------------------------------------------------------*/ -#include "stdio.h" -#include // for memcopy +#include "base_bootloader.h" + +// From Bootloader/Inc: +#include "tInfoBootloader.h" +// ? +#include "externLogbookFlash.h" +#include "firmwareEraseProgram.h" +#include "firmwareJumpToApplication.h" + +// From Common/Inc: +#include "FirmwareData.h" + +// From Common/Drivers: #include "stm32f4xx_hal.h" #include "stm32f4xx_hal_rcc.h" #include "stm32f4xx_hal_flash_ex.h" #include "stm32f4xx_hal_wwdg.h" -#include "ostc.h" -#include "base_bootloader.h" +// From Discovery/Inc (shall be shared...) +#include "data_exchange_main.h" #include "display.h" #include "gfx_engine.h" -#include "externLogbookFlash.h" +#include "ostc.h" #include "tComm.h" #include "tStructure.h" -#include "tInfoBootloader.h" -#include "firmwareEraseProgram.h" -#include "firmwareJumpToApplication.h" - -#include "data_exchange_main.h" +// From AC6 support: +#include +#include // for memcopy /** @addtogroup OSTC 4 * @{ @@ -225,31 +234,31 @@ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ - uint8_t returnFromCommCleanUpRequest = 0; +uint8_t returnFromCommCleanUpRequest = 0; -const SFirmwareData FirmwareData __attribute__((at(0x08000000 + 0x0000A000))) = { - .firmwareVersion16to32bit.ub.first = 1, - .firmwareVersion16to32bit.ub.second = 0, - .firmwareVersion16to32bit.ub.third = 1, - .firmwareVersion16to32bit.ub.betaFlag = 1, +const SFirmwareData bootloader_FirmwareData __attribute__(( section(".bootloader_firmware_data") )) = +{ + .versionFirst = 1, + .versionSecond = 0, + .versionThird = 1, + .versionBeta = 1, /* 4 bytes with trailing 0 */ .signature = "cw", - .release_year = 16, - .release_month = 4, - .release_day = 8, - .release_sub = 0, + .release_year = 16, + .release_month = 4, + .release_day = 8, + .release_sub = 0, /* max 48 with trailing 0 */ - //release_info ="12345678901234567890123456789012345678901" .release_info ="tComm with all", /* for safety reasons and coming functions*/ - .dummy[0] = 0, - .dummy[1] = 0, - .dummy[2] = 0xEE, /* the magic byte */ - .dummy[3] = 0xFF + .magic[0] = FIRMWARE_MAGIC_FIRST, + .magic[1] = FIRMWARE_MAGIC_SECOND, + .magic[2] = FIRMWARE_MAGIC_FIRMWARE, /* the magic byte */ + .magic[3] = FIRMWARE_MAGIC_END }; @@ -282,7 +291,7 @@ }; -RTC_HandleTypeDef RtcHandle; +RTC_HandleTypeDef RtcHandle; TIM_HandleTypeDef TimHandle; /* used in stm32f4xx_it.c too */ TIM_HandleTypeDef TimBacklightHandle; /* used in stm32f4xx_it.c too */ diff -r 4de447ee5d1b -r 97eafbcb81a9 BootLoader/Src/tInfoBootloader.c --- a/BootLoader/Src/tInfoBootloader.c Mon Jan 01 20:12:34 2018 +0100 +++ b/BootLoader/Src/tInfoBootloader.c Wed Jan 03 01:40:59 2018 +0100 @@ -21,12 +21,15 @@ */ /* Includes ------------------------------------------------------------------*/ -#include +#include "tInfoBootloader.h" + #include "base_bootloader.h" +#include "gfx_colors.h" +#include "gfx_engine.h" +#include "gfx_fonts.h" #include "ostc.h" -#include "tInfoBootloader.h" -#include "gfx_engine.h" -#include "gfx_colors.h" + +#include /* Exported variables --------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ diff -r 4de447ee5d1b -r 97eafbcb81a9 FontPack/base_upperRegion.c --- a/FontPack/base_upperRegion.c Mon Jan 01 20:12:34 2018 +0100 +++ b/FontPack/base_upperRegion.c Wed Jan 03 01:40:59 2018 +0100 @@ -47,7 +47,7 @@ ////////////////////////////////////////////////////////////////////////////// -const SFirmwareData font_FirmwareData __attribute__(( section(".upper_firmware_data") )) = +const SFirmwareData font_FirmwareData __attribute__(( section(".font_firmware_data") )) = { .versionFirst = 0, .versionSecond = 9,