This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

ROM_EEPROMRead Problem

Other Parts Discussed in Thread: TM4C1294NCPDT

I'm using the EX-TMC1294XL Launch Pad and was investigating the APIs for EEPROM.   I initially created a simple, init, MassErase, Read/Program/Write sequence using the MAP_ API derivatives.  All worked well and I removed the MassErase  and the Program/Read to simply read what I stored back.   All well and good.

Thought I'd change it around and use the ROM_, no other code changes.   The Predefines have the proper TARGET_IS_TM4C129_RA1 and PART_TM4C1294NCPDT.

The program crashed in attempting the ROM_EEPROMRead.  Funny thing is, if I assembly step through the function, it all works 100%.  Just not managing the full speed.   I checked ROM_EEPROMStatusGet prior to calling the Read, but still no joy.

Here's the pertinent code lines:
g_ui32SysClock = ROM_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
                                                                           SYSCTL_OSC_MAIN | SYSCTL_USE_PLL |
                                                                           SYSCTL_CFG_VCO_480),
                                                                           120000000);
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_EEPROM0);
eeStat = ROM_EEPROMInit();
eeStat = ROM_EEPROMSizeGet();
System_printf("SIze of EEPROM %d\n",eeStat);  <--------- This reports just fine
System_flush();
 
while(ROM_EEPROMStatusGet());
ROM_EEPROMRead(eeRead,0,sizeof(eeRead));  <---------- full speed crashes; walking steps works
 
Thanks

  • Hello Carl,

    What is eeRead defined as? Also did you put a while(1) after EEPROMRead to check if the crash occurs because of EEPROMRead or due to some other function.

    Please note that the compile optimization options may cause the IDE show the execution at some other place.

    Regards

    Amit

  • Hello Amit,

    uint32_t  eeRead[2];  // replicated from one of the labs

    I stepped through the code to know that I'm hung on the ROM_EEPROMRead function and set breakpoints just after the call.  Again, if I perform a Step over in the C function, it locks up.  If I step through the assembly instructions, it will complete and return valid data.

    Carl

  • Carl Smith said:
    Just not managing the full speed.

    Much liked the detail & organization - your post - well done!

    That quote intrigues our group.  Are you suggesting that running the MCU at lesser System Clocks - reduces or eliminates this failed read issue?  If not - might dialing system clock to 1/4 full speed - and then incrementally increasing - prove of use/value?

    We note that yours is a newer issue MCU - might the ROM code, "have not quite caught up" with the hooks/demands of such new issue devices?  Appears, "in the realm" due to your report of "success" via code stored in flash...

    Should last para. "land close" - perhaps the careful/systematic replacement of one ROM function - by its flash equivalent - will further pinpoint cause...  (one hopes)

  • Hello Carl

    Took me some time and should have realized that it is an Errata.

    MEM#12 Code Jumps from Flash to ROM when EEPROM is Active may Never Return

    You have to use the Flash version of the function...

    Regards

    Amit

  • I reduced the clock to 40MHz and still didn't work calling the ROM_EEPROMRead.

    Interesting observation.   If I don't use ROM_ for SysCtlClockFreqSet (@40MHz).  It runs with no issues. 

    Here's a table I ran through with only  the SysCtlClockFreqSet being changed between FLASH and ROM

    CLK                           ROM                               FLASH
    40MHz                       Fail                                 Pass
    60 MHz-120MHz       Fail                                 Fail 

    Amit,

    Saw your response as I was putting together the info above.  Thanks for the Info.  I should have looked at the Errata as well.  

    Thanks for your great support and time.