Hello to all,
I have developed our project and successfully write data into flash but got stuck for retrieve data from flash.
When I call read function getting 0xffffff length continuous in record read here is my below function:
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
uint8_t *fds_read_data(uint16_t file_no, uint16_t file_key, uint8_t *read_data) {
uint32_t read_counter = 0;
ret_code_t err_code;
uint32_t length = 0;
fds_flash_record_t flash_record = {0};
fds_record_desc_t record_desc = {0};
fds_find_token_t ftok = {0};
memset(&ftok, 0x00, sizeof(fds_find_token_t));
memset(&record_desc, 0x00, sizeof(fds_record_desc_t));
memset(&flash_record, 0x00, sizeof(fds_flash_record_t));
while (fds_record_find(file_no, file_key, &record_desc, &ftok) == FDS_SUCCESS) {
err_code = fds_record_open(&record_desc, &flash_record);
if (err_code != FDS_SUCCESS) {
// Handle error
NRF_LOG_DEBUG("fds_record_open error %d\r\n", err_code);
}
uint8_t *data;
data = (uint8_t *)flash_record.p_data;
length = flash_record.p_header->length_words * sizeof(uint32_t);
for (int j = 0; j < length; j++) {
read_data[read_counter++] = data[j];
Getting stuck for How i read proper data from flash using FDS lib
Looking forward to your response..!!!
Thanks,
Vishal Borle