Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EEPROM Library Not working, crashes. LM4C, Connected Launchpad — Replace ROM_ by RAM_ functions #576

Closed
kaylee-kerin opened this issue Mar 22, 2015 · 3 comments

Comments

@kaylee-kerin
Copy link

Using the connected launchpad (TM4C1294XL) - and the EEPROM library, crashes the app (Same code works on Arduino)

I found this note in the Silicon Errata: Mem#11 on Page 51 (http://www.ti.com/lit/er/spmz850d/spmz850d.pdf)

The ROM_EEPROMInit API in TivaWare does not correctly initialize the EEPROM
module as described in the data sheet. It should not be used to initialize the EEPROM.
Workaround(s): Use the Flash version of the EEPROMInit API in TivaWare version 2.1 or later.

The following patch will reconfigure the map for the connected launchpad, and switch to using the MAP version of the EEPROM write code in EEPROM.cpp, instead of the hard coded ROM version. Only tested on Connected Launchpad (TM4C1294XL).

--- rom.h.orig  2014-07-19 19:11:54.428743038 -0400
+++ rom.h       2014-07-19 19:12:32.231312244 -0400
@@ -889,8 +889,7 @@
 //
 //*****************************************************************************
 #if defined(TARGET_IS_BLIZZARD_RA3) ||                                        \
-    defined(TARGET_IS_BLIZZARD_RB1) ||                                        \
-    defined(TARGET_IS_SNOWFLAKE_RA0)
+    defined(TARGET_IS_BLIZZARD_RB1) 
 #define ROM_EEPROMRead                                                        \
         ((void (*)(uint32_t *pui32Data,                                       \
                    uint32_t ui32Address,                                      \
@@ -973,8 +972,7 @@
         ((uint32_t (*)(void))ROM_EEPROMTABLE[12])
 #endif
 #if defined(TARGET_IS_BLIZZARD_RA3) ||                                        \
-    defined(TARGET_IS_BLIZZARD_RB1) ||                                        \
-    defined(TARGET_IS_SNOWFLAKE_RA0)
+    defined(TARGET_IS_BLIZZARD_RB1)
 #define ROM_EEPROMProgram                                                     \
         ((uint32_t (*)(uint32_t *pui32Data,                                   \
                        uint32_t ui32Address,                                  \
--- EEPROM.cpp.orig     2015-03-22 13:25:28.832987269 -0400
+++ EEPROM.cpp  2014-07-19 19:16:24.228934315 -0400
@@ -48,7 +48,7 @@
        //int word = (address / BYTES_PER_WORD) % WORDS_PER_BLOCK;
        unsigned long wordVal = 0;

-       ROM_EEPROMRead(&wordVal, byteAddr, 4);
+       MAP_EEPROMRead(&wordVal, byteAddr, 4);
        wordVal = wordVal >> (8*(address % BYTES_PER_WORD));

        return (uint8_t) wordVal;
@@ -59,11 +59,11 @@
        unsigned long byteAddr = address - (address % BYTES_PER_WORD);

        unsigned long wordVal = 0;
-       ROM_EEPROMRead(&wordVal, byteAddr, 4);
+       MAP_EEPROMRead(&wordVal, byteAddr, 4);
        wordVal &= ~(0xFF << (8*(address % BYTES_PER_WORD)));
        wordVal += value << (8*(address % BYTES_PER_WORD));

-       ROM_EEPROMProgram(&wordVal, byteAddr, 4);
+       MAP_EEPROMProgram(&wordVal, byteAddr, 4);
 }

 EEPROMClass EEPROM;
@robertinant
Copy link
Member

Which EEPROM library is this?

@kaylee-kerin
Copy link
Author

The one in Energia 14 (also happens in 11 and 12)

On Mon, Mar 23, 2015 at 11:03 AM, robertinant notifications@github.com
wrote:

Which EEPROM library is this?


Reply to this email directly or view it on GitHub
#576 (comment).

@rei-vilo rei-vilo changed the title EEPROM Library Not working, crashes. LM4C, Connected Launchpad EEPROM Library Not working, crashes. LM4C, Connected Launchpad — Replace ROM_ by RAM_ function Mar 23, 2015
@rei-vilo rei-vilo changed the title EEPROM Library Not working, crashes. LM4C, Connected Launchpad — Replace ROM_ by RAM_ function EEPROM Library Not working, crashes. LM4C, Connected Launchpad — Replace ROM_ by RAM_ functions Mar 23, 2015
RickKimball added a commit to RickKimball/tivac-core that referenced this issue Jul 20, 2016
Use the FLASH version of the EEPROM routines for the tm4c1294ncdpt instead of the
ROM ones. See energia/Energia#576
@robertinant
Copy link
Member

This issue was moved to energia/tivac-core#20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants