From 0d1c0016c720e0d3770288d73b2d4ba7cc8393fe Mon Sep 17 00:00:00 2001 From: Alexandre Bourdiol Date: Thu, 13 Feb 2020 18:33:05 +0100 Subject: [PATCH] EEPROM emulation: wrong flash sector used for some F7 variants Default configuration for F76xx and F77xx chip is single bank. But HAL define FLASH_SECTOR_TOTAL doesn't represent the real number of sector, but the maximum number of sector (for single and dual bank). So for variants using F76xx and F77xx chip, we must define FLASH_BASE_ADDRESS and FLASH_DATA_SECTOR according to default sector number. Variant concerned: NUCLEO_F767ZI and REMRAM Fixes #297 --- variants/NUCLEO_F767ZI/variant.h | 5 +++++ variants/REMRAM_V1/variant.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/variants/NUCLEO_F767ZI/variant.h b/variants/NUCLEO_F767ZI/variant.h index fc6b2ae547..10c30285d0 100644 --- a/variants/NUCLEO_F767ZI/variant.h +++ b/variants/NUCLEO_F767ZI/variant.h @@ -147,6 +147,11 @@ extern "C" { #define HAL_DAC_MODULE_ENABLED #define HAL_ETH_MODULE_ENABLED +// Last Flash sector used for EEPROM emulation, address/sector depends on single/dual bank configuration. +// By default 2MB single bank +#define FLASH_BASE_ADDRESS 0x081C0000 +#define FLASH_DATA_SECTOR 11 + #ifdef __cplusplus } // extern "C" #endif diff --git a/variants/REMRAM_V1/variant.h b/variants/REMRAM_V1/variant.h index f25a023383..86b985a888 100644 --- a/variants/REMRAM_V1/variant.h +++ b/variants/REMRAM_V1/variant.h @@ -172,6 +172,11 @@ extern "C" /* HAL configuration */ #define HSE_VALUE 24000000U +// Last Flash sector used for EEPROM emulation, address/sector depends on single/dual bank configuration. +// By default 2MB single bank +#define FLASH_BASE_ADDRESS 0x081C0000 +#define FLASH_DATA_SECTOR 11 + #ifdef __cplusplus } // extern "C" #endif