Skip to content

Commit

Permalink
EEPROM emulation: wrong flash sector used for some F7 variants (stm32…
Browse files Browse the repository at this point in the history
…duino#938)

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 stm32duino#297
  • Loading branch information
ABOSTM authored and bmooij-beeliners committed Jul 14, 2020
1 parent 7886081 commit 26c8747
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 26c8747

Please sign in to comment.