hello,
i am using nrf52832 with sdk 15.2 i want to store signed int values in to nvs (like rssi and tx power) so that i can change these in run time
typedef struct {
uint32_t s_no;
int8_t rssi;
int8_t tx_pwr;
} my_config_t;
my_config_t my_config_data =
{
.s_no=200000000,
.rssi=-60,
.tx_pwr=-4,
};
ret_code_t store_entire_data() {
erase_flash_config();
ret_code_t rc;
rc = nrf_fstorage_write(&fstorage, NVS_START_ADDRESS, &my_config_data, sizeof(my_config_data), NULL);
APP_ERROR_CHECK(rc);
wait_for_flash_ready(&fstorage);
return rc;
}
void fetch_config_data(void) {
ret_code_t rc;
my_config_data instance_data;
rc = nrf_fstorage_read(&fstorage, NVS_START_ADDRESS, &instance_data, sizeof(instance_data));
APP_ERROR_CHECK(rc);
if (instance_data.s_no != 0xFFFFFFFF) {
patient_tag_config_data.s_no = instance_data.s_no;
printf("instance data s_no=%d\n", instance_data.s_no);
}
if (instance_data.rssi != #whatshould imput here) {
patient_tag_config_data.rssi = instance_data.rssi;
}
if (instance_data.tx_pwr != #whatshould imput here) {
patient_tag_config_data.tx_pwr = instance_data.tx_pwr;
}
in main()
{
fstorage_init(NVS_START_ADDRESS, NVS_END_ADDRESS);
store_entire_data();
fetch_config_data();
fstorage_uninit();
}
i can able to change the unsigned int variable but could not do the same for signed and also one more thing i am using this command to write on a particular address nrfjprog -f NRF52 --memwr 0x00071000 --val 0x0bebedaa --verify during flash time is there any way to change the content of these address during run time
thanks and regards
manikandan v
