This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How i write one or two bytes into flash memory using fds lib?

I am using nRF52840 with sdk 15.0 version. I am able to read OR write data into flash using fds library. But now i want to write one or two bytes into flash and read this bytes,  how i know the length of that byte while reading data from flash. I know fds library need to at least 4 bytes

For example i want to write integer value 1 or 0. How this possible write and also read with length of read data.

Thanks......

Parents Reply
  • Thanks for fast reply....

    Here is below function that i am currently using:

      ret_code_t ret = fds_write(FILE_ID, REC_KEY,data_to_store,length);
      if (ret == FDS_SUCCESS) {
        NRF_LOG_DEBUG("FDS stored");
      } else {
        NRF_LOG_DEBUG("FDS failed error code:%d", ret);
      }

    Lets say FILE_ID = 0x0003 & KEC_KEY = 0x1111

    data_to_store[length]; & length = 73KB.

    Ques:

    1. Is it possible to store 73KB data in one request of fds_write(..); with above FILE_ID & KEC_KEY 
    2. How use FDS_VIRTUAL_PAGES & FDS_VIRTUAL_PAGE_SIZE in available in sdk_config.h for storing 73KB data.

    Thanks..!!!

Children
Related