-
极海32F030芯片读写保护时,没找到xx32F0xx Flash_OPT.FLM文件
#defineOB_BASE((uint32_t)0x1FFFF800)/*!<FLASHOptionBytesbaseaddress*/#defineOB((OB_TypeDef*)OB_BASE)FLASH_StatusFLASH_OB_Erase(void){uint16_trdptmp=OB_RDP_Level_0;FLASH_Statusstatus=FLASH_COMPLETE;/*GettheactualreadprotectionOptionBytevalue*/if(FLASH_OB_GetRDP()!=RESET){rdptmp=0x00;}/*Waitforlastoperationtobecompleted*/status=FLASH_WaitForLastOperation(FLASH_ER_PRG_TIMEOUT);if(status==FLASH_COMPLETE){/*Ifthepreviousoperationiscompleted,proceedtoerasetheoptionbytes*/FLASH->CR|=FLASH_CR_OPTER;FLASH->CR|=FLASH_CR_STRT;/*Waitforlastoperationtobecompleted*/status=FLASH_WaitForLastOperation(FLASH_ER_PRG_TIMEOUT);if(status==FLASH_COMPLETE){/*Iftheeraseoperationiscompleted,disabletheOPTERBit*/FLASH->CR&=~FLASH_CR_OPTER;/*EnabletheOptionBytesProgrammingoperation*/FLASH->CR|=FLASH_CR_OPTPG;/*RestorethelastreadprotectionOptionBytevalue*/OB->RDP=(uint16_t)rdptmp;/*Waitforlastoperationtobecompleted*/status=FLASH_WaitForLastOperation(FLASH_ER_PRG_TIMEOUT);if(status!=FLASH_TIMEOUT){/*iftheprogramoperationiscompleted,disabletheOPTPGBit*/FLASH->CR&=~FLASH_CR_OPTPG;}}else{if(status!=FLASH_TIMEOUT){/*DisabletheOPTPGBit*/FLASH->CR&=~FLASH_CR_OPTPG;}}}/*Returntheerasestatus*/returnstatus;}请问有用过极海的读保护的吗,这个OPT.FLM文件去哪找
2025-01-24 0