Skip to content

Commit 63f72a3

Browse files
committed
Fix #47 eeprom issue
Signed-off-by: Frederic.Pillon <[email protected]>
1 parent 7244e6c commit 63f72a3

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

cores/arduino/stm32/stm32_eeprom.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ void set_data_to_flash(void)
180180
EraseInitStruct.Page = FLASH_PAGE_NUMBER;
181181
#else // STM32F4xx
182182
EraseInitStruct.PageAddress = FLASH_BASE_ADDRESS;
183-
EraseInitStruct.NbPages = 1;
184183
#endif
184+
EraseInitStruct.NbPages = 1;
185185

186186
if(HAL_FLASH_Unlock() == HAL_OK) {
187187
#ifdef STM32L0xx

cores/arduino/stm32/stm32_eeprom.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,13 @@
4848

4949
/* Exported types ------------------------------------------------------------*/
5050
/* Exported constants --------------------------------------------------------*/
51+
#if defined (STM32F0xx) || defined (STM32F1xx) || defined (STM32F3xx) ||\
52+
defined (STM32L0xx) || defined(STM32L4xx)
53+
#define E2END FLASH_PAGE_SIZE
54+
#else // STM32F2xx STM32F4xx STM32F7xx
5155
#define FLASH_SECTOR_SIZE ((uint32_t)(16*1024)) //16kB page
5256
#define E2END FLASH_SECTOR_SIZE
57+
#endif
5358

5459
/* Exported macro ------------------------------------------------------------*/
5560
/* Exported functions ------------------------------------------------------- */

0 commit comments

Comments
 (0)