Tool/software: TI-RTOS
HI,
My application need to store boot up parameters in EEPROM, and it will be used through out the program execution and these values will be frequently get updated from application software.
Initially these values available in flash sector(programmed through J-Tag) and it will written into EEPROM on first boot, there after firmware will use use the values from EEPROM memory.
earlier i have used these variables from flash sector itself. Since EEPROM endurance is more when compared to flash, i have moved flash sector to EEPROM sector.
I am getting HW exception that leads infinite loop, when replacing with EEPROM APIs instead of flash APIs and also i am observing some other task stack usage is getting full, even though that task is not running.
The followings code is used earlier.
void flashWrite(BOOT_STRUCT *stFlashData) { int ret; ret = FlashErase((uint32_t ) FLASH_COMMON_MEMORY_ADDRESS); if(ret != NULL) { System_printf("FLash memory is not erased successfully\n"); } ret = FlashProgram((uint32_t *)stFlashData, FLASH_COMMON_MEMORY_ADDRESS, 2048); if(ret != NULL) { System_printf("FLash memory is not programmed successfully\n"); } System_flush(); }
BOOT_STRUCT flashRead(BOOT_STRUCT *stFlashData) { stFlashData = ((BOOT_STRUCT *)FLASH_COMMON_MEMORY_ADDRESS ); return *stFlashData; }
and i am replacing with following APIs.
#define EPROM_START_ADDRESS 0x0 #define BOOT_PARAMETER_SIZE 1024 void EpromWrite(BOOT_STRUCT *stEpromData) { ret = EEPROMMassErase(); if(ret != 0) { System_printf("Eeprom Erase Failed: Error No - %d\n", ret); } ret = EEPROMProgram((uint32_t *)stEpromData, EPROM_START_ADDRESS, BOOT_PARAMETER_SIZE); if(ret != 0) { System_printf("EPROM data write failed: Error No - %d\n", ret); } } //for Reading the data the folowing APIs is used. EEPROMRead((uint32_t *)stEpromData, EPROM_START_ADDRESS, BOOT_PARAMETER_SIZE);
i have checked using breakpoints and EEPROM read succeed always. i will be able to see the values in read data structure. The HW exception occurs, after read complete and trying to execute some other routine. but when replace with flash API its working fine.
Can you please help me finding the solution? is there any other dependencies before EEPROM write/Read.
i using the following versions of tool set.
CCS8.1
tirtos_tivac_2_16_01_14
TivaWare_C_Series-2.1.4.178
Regards
Bala