Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

PROBLEM WHILE READ FLASH 25Q64 USING SPI FOR NRF52832 .

I wanna ask about this code. Why we use "memset" before read flash?. Must i create new token before read flash.

#define RECORD_KEY 0x2222
fds_flash_record_t flash_record;
fds_record_desc_t record_desc;
/* It is required to zero the token before first use. */
memset(&ftok, 0x00, sizeof(fds_find_token_t));
/* Loop until all records with the given key and file ID have been found. */
while (fds_record_find(FILE_ID, RECORD_KEY, &record_desc, &ftok) == FDS_SUCCESS)
{
if (fds_record_open(&record_desc, &flash_record) != FDS_SUCCESS)
{
/* Handle error. */
}
/* Access the record through the flash_record structure. */
/* Close the record when done. */
if (fds_record_close(&record_desc) != FDS_SUCCESS)
{
/* Handle error. */
}
}
Parents Reply Children
Related