1 Reply Latest reply on Jan 5, 2016 10:30 PM by BoonT_56

    Is there an nvram lock bit in the BCM20737 or BCM20737S?

    BoCo_1857246

      Hi all,

      I'm using the BCM20737S which is an BCM20737 with onboard eeprom, clock and antenna.

       

      I use the NVRAM functions to store 16 bytes of configuration data - see the implementation of saveConfig() below, using bleprofile_WriteNVRAM(). When I program my chip using the WICED IDE, this function works and the nvramFailed flag is never set.

       

      I just received some chips programmed by our distributor. The code running seems to be correct in all respects, and the correct firmware version is reported in my custom characteristic. However saveConfig() fails on the chip programmed by the distributor, setting the nvramFailed flag. If I then re-program the same chip using the WICED IDE the chip now works correctly.

       

      Does anyone know if there's a lock-bit that perhaps the factory is setting on the nvram area? Or any other reason why bleprofile_WriteNVRAM() wouldn't work?

      thanks

       

      void saveConfig(void)

      {

        UINT8 i;

        struct configStruct buffer;

        UINT8 *p1,*p2;

       

        config.chk=CALC_CONFIG_CHKSUM();

        bleprofile_WriteNVRAM(NVRAM_ID_CONFIG, sizeof(config), (UINT8 *) &config);

       

         // verify the write was successful

        bleprofile_ReadNVRAM(NVRAM_ID_CONFIG, sizeof(config), (UINT8 *) &buffer);

        for (i=0,p1 = (UINT8 *) &buffer, p2=(UINT8 *)&config; i<sizeof(config); i++,p1++,p2++)

        {

             if (*p1 != *p2)

                  hardwareFailed.flags.nvramFailed = 1;

        }