Using Reserved virtual page space for storing very critical value which needs to be saved for a very long time.

Value can only be changed on characteristics write. Every time a new value has to be written to the critical component , I first erase the page and then write on that page.

/** Erase the page and then write to the reserved flash**/
ret_code_t ret = nrf_fstorage_erase(&reserve_fs,write_address,1,NULL);
return nrf_fstorage_write(&reserve_fs, write_address, page_tag_data1, 4 * sizeof(uint32_t), NULL);

This is the code snippet.

Is there a possibility that this method breaks at some point.

I am also doing GC(garbage collection) on the rest of the pages, can gc be done on this page as well.

Related