I wanna ask about this code. Why we use "memset" before read flash?. Must i create new token before read flash.
I wanna ask about this code. Why we use "memset" before read flash?. Must i create new token before read flash.
Hi
I'm not sure which SDK version you're using exactly, but yes, you need to zero the token before reusing it like the comment right above the memset() call says.
Best regards,
Simon
Can use tell me why "need to zero the token before reusing it". Token for what ?
Hi
The fds token is a token that keeps information about the progress of functions like fds_record_find, fds_record_find_by_key, and fds_record_find_in_file.
You should always zero-initialize the token before using it for the first time. Never reuse the same token to search for different records as that will jumble up stored flash data. This will result in erroneous data and operations by your application.
Best regards,
Simon