changeset 25:97eafbcb81a9

FIX move bootloader SFirmwareData at fixed address 0x0800A000
author jdg@air
date Wed, 03 Jan 2018 01:40:59 +0100
parents 4de447ee5d1b
children 66a6a0b51493
files .hgsubstate BootLoader/Inc/base_bootloader.h BootLoader/Src/base_bootlader.c BootLoader/Src/tInfoBootloader.c FontPack/base_upperRegion.c
diffstat 5 files changed, 50 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- 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
--- 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 --------------------------------------------------------*/
 
--- 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 <string.h> // 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 <stdio.h>
+#include <string.h> // 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 */
 
--- 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 <string.h>
+#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 <string.h>
 /* Exported variables --------------------------------------------------------*/
 
 /* Private variables ---------------------------------------------------------*/
--- 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,