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) */