Skip to content

Commit

Permalink
EEPROM emulation: wrong flash sector used for some F7 variants (#938)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ABOSTM committed Feb 14, 2020
1 parent 489e74a commit 89e08d2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions variants/NUCLEO_F767ZI/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions variants/REMRAM_V1/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 89e08d2

Please sign in to comment.