實(shí)現(xiàn)STM32 Flash的讀寫
FLASH_UnlockBank1();
本文引用地址:http://butianyuan.cn/article/201611/317810.htmFLASH_ClearFlag(FLASH_FLAG_EOP | FLASH_FLAG_PGERR | FLASH_FLAG_WRPRTERR);
FLASHStatus = FLASH_ErasePage(BANK1_WRITE_START_ADDR);//BANK1_WRITE_START_ADDR 要擦除的頁(yè)起始地址
Address = BANK1_WRITE_START_ADDR;
FLASHStatus = FLASH_ProgramWord(Address, data);//Adress 需要寫入的地址,data,寫入的數(shù)據(jù)
FLASH_LockBank1();
讀flash
data= (*(__IO uint32_t*) Address);// Address 要讀的數(shù)據(jù)的地址,data從flash讀出來的數(shù)據(jù)
評(píng)論