Skip to content

Commit c0cfed9

Browse files
committed
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, instead, it represents the maximum number of sectors (for single and dual bank). So for variants using F76xx and F77xx chip, we must define FLASH_BASE_ADDRESS and FLASH_DATA_SECTOR in order to use the last sector of the flash corresponding to the default single bank configuration. Variants concerned: NUCLEO_F767ZI and REMRAM Fixes #297
1 parent 489e74a commit c0cfed9

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Diff for: variants/NUCLEO_F767ZI/variant.h

+5
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,11 @@ extern "C" {
147147
#define HAL_DAC_MODULE_ENABLED
148148
#define HAL_ETH_MODULE_ENABLED
149149

150+
// Last Flash sector used for EEPROM emulation, address/sector depends on single/dual bank configuration.
151+
// By default 2MB single bank
152+
#define FLASH_BASE_ADDRESS 0x081C0000
153+
#define FLASH_DATA_SECTOR 11
154+
150155
#ifdef __cplusplus
151156
} // extern "C"
152157
#endif

Diff for: variants/REMRAM_V1/variant.h

+5
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,11 @@ extern "C"
172172
/* HAL configuration */
173173
#define HSE_VALUE 24000000U
174174

175+
// Last Flash sector used for EEPROM emulation, address/sector depends on single/dual bank configuration.
176+
// By default 2MB single bank
177+
#define FLASH_BASE_ADDRESS 0x081C0000
178+
#define FLASH_DATA_SECTOR 11
179+
175180
#ifdef __cplusplus
176181
} // extern "C"
177182
#endif

0 commit comments

Comments
 (0)