#define FLASH_BASE 0x080000 #define RECORD_SIZE 32 #define RECORDS_PER_SECTOR (FLASH_SECTOR_SIZE / RECORD_SIZE) #define MAX_RECORD_NUM 30135 #define MAX_RECORD_ADDR (MAX_RECORD_NUM * RECORD_SIZE + FLASH_BASE) i found that MAX_RECORD_ADDR is 0x7B6E0 (the correct value is 0x16B6E0). Why?????
See also: http://www.keil.com/support/docs/225.htm This explains why you get this results.