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.

EEPROM Program



Hi,

I am using 123GH6PGE DK , TivaWare_C_Series-1.1 and CCS 5.4

and while i'm trying to write and read to a specific address at EEPROM usin the APIS mentioned in the Tivaware lib

i got that error while debugging (CORTEX_M4_0: Trouble Reading Memory Block at 0x69603c10 on Page 0 of Length 0xd: Debug Port error occurred.)

an i couldn't write nor read from the EEPROM

That is my app code

//---------------------------------------------------------------------------
// Project: EEPROM TM4C
// Author: AHmed Hassan
// Date: March 2014
//---------------------------------------------------------------------------


//------------------------------------------
// TivaWare Header Files
//------------------------------------------
#include <stdint.h>
#include <stdbool.h>

#include <eeprom.h>


/*
 * main.c
 */
void main()
{

        uint32_t pui32Data[2];
        uint32_t pui32Read[2];
        //
        // Program some data into the EEPROM at address 0x400.
        //
        pui32Data[0] = 0x12345678;
        pui32Data[1] = 0x56789abc;

        while(1)
        {

        EEPROMProgram(pui32Data, 0x400, sizeof(pui32Data));
        //
        // Read it back.
        //
        EEPROMRead(pui32Read, 0x400, sizeof(pui32Read));
        }

    }

  • Hello Ahmad,

    The EEPROM Clock has to be enabled and Init routine has to be called.before any Program Read can be done.

    //

    // Enable Clocks to the EEPROM

    //

    SysCtlPeripheralEnable(SYSCTL_PERIPH_EEPROM0);

    //

    // Check if EEPROM Does not have a error code.

    //

    if(EEPROMInit() != EEPROM_INIT_OK) {

    while(1);

    }

    Regards

    Amit