以下程序调试时 FLASH_ErasePage(addr);一句时,STLINK报错“Internal command error”和“Error while attempting to read 64 bytes from 0x8001a50”
求指导、意见,及stm32f051 iap相关资料:FLASH编程指南、例程等,
多谢!作揖!
#define DATA_BASE 0x8002000
void WriteFlash(U32 addr, U32* buf, U16 len)
{
U32 ic;
U32 address;
FLASH_Unlock();
FLASH_ErasePage(addr);
address = addr;
for(ic =0; ic
FLASH_ProgramWord(address, buf[ic]);
address +=4;}
FLASH_Lock();
}
U16 AdjDat[256];
void Writedata()
{
WriteFlash(DATA_BASE , (U32* )AdjDat, 512); // 写入FLASH
printf("ok");
}
:carnation: :carnation: :carnation: