From 8a3d464ddaa2f172e7d03c5fc05af46dbb0fcce4 Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Mon, 19 Aug 2024 20:19:12 +1000 Subject: [PATCH] Move LOGO and settings to suit Miniware DFU --- source/Core/BSP/Miniware/configuration.h | 11 ++++++++--- source/Makefile | 3 ++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/source/Core/BSP/Miniware/configuration.h b/source/Core/BSP/Miniware/configuration.h index f22ada8c..fbc25c09 100644 --- a/source/Core/BSP/Miniware/configuration.h +++ b/source/Core/BSP/Miniware/configuration.h @@ -194,7 +194,7 @@ #define POWER_LIMIT_STEPS 5 #define OP_AMP_GAIN_STAGE OP_AMP_GAIN_STAGE_TS100 #define TEMP_uV_LOOKUP_HAKKO -#define ACCEL_LIS_CLONE 1 +#define ACCEL_LIS_CLONE 1 #define HARDWARE_MAX_WATTAGE_X10 1000 #define TIP_THERMAL_MASS 65 // X10 watts to raise 1 deg C in 1 second #define TIP_RESISTANCE 75 // x10 ohms, 7.5 typical for ts100 tips @@ -272,8 +272,13 @@ #endif /* TS80P */ #ifdef MODEL_TS101 -#define FLASH_LOGOADDR (0x08000000 + (126 * 1024)) -#define SETTINGS_START_PAGE (0x08000000 + (127 * 1024)) +// For whatever reason, Miniware decided to only allow their bootloader to work on 4k page sizes +// So we have to locate the boot-logo on a different 4k page to the settings +// And also, it doesnt let me write to the last page on my DFU version +// So, we put settings on the last section (as we can work with it fine) +// And then we use the N-1'th 4K for logo +#define FLASH_LOGOADDR (0x08000000 + (120 * 1024)) +#define SETTINGS_START_PAGE (0x08000000 + (124 * 1024)) #else #define FLASH_LOGOADDR (0x08000000 + (62 * 1024)) #define SETTINGS_START_PAGE (0x08000000 + (63 * 1024)) diff --git a/source/Makefile b/source/Makefile index 01cd929f..5142461a 100644 --- a/source/Makefile +++ b/source/Makefile @@ -84,7 +84,8 @@ DEVICE_BSP_DIR=./Core/BSP/Miniware LDSCRIPT=./Core/BSP/Miniware/stm32f103.ld ifeq ($(model),$(filter $(model),TS101)) -flash_size=126k +# 128K - 8K for settings & logo +flash_size=119k bootldr_size=0x8000 DEVICE_DFU_ADDRESS=0x08008000 else