Hi,
I need to know which one to use flash or eeprom for data storage, since errata says in some condition device may get damaged or eeprom corrupted.
Refer to errate SPMZ849E. I am using rev 7 of TM4C.
A)Flash:
1. Only errata is MEM#14. Flash Write Operation During Execute from Flash may Result in Wrong Instruction
Fetch. I think workaround #1 will work for it in case system is running abobe 40Mhz.
SysCtlClockSet(SYSCTL_SYSDIV_5 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ ); /* slow down system to 40Mhz */
IntMasterDisable(); /* disable main int */
FlashErase(0x10000);
FlashProgram(pui32Data, 0x10000, sizeof(pui32Data));
IntMasterEnable();
SysCtlClockSet(SYSCTL_SYSDIV_2_5 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ ); /* again go to 80Mhz */
2. Since flash has 1Kb block selectable. Suppose I want to have 2Kb of flash as eeprom. I am using two last blocks of flash.
So I will use address like
FlashErase(0x3F800); /* 256*1024 - 1024 - 1024 */
FlashErase(0x3FC00); /* 256*1024 - 1024 */
Is it right?
3. I am using keil. I have made setting Project->option for trget->target->IROM1-> 0 to 0x3F800.
This is to tell compiler that now put flash code upto 0x3F800.
Is it correct?
4. Another workaround to MEM#14 is to "Copy the Flash Program/Erase code to SRAM and CPU executes the code from
SRAM."
How to do that in code. Is there any example code to how to do this?
i am using TM4C123gh6pm, driverlib 2.1.1.71 , keil 5.13.0.0