Added FlASH_ClearFlags() to fix bootloader's flash erase/programming