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.

TM4C129ENCPDT: eeprom_pb multible parameter blocks

Part Number: TM4C129ENCPDT

Dear TI-team,

is it possible to define multiple parameterblocks using the uitil/eeprom_pb.h from the Tivaware?

It woud be a good ringbuffer for my spifram to store different structs.

thanks

Lukas

  • Hi lukas,

      Below is the note in the beginning of the eeprom_pb.c file. Yes, you can store multiple paramter blocks in the eeprom. 

    //*****************************************************************************
    //
    //! \addtogroup eeprom_pb_api
    //! @{
    //!
    //! This module is based on the flash_pb module, which uses flash sectors at
    //! the end of flash memory to store application parameter blocks. This module
    //! replaces the use of flash memory with the use of the EEPROM module,
    //! available in some Tiva devices.
    //!
    //! This module does not attempt to optimize the usage of EEPROM memory, but
    //! instead creates an API that will allow a very easy drop-in replacement in
    //! applications that are already using the flash_pb module.
    //
    //*****************************************************************************

  • Hi Charles,

    i probably didnt specify my question enough. Would it be possibele to init PBs at different addresses with different sizes. Since i dont know how to get the actual PBs back, because g_pui8FlashPBCurrent is a global variable.

    Thanks in advance!

    regards,

    Lukas

  • Hi Lukas,

      Reading the description of EEPROMPBInit(), you can specify the start address and size of a new parameter block.  Make sure of the special requirement highlighted in red as described below. Can you give a try?

    /*****************************************************************************
    //
    //! Initializes the eeprom parameter block.
    //!
    //! \param ui32Start is the offset from the beginning of the EEPROM memory to
    //! be used for storing the parameter block; this must be an integer multiple
    //! of 4 (that is, word aligned)
    //! \param ui32Size is the size of the parameter block when stored in flash;
    //! this must be an integer multiple of 4 (that is integer number of words).
    //!
    //! This function initialize the EEPROM module to be used for parameter block
    //! storage.
    //!
    //! A parameter block is an array of bytes that contain the persistent
    //! parameters for the application. The only special requirement for the
    //! parameter block is that the first byte is a sequence number (explained
    //! in EEPROMPBSave()) and the second byte is a checksum used to validate the
    //! correctness of the data (the checksum byte is the byte such that the sum of
    //! all bytes in the parameter block is zero).
    //!
    //! This function must be called before any other eeprom parameter block
    //! functions are called.
    //!
    //! \return 0 if successfully intialized, 1 otherwise.
    //
    //*****************************************************************************
    uint32_t
    EEPROMPBInit(uint32_t ui32Start, uint32_t ui32Size)
    {