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.

Cannot enable internal EEPROM on TM4C1294

Other Parts Discussed in Thread: EK-TM4C1294XL

I am using an EK-TM4C1294XL Launchpad with CCS v6 and Tivaware 2.1.0.12573

When I enable the internal eeprom the code fails to complete initialization, the debugger says it is going to the boot.asm as if the main application returned, but I'm not sure I trust that.  There is no return from main, it is an infinite loop.

...
   SysCtlPeripheralEnable(SYSCTL_PERIPH_EEPROM0);    // Enable EEPROM
   while(!HWREG(EEPROM_EEDONE)) ;

   MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_HIBERNATE);  // Enable the hibernate module.  <- Line 1
   MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);      // Enable UART0                              <- Line 2
   MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0);       // Enable ADC0
   MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC1);       // Enable ADC1
...

If I set the debugger to stop on Line 2, it never gets there.  If I set it to stop on Line 1, it stops, and then if I resume everything works fine.  I've experimented with the order of calls, moved things around, but it seems like some number of cycles after enabling the EEPROM it fails if it runs at full speed.  Stopping it before the fail point then resuming works fine.  

Any idea what is going on?

Mike

  • Hello Mike,

    After the clock is enabled to a peripheral the code needs to wait for some time before it can access the peripheral. To avoid this delay loop you can use the sysctl API of SysCtlPeripheralReady to make sure that the peripheral is enabled

    SysCtlPeripheralEnable(SYSCTL_PERIPJ_EEPROM0);

    while(!SysCtlPeripheralReady(SYSCTL_PERIPJ_EEPROM0));

    Regards

    Amit

  • Amit,

    Thanks, that was part of the problem.  I was checking the EEDONE register too quickly.  But, the check also had inverted logic. So I fixed that then moved the ready checks down to my eeprom init function.

    But then, it looks like is stepped into Silicon Errata MEM#12, where is code jumps to ROM from flash while eeprom is active and never returns.  Looks like this was the original error. I enabled the eeprom, then immediately went to enable other peripherals with the MAP_SysCtlPeripheralEnable() which mapped to ROM. 

    All works now if I ensure the EEPROM is not busy before continuing.

    P.S.  How does one determine how to what target to define, e.g. TARGET_IS_TM4C129_RA0, or RA1 ?  Is there a marking on the part that correlates to this, and the Silicon versions in the errata?

    Thanks.

    Mike

  • Amit,

    Never mind about the revision determination, found the info at the front of the Silicon Errata

    Mike