Maximum number of records per file ?

I am writing 3305 records into a single FDS "file" (0x1000)

But when looping through them with `while ((err_code = fds_record_find_in_file(data_type_to_file_id(data_type), &record_desc, &find_token)) == NRF_SUCCESS) {` it loops through only 2304 records.
For the last one, err_code is FDS_ERR_NOT_FOUND, exactly like if there was no more records in this file.

For the first 2304, I have no issue retrieving, writing, updating them, ...

I have launched my program several times, it always loops through 2304 records. Is this a known limit of maximum number of records for one file ?

Code :

    ret_code_t err_code;
    fds_flash_record_t flash_record;
    fds_record_desc_t record_desc;

    fds_find_token_t find_token;
    memset(&find_token, 0x00, sizeof(fds_find_token_t));


    while ((err_code = fds_record_find_in_file(data_type_to_file_id(data_type), &record_desc, &find_token)) == NRF_SUCCESS) {
        < check record >
    }

Parents Reply
  • Hi,

    Do you by any chance have the Power-fail comparator enabled? I ask because if there if enabled and VDD is lower than the configured threshold, that will cause a POFWARN event, and while active, the NVMC will not write to flash. However, there is no feedback about this, so the flash operation will seemingly have been successful. See Power-fail comparator for details. If this is the case, you should not see the failure if you disable the power-fail comparator (don't enable it), or if the voltage never drops the threshold (I don't know what else happens when you use RTT, but it could be that in that case the voltage never drops below the threshold).

    I don't have any particular reason for beliving that this is the issue you are seeing, but it is the only condition I can think of that would make a flash write operation seemingly successful without actually writing data to flash.

Children
Related