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 TM4C1294NCPDT

Other Parts Discussed in Thread: TM4C1294NCPDT

Hi all


MCU :TM4C1294NCPDT
Compiler:Keil uVision5
EEPROMProgram((uint32_t *)&e2prom_write_value, E2PROM_TEST_ADRES, sizeof(e2prom_write_value));
EEPROMRead((uint32_t *)&e2prom_read_value, E2PROM_TEST_ADRES, sizeof(e2prom_read_value));
The function of the third parameter is any value ?
I put it into any of the numerical results are the same.
Is this what causes it?


Thanks
Lewis

  • Hi Lewis,

    This question is not related to TI-RTOS. Moving this post to the TM4C forum for faster response from the TM4C experts.

    Thanks,

    VIkram

  • Hello Lewis,

    Following is a code example. In the EEPROMProgram the ui32EEPROMWriteData array is stored to the EEPROM location 0x0. Since there are 16 elements the total number of words is the third parameter (0x40 = 64 bytes = 16*4 bytes). Similarly for the read EEPROMRead API Call.

    uint32_t ui32EEPROMWriteData[16];
    uint32_t ui32EEPROMReadData[16];
    //
    // Program the Words to Page-0 and Page-1
    //
    EEPROMProgram(&ui32EEPROMWriteData,0x0,0x40);

    //
    // Read the Words back from Page-0 and Page-1
    //
    EEPROMRead(&ui32EEPROMReadData,0x0,0x40);


    Regards
    Amit
  • Hi  VIkram

         

    I raised the issue in TM4C thread, why it will appear in the TI-RTOS threads?

  • Hi  Amit

    My part of the code is defined as follows:

    struct E2PROM

    {

           char *value;

           char *ss;

    };

    struct E2PROM e2prom_write_value = {"aaaaaaaaaaa","bbbbbb"};

    struct E2PROM e2prom_read_value =  {"",""};

    UARTprintf("Write Try -> Address %u: Struct : {%s}\n", E2PROM_TEST_ADRES, e2prom_write_value.value);

    EEPROMProgram((uint32_t *)&e2prom_write_value, E2PROM_TEST_ADRES, sizeof(e2prom_write_value));

    EEPROMRead((uint32_t *)&e2prom_read_value, E2PROM_TEST_ADRES, sizeof(e2prom_read_value));

    UARTprintf("Read Try -> Address %u: Struct : {%s,,%s}\n", E2PROM_TEST_ADRES,e2prom_read_value.value,e2prom_read_value.ss);

    When I put the code into the red blue ,but  outputs the result is the same , which is the result of what causes?

    EEPROMProgram((uint32_t *)&e2prom_write_value, E2PROM_TEST_ADRES, 16);

    EEPROMRead((uint32_t *)&e2prom_read_value, E2PROM_TEST_ADRES, 16);

    Thanks

    Lewis

  • Hi  all

           

    MCU :TM4C1294NCPDT
    Compiler:Keil uVision5

    EEPROMProgram((uint32_t *)&e2prom_write_value, E2PROM_TEST_ADRES, sizeof(e2prom_write_value)); 

    EEPROMRead((uint32_t *)&e2prom_read_value, E2PROM_TEST_ADRES, sizeof(e2prom_read_value)); 

    The function of the second parameter is within a certain range of addresses or an address you can write any value (for example: 0x00000000, or other value)? What are the start and end values of the EEPROM are?


    Thanks
    Lewis

  • Hello Lewis,

    What is the output of the UARTprint that you get on a terminal. Can you please send that as well?

    Regards
    Amit
  • Hello Lewis,

    Your EEPROM Code is working fine since what you write is what you will get from EEPROM if the same address and size is used for EEPROMRead as EEPROMProgram.

    As I mentioned earlier the EEPROM stores upto 6144 bytes (1536 words). So the Start and End Address have to be in the same range,

    Regards
    Amit
  • Hi   Amit

    EEPROMProgram((uint32_t *)&e2prom_write_value, E2PROM_TEST_ADRES, sizeof(e2prom_write_value));

    EEPROMRead((uint32_t *)&e2prom_read_value, E2PROM_TEST_ADRES, sizeof(e2prom_read_value));

    #define    E2PROM_TEST_ADRES   0x00000000

    or 

    #define    E2PROM_TEST_ADRES   0x00000800

    or

    #define    E2PROM_TEST_ADRES   0x00ffffff

    The function of the second parameter is within a certain range of addresses or an address you can write any value (for example: 0x00000000, or other value)? What are the start and end values of the EEPROM are?

     

    Thanks

    Lewis

  • Hello Lewis,

    The second parameter has a range of values from 0x0 to 0x17FC. If a value specified is more than 0x17FC then it will do a wrap to Block-0. I hope that clarifies

    Regards
    Amit
  • Hi     Amit

           I found TM4C1294NCPDT the FLASH address range from 0x00000000 ~ 0x000fffff. If I define  value  of the second parameter is also between 0x00000000 and 0x000fffff,  then it is written in FLASH or EEPROM?

     

    Thanks

    Lewis

  • Hello Lewis,

    No, it is not written to Flash. The address of EEPROM is an indirect address that is mapped by the EEPROM Controller. This has got "no" relation to the main Flash Bank of TM4C12x devices.

    Regards
    Amit