4 Replies Latest reply on Sep 8, 2015 5:34 PM by MichaelF_56 Branched to a new discussion.

    BCM20736S NVRAM functions for External I2C EEPROM Device

      The SDK provides several functions (e.g. bleprofile_ReadNVRAM/bleprofile_WriteNVRAM) that read and write via the I2C interface to an EEPROM device with ID bits set to "000".  This works for the BCM20736S Module which has an internal EEPROM with ID 000.

       

      Our application adds an external EEPROM on the I2C interface with device ID set to 001 to distinguish it from the internal EEPROM with ID 000.

       

      Unfortunately, The SDK NVRAM functions do not include a calling parameter for the device ID.  They only write / read the internal EEPROM.   Also it appears that the source code for these functions is not exposed in the SDK.  This means we need to write our own NVRAM functions that duplicate the SDK functions and provide read/write for the external EEPROM.  Besides the pain of re-inventing an already existing wheel, we are in a time crunch due to a series of unexpected issues and having pre-canned NVRAM read write functions would help a lot with this.

       

      Questions:

      1. Does anybody have some source code for doing NVRAM read/write over the BCM20736S I2C interface?  Would you be willing to part with it?

      2. Can Broadcom provide the source code for the bleprofile_ReadNVRAM/bleprofile_WriteNVRAM functions so that we might copy them and modify to suit our application?

       

      Thanks!

       

      ehoffman

        • 1. Re: BCM20736S NVRAM functions for External I2C EEPROM Device

          Hello Eric,

           

          Currently the API commands only write to the ID 000 as you have indicated.

           

          You will need to write equivalent commands for our external EEPROM

           

          We will ask the developers for the API for creation of these equivalent commands.

           

          Thanks

          JT.

          • 2. Re: BCM20736S NVRAM functions for External I2C EEPROM Device
            ArvindS_76

            bleprofile_*NVRAM() API can only access the primary EEPROM (the one to which the app image is downloaded; always with 000 address inputs). The FW can read from/write to other EEPROMs on the same I2C bus. Try these:

             

            /// Write to an EEPROM on the I2C bus.

            /// \param eepromAddress The address/offset into the EEPROM to write to.

            /// \param writeCount  The number of bytes to write

            /// \param buffer   Pointer to the buffer that holds the data to write

            /// \param deviceAddress  The slave address - access code in bits 7:1. Bit 0 has to be 0.

            /// \return 0 for success, 1 for failure.

            UINT8 serEepromWrite(UINT16 eepromAddress, UINT16 writeCount, UINT8* buffer, UINT8 deviceAddress);

             

             

            /// Read from an EEPROM on the I2C bus.

            /// \param eepromAddress The address/offset into the EEPROM to read from.

            /// \param readCount  The number of bytes to read.

            /// \param buffer   Pointer to the buffer that will hold the data after the read.

            /// \param deviceAddress  The slave address - access code in bits 7:1. Bit 0 has to be 0.

            /// \return 0 for success, 1 for failure.

            UINT8 serEepromRead(UINT16 eepromAddress,  UINT16 readCount, UINT8* buffer, UINT8 deviceAddress);

             

             

            /// Polls the EEPROM until it is ready. Useful to check if a write is committed.

            /// \param deviceAddress  The slave address - access code in bits 7:1. Bit 0 has to be 0.

            void serEepromWaitIdle(UINT8 deviceAddress);

             

             

            These API are available only on SDK 2.x.

            • 3. Re: BCM20736S NVRAM functions for External I2C EEPROM Device

              Just to update this thread with current info..

              We are currently using the I2C EEPROM read/write functions in the cfa.h and i2cm.h header files.  Either one works as they are apparently the same function underneath the wrapper.  There are some restrictions to be aware of though, which I have listed in a separate thread.

              • 4. Re: BCM20736S NVRAM functions for External I2C EEPROM Device
                MichaelF_56

                Please update the new thread here: Re: Issues with i2cm.h and cfa.h API for I2C EEPROM I/O

                 

                As nobody monitors these closed threads except myself.