Jump to content
Sign in to follow this  
GrumpyOldPizza

EEPROM on TM4C123

Recommended Posts

Has anybody tried to use the EEPROM ? I had been looking at the errata, and I am not sure this is usable ...

 

Is there good bare metal code out there to simply read the whole eeprom in one chunk, and write it in one chunk ? 

 

What do I need to look out for ? 

 

I'd love to use this for my rover, to store configuration and waypoint data ...

 

- Thomas

Share this post


Link to post
Share on other sites

HI,

Yes, there is/are such things as you wish - see the file driverlib/eeprom.c and pick-up the functions needed.

About problems - did not noticed but worth to check errata sheet. Problems were with LM4F series, seems to be gone now.

One mention: all reads/writes must be in multiples of 4 bytes, so to maximize its use you must pack some data (depending on what you need to store)

L

Share this post


Link to post
Share on other sites

Lyon, thanx for pointing out. 

 

I was after bare metal, not driverlib ... Perhaps I'll just go ahead and grab the bits I need. Would have been simpler if there somebody had done that already.

 

The multiple of 4 ... It's for configuration data. I'd assume that the EEPROM will be divided into a single struct that contains the config/calbibration data of my system, and a 2nd set that contains way points and such. Padding that to multiples of 4 seems trivial.

 

 

The errata in the TM4C part still seem to be relevant: 

 

"EEPROM Data May be Corrupted if an EEPROM Write or Erase is Interrupted".

"Device may Become Non-functional if an EEPROM Write or Erase is Interrupted".

 

Both of those issues apply to revision 6 only (what TM4C is on the launchpads ?). The only WAR that TI suggests is not to write EEPROM where there is a chance of a RST or Brownout. 

 

Then there is this one:

 

"Soft Resets Should not be Asserted During EEPROM Operations".

 

That precudes using a RTOS while writing to the EEPROM, because a different task could crash, and a soft-reset could be a consequence of that (say by your debugger or your hardfault logic).

 

Ah, and this here (see driverlib):

 

"The ROM Version of the TivaWare EEPROMInit API Does not Correctly Initialize

the EEPROM".
 
 
Those issues were what I was after when asking whether somebody had actually tried that ... Were there problems or not ?
 
- Thomas

Share this post


Link to post
Share on other sites

Hi,

Reading your observations seems the internal EEPROM is not suitable for your application - in this case an external one is better. Also, your data (waypoints) could exceed the size of internal EEPROM - so this is the most important argument to not use it. But for other data, like calibartions or some other parameters, seldom modified, could be stored there.

We use a variation of this, writing data into last pages of the flash, no problems ( production ~15K pcs/year).

Reading the errata sheet is the best thing to do before anything else - and choose that product only if silicon bugs have workarounds or do not interfer with your application. We choosed TI since another brand has three times more silicon bugs, many of them with no workarounds.

L

Share this post


Link to post
Share on other sites

Hi,

Reading your observations seems the internal EEPROM is not suitable for your application - in this case an external one is better. Also, your data (waypoints) could exceed the size of internal EEPROM - so this is the most important argument to not use it. But for other data, like calibartions or some other parameters, seldom modified, could be stored there.

We use a variation of this, writing data into last pages of the flash, no problems ( production ~15K pcs/year).

Reading the errata sheet is the best thing to do before anything else - and choose that product only if silicon bugs have workarounds or do not interfer with your application. We choosed TI since another brand has three times more silicon bugs, many of them with no workarounds.

L

 

Lyon, the embedded flash is of course the other option. 100k read/write cycles ... Perhaps using a set of 16 1k pages to circle throu ... Doesn't seem to be a biggy. On the Lego Mindstorms NXT they put a file system in the flash ... So yes, not a big deal. The EEPROM just seemed to be there and waiting to be used ;-) The issue with internal flash though is that you need to execute the code that writes it from RAM, and hence you have to block all interrupts while doing so.

 

Your observation about the errata is interesting. Most people don't even read them.

 

My choice of TI is mainly the form factor of the Launchpad, and that I can get this nice LCD/SD boosterpack. Simply gets me started faster with stuff. I am looking at the STM32 NUCLEO line, which on paper is nice. But if you check out the details it's just not there. Which then again makes me wonder why other platforms seem to be more popular.

 

Edit: It would be naive to put the TM4C123 down to having just the cool launchpad. For my specific purpose it was more the fact that this thing has effectively 12 16bit/24bit timers and 12 32bit/48bit timers. The fact that UART/SPI have decent FIFOs, so that for most purposes you do not have to mess with DMA (at least when you bring up the software). The fact that every GPIO can raise an interrupt. The fact that most things are orthogonal (not 10 timers with 10 different feature sets).

 

- Thomas

Share this post


Link to post
Share on other sites

...

 

My choice of TI is mainly the form factor of the Launchpad, and that I can get this nice LCD/SD boosterpack. Simply gets me started faster with stuff. I am looking at the STM32 NUCLEO line, which on paper is nice. But if you check out the details it's just not there. Which then again makes me wonder why other platforms seem to be more popular.

 

What isn't there?

Share this post


Link to post
Share on other sites

What isn't there?

 

- USB OTG connector (there is just the one for the STlink)

- the boards all run off the internal precision oscillator, so you have to rework/upgrade them to get precise clocks (needed for USB/CAN)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×