diff --git a/cores/arduino/stm32/stm32_eeprom.c b/cores/arduino/stm32/stm32_eeprom.c index b832568ed5..2a9e2e2334 100644 --- a/cores/arduino/stm32/stm32_eeprom.c +++ b/cores/arduino/stm32/stm32_eeprom.c @@ -180,8 +180,8 @@ void set_data_to_flash(void) EraseInitStruct.Page = FLASH_PAGE_NUMBER; #else // STM32F4xx EraseInitStruct.PageAddress = FLASH_BASE_ADDRESS; - EraseInitStruct.NbPages = 1; #endif + EraseInitStruct.NbPages = 1; if(HAL_FLASH_Unlock() == HAL_OK) { #ifdef STM32L0xx diff --git a/cores/arduino/stm32/stm32_eeprom.h b/cores/arduino/stm32/stm32_eeprom.h index 56809a1634..75b373fc4c 100644 --- a/cores/arduino/stm32/stm32_eeprom.h +++ b/cores/arduino/stm32/stm32_eeprom.h @@ -48,8 +48,12 @@ /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ -#define FLASH_SECTOR_SIZE ((uint32_t)(16*1024)) //16kB page -#define E2END FLASH_SECTOR_SIZE + +#if defined (STM32F2xx) || defined (STM32F4xx) || defined (STM32F7xx) +//FLASH_SECTOR_SIZE +#define FLASH_PAGE_SIZE ((uint32_t)(16*1024)) //16kB page +#endif +#define E2END FLASH_PAGE_SIZE /* Exported macro ------------------------------------------------------------*/ /* Exported functions ------------------------------------------------------- */