9 Replies Latest reply on Mar 12, 2015 9:43 AM by jota_1939431

    It seems that I can not read the data is stored in NVRAM before the last power off.

    user_2195381

      It seems that I can not read the data is stored in NVRAM before the last power off.

       

      // Create device

      void application_create(void)

      {

             extern UINT8 bleprofile_adv_num;

             extern UINT8 bleprofile_scanrsp_num;

       

             bleprofile_adv_num = 0x0;

             bleprofile_scanrsp_num = 0x0;

       

            bleprofile_Init(bleprofile_p_cfg);

            bleprofile_GPIOInit(bleprofile_gpio_p_cfg);

            blebat_Init();

       

          readbyte = bleprofile_ReadNVRAM(VS_BLE_HOST_LIST, sizeof(homedoor_hostinfo), (UINT8 *)&homedoor_hostinfo);

          ble_trace1("\nNVRAM read:%04d\n", readbyte);

          // I hope to read NVRAM data that is stored in the last power off

          //  but I get that trace data is "NVRAM read:0000" 

        

          bleprofile_WriteNVRAM(VS_BLE_HOST_LIST, sizeof(homedoor_hostinfo), (UINT8 *)&homedoor_hostinfo);

          readbyte = bleprofile_ReadNVRAM(VS_BLE_HOST_LIST, sizeof(homedoor_hostinfo), (UINT8 *)&homedoor_hostinfo);

          ble_trace1("\nNVRAM read:%04d\n", readbyte);

          //  I can get that trace data is "NVRAM read:0033".

          //   It is right for 33

          //   But, the data has been overwrite.

       

      Could you tell how to get the data is stored in NVRAM the last powe off ?