FLASH Memory erase sector
Hello folk, i hope you fine, i am using the STM32L072, i need erase FLASH memory from 0x08008000 up to the end, i read in the datasheet that every sector has 4Kb and every page has 128 bytes, i have the following:
FLASH_EraseInitTypeDef borrat;
borrat.NbPages = 1;
borrat.PageAddress = 0x8008000; //flashAddr;
borrat.TypeErase = FLASH_TYPEERASE_PAGES;
uint32_t pagE;
HAL_FLASH_Unlock();
// HAL_FLASHEx_Erase(&borrat, &pagE);
HAL_FLASH_Lock();In this code it erase just a page from 0x8008000, is that true? so i don't understand how to erase all pages from start position up to the end, can someone helps me?¿
Thanks a lot!
