My program consists of bootloader(0~0xA000) and the program starts from 0xA000.
The bootloader is used to update the firmware,but sometimes I want to update the bootloader firmware by the program after 0xA000.
But an error occurs when I call FLASH_ERASE(&flashstate, 0, 0xA000, Key) and flash protection bytes(0x400-0x40F) are set.It seems the first serveral sectors are not allowed to erase.How can I program bootloader?
FLASH_GetSecurityState() always return unsecure,it doesn't seem to be a secure issue?