HAL_FLASHEx_Erase does not work for STM32L496VE due to incorrect FLASH_BANK_SIZE and FLASH_BANK_2 being declared
We have designed a custom bootloader solution that works on multiple STM32 devices, however when we attempted to use it on STM32L496VE we realised HAL_FLASHEx_Erase did not clear the flash, even though it returned HAL_OK.
On further investigation, it was found that the HAL library assumes any stm32L4xx has 2 banks, with each bank having half the FLASH_SIZE. This meant that FLASH_SIZE is set to 512KB, and FLASH_BANK_SIZE is set to 256KB for STM32L496VE, whereas the datasheet states that this IC has 1 bank of 512KB.
Note - we have modified the defines to ensure STM32L496VE has only 1 bank in the HAL Library, however HAL_FLASHEx_Erase still does not work. Potentially the assumption that the device has 2 banks causes a lot of ripples throughout all the other libraries for the same device.
Is there any assistance you can provide with this please?
Regards,
Kaz
