Hello, i am trying to store a lot of informations in the flash in order to do this i separated my data in several arrays. I want to store all my arrays in with the same file_ID and different key_ID in the FDS.
I use this funtion to update the data in the flash
uint32_t m_env_flash_meas_store(const m_meas_temp_t * p_data,uint16_t key)
{
uint32_t err_code;
fds_record_t record;
fds_record_chunk_t record_chunk;
NRF_LOG_DEBUG("Storing measurements...\r\n");
NULL_PARAM_CHECK(p_data);
memcpy(&m_meas.data.meas_data, p_data, sizeof(m_meas_temp_t));
m_meas.data.valid = ENV_FLASH_CONFIG_VALID;
// Set up data.
record_chunk.p_data = &m_meas;
record_chunk.length_words = sizeof(m_env_flash_meas_t)/4;
// Set up record.
record.file_id = ENV_FILE_MEAS_ID;
record.key = key;
record.data.p_chunks = &record_chunk;
record.data.num_chunks = 1;
err_code = fds_record_update(&m_record_meas_desc, &record);
if (err_code == FDS_ERR_NO_SPACE_IN_FLASH)
{
//m_pending_gc = true;
//err_code = fds_gc();
}
RETURN_IF_ERROR(err_code);
return NRF_SUCCESS;
}
unfortulately when i write with the same file_ID and the different key it invalidates all the others records with the same key and they are deleted, do you know where this issue could come from ?