AnsweredAssumed Answered

EEPROM emulation

Question asked by mahmoud boroumand on Sep 11, 2017


I use stm32f030 with 16K flash.i want save 22 byte with EEPROM emulation  and use keil.

my program use 15720 byte of flash

Program Size: Code=15720 RO-data=212 RW-data=200 ZI-data=2856 

i use this option and address 


volatile uint16_t VirtAddVarTab[25] = { 0x0001, 0x0017, 0x0034, 0x0017, 0x0051, 0x0068, 0x0085, 0x0102, 0x0119, 0x0136, 0x0153, 0x0170, 0x0178, 0x0195, 0x0212, 0x0229, 0x0246, 0x0263, 0x0280, 0x0297,0x1111,0x2222 };


#define PAGE_SIZE ((uint32_t)0x0400) /* Page size = 1KByte */

/* EEPROM start address in Flash */
#define EEPROM_START_ADDRESS ((uint32_t)0x08004000) 
/* Pages 0 and 1 base and end addresses */
#define PAGE0_BASE_ADDRESS ((uint32_t)(EEPROM_START_ADDRESS + 0x0000))

#define PAGE1_BASE_ADDRESS ((uint32_t)(EEPROM_START_ADDRESS + 0x0400))
#define PAGE1_END_ADDRESS ((uint32_t)(EEPROM_START_ADDRESS + (2 * PAGE_SIZE - 1)))



what is best option and virtual address for my project?