Update ee.c

Use case stm32L4 
HAL_FLASHEx_Erase was throwing error because flashErase.Page needs to be between 0-255

This is from stm32L4xx_hal_flash.h
  uint32_t Page;        /*!< Initial Flash page to erase when page erase is disabled
                             This parameter must be a value between 0 and (max number of pages in the bank - 1)
                             (eg : 255 for 1MB dual bank) */
This commit is contained in:
Brenden Adamczak 2022-06-26 16:08:29 -04:00 committed by GitHub
parent 6a74e27bf4
commit 4c3daeb251
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

2
ee.c
View File

@ -189,7 +189,7 @@ bool ee_format(bool keepRamData)
FLASH_EraseInitTypeDef flashErase;
#if _EE_PAGE_OR_SECTOR == PAGE
flashErase.NbPages = 1;
flashErase.PageAddress = _EE_ADDR_INUSE;
flashErase.PageAddress = _EE_USE_FLASH_PAGE_OR_SECTOR;
flashErase.TypeErase = FLASH_TYPEERASE_PAGES;
#elif _EE_PAGE_OR_SECTOR == SECTOR
flashErase.NbSectors = 1;