2015-12-28 06:51 PM
Hello, i gone through AN2954 and to make it simple,
i just get out the eeprom write & read (don't am i correct to do so) EEprom write: uint16_t EE_WriteVariable(uint16_t VirtAddress, uint16_t Data) { uint16_t Status = 0; /* Write the variable virtual address and value in the EEPROM */ Status = EE_VerifyPageFullWriteVariable(VirtAddress, Data); /* In case the EEPROM active page is full */ if (Status == PAGE_FULL) { /* Perform Page transfer */ Status = EE_PageTransfer(VirtAddress, Data); } /* Return last operation status */ return Status; } //=================== EEPROM READ uint32_t EEPROM_Read(uint16_t Address) { uint32_t readValue; FLASH_Unlock(); // Address = BANK1_WRITE_START_ADDR; readValue = (*(__IO uint16_t*) Address); FLASH_Lock(); return readValue; } However, when i process to do EE_WriteVariable(200, 14); FLASH_Unlock(); test_3 = EEPROM_Read(200); i cannot get the correct value in test_3. Can anyone help? Thanks2015-12-28 09:05 PM
Can anyone help?
Look, it's a 32-bit processor, you can't take a 16-bit variable and cast it into an address and expect it to function properly. You'll need to use the EEPROM abstraction to go retrieve your value, I don't think it exists at some linear memory address.2015-12-28 10:17 PM