STM32F103的芯片,使用官方的例子 ,现在用的FLASH模拟EEPROM
现象:写入一个值读出来没有,看没写进去
原程序是官方的例子 没改动,也就没贴出来,我看了下EE_ReadVariable读的值 返回的是0001
恳请达人指点 谢谢大家
EEPROM 基地址
#define EEPROM_START_ADDRESS ((u32)0x08010000)
//////main
ErrorStatus HSEStartUpStatus;
FLASH_Status FlashStatus;
u16 VarValue = 0;
/* Virtual address defined by the user: 0xFFFF value is prohibited */
u16 VirtAddVarTab[NumbOfVar] = {0x5555, 0x6666, 0x7777};
u16 VADJ1,EepromTemp3,EepromTemp4;
int main(void)
{
#ifdef DEBUG
debug();
#endif
/* System Clocks Configuration */
RCC_Configuration();
/* Unlock the Flash Program Erase controller */
FLASH_Unlock();
/* EEPROM Init */
EE_Init();
EE_WriteVariable(VirtAddVarTab[1], 0x1000);
EepromTemp4=EE_ReadVariable(VirtAddVarTab[1], &EepromTemp3);
VADJ1 = EepromTemp3;
FLASH_Lock();
while (1);
} |