小弟从网上找的例程是F103的 我用的是F107VCT6,看了半天代码,自己又找了一个103做实验,103调通了,可是107失败了,程序没变,请问还有哪些地方需要更改一下,下面附上flash.c,二楼放MAIN.c
//从指定地址开始读取多个数据
void FLASH_ReadMoreData(uint32_t startAddress,uint16_t *readData,uint16_t countToRead)
{
uint16_t dataIndex;
for(dataIndex=0;dataIndex=(FLASH_BASE+1024*FLASH_SIZE)))
{
return;//非法地址
}
FLASH_Unlock(); //解锁写保护
uint32_t offsetAddress=startAddress-FLASH_BASE; //计算去掉0X08000000后的实际偏移地址
uint32_t sectorPosi
tion=offsetAddress/SECTOR_SIZE; //计算扇区地址,对于
STM32F103VET6为0~255
uint32_t sectorStartAddress=sectorPosition*SECTOR_SIZE+FLASH_BASE; //对应扇区的首地址
FLASH_ErasePage(sectorStartAddress);//擦除这个扇区
uint16_t dataIndex;
for(dataIndex=0;dataIndex