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?
struct configStruct buffer;
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;