Hi,
I am developing a health wearable and want to store biosignal data into flash and then read at some point. I found that the reading process is relative slow as I tested (about 730 bytes/s). Is there any way to speed up the fds reading process? I have attached my read function bellow. Thank you so much!
ret_code_t fds_read_sub(uint16_t fid, uint16_t key_id, void * p_data ,uint32_t len_in_byte)
{
/*It is required to zero the token before first use. */
memset(&ftok, 0x00, sizeof(fds_find_token_t));
if(fds_record_find(fid, key_id, &record_desc, &ftok)==NRF_SUCCESS)
{
/*Open the record and read its contents. */
ret_code_t rc = fds_record_open(&record_desc, &flash_record);
if(rc != NRF_SUCCESS)
{
DEBUG_FDS_ERROR_PRINT("Error when fds record opening;\n");
return rc;
}
/*Copy the pointer from flash into p_data. */
memcpy_fast(p_data, flash_record.p_data, len_in_byte);
/*Close the record when done. */
if (fds_record_close(&record_desc) != NRF_SUCCESS)
{
DEBUG_FDS_ERROR_PRINT("Error when fds record close;\n");
return FDS_ERR_NO_OPEN_RECORDS;
}
}
else
{
return FDS_ERR_NOT_FOUND;
}
}