- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
Solved! Go to Solution.
- Labels:
-
FlashEEPROM
-
SDK 2.X
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found the reason, I changed Port1 from GPIO_PIN_WP to commented.
Thank you.