2 Replies Latest reply on Sep 17, 2014 1:13 AM by eyan

    bleprofile_ReadNVRAM returns different value

      In WICED_SMART_SDK 2.1.0,

      I compared 2 applications, one is cycling_speed_cadence and the other is hello_sensor.

       

      For both case, I put the following codes at the end of application_create().

      UINT8 TestReadFlag1= 0x04;

      UINT8 TestReadFlag2;

      UINT8 TestReadFlag3;

       

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

      TestReadFlag3 = bleprofile_ReadNVRAM(VS_BLE_HOST_LIST, sizeof(UINT8), (UINT8*)&TestReadFlag2);

      ble_trace2("TestReadFlag2 is %d, Read result is %d", TestReadFlag2, TestReadFlag3);

       

      In cycling_speed_cadence, it worked properly.

      TestReadFlag2 is 4, Read result is 1

       

      but In hello_sensor, NVRAM read or write seem not to work properly.

      the message was

      TestReadFlag2 is 0, Read result is 0

       

      Could you recommend which points I did wrong?

        • 1. Re: bleprofile_ReadNVRAM returns different value
          VikramR_26

          I realized you might have put the following piece of code

           

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

          TestReadFlag3 = bleprofile_ReadNVRAM(VS_BLE_HOST_LIST, sizeof(UINT8), (UINT8*)&TestReadFlag2);

          ble_trace2("TestReadFlag2 is %d, Read result is %d", TestReadFlag2, TestReadFlag3);

           

          before

          bleprofile_GPIOInit(bleprofile_gpio_p_cfg);


          Reason why it needs to be after this method is since GPIOInit enables the write protect for writing data in NVRAM.

          I tried it and verified and it works on both hello_sensor and cycling_speed_cadence.

           

           

           

           

          1 of 1 people found this helpful
          • 2. Re: bleprofile_ReadNVRAM returns different value

            I found the reason, I changed Port1 from GPIO_PIN_WP to commented.

             

            Thank you.