https://bbs.21ic.com/icview-618835-1-1.html
10楼
正确的顺序应该是:- #if 1
- if(SET != FLASH_OB_GetRDP())
- {
- printf("Flash read protection not set, protection.....\n");
- FLASH_Unlock();
- FLASH_OB_Unlock();
- //FLASH_OB_WRPConfig();
- FLASH_OB_RDPConfig(OB_RDP_Level_1);
- //FLASH_OB_UserConfig();
- //FLASH_OB_BORConfig();
- printf("protection done\n");
- FLASH_OB_Launch();
- FLASH_OB_Lock();
- FLASH_Lock();
- }
- #endif /* Flash read protection */
然后系统重新上电,保护生效。
|