I am using STM32F205 and I have designed my own bootloader. Before FLASH programming, my bootloader always erase whole FLASH from sector 1 to sector 11 (it uses fixed count cycle through sectors without determining FLASH size). For devices with 1MB FLASH it is OK, but I wonder what heapens if I use device with 768kB of FLASH and I try to erase sector which does not exist, because of FLASH size. Is this situation indicated through FLASH->SR? I tried it on 512kB device and it seems that it works without indicating of any error. I wonder if this behaviour is aplicable for all devices (with different FLASH sizes) or I have to change erase function implementation and use FLASH size register to examine sectors count.