This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

the inquiry for the usage of fds function & fstorage....

Hello,

I have 2 issues, please help to let me know and clarify them...thankful for your support in advance....

I need to know the confirmation about the usage of fds function, and to clarify the usage of fstorage in dfu(air not serial) environment... (overall necessary things to use correctly them..)

I need to use the fds function or fstorage function to save user data in dfu environment,

it means that the user data should be kept after doing dfu...

and I know that I should set DFU_APP_DATA_RESERVED in components\libraries\bootloader\dfu\nrf_dfu_types.h in order to confirm the size that should be matched with the size of user data that I would like to use/save... if being over... the error will be happened in fds and fstorage function... is it right ?

firstly, as to the usage of fds function, I enabled the related config in sdk_config.h like FDS_ENABLED, FDS_VIRTUAL_PAGES (I set it as 8) so on...

and I add fallback function to prevent data loss in the process of writing or updating in yps_storage_fds_evt_handler by using garbage collection function. 

please refer the code of the following link.. and help to let me know whether the code is no problem to use for mass-production...

when doing test for many times, if can confirm that the size of fds memory (saving region) is not over the size of user data. 

it no made any error.... it means that the key id of the same file id should be made by the size of user data that I would like to save... is it right ?

https://devzone.nordicsemi.com/f/nordic-q-a/29876/fds_err_not_found-issue-of-yps_storage_find-in-sdk-14-0-1?ReplySortBy=CreatedDate&ReplySortOrder=Ascending

if the code is no problem, I will use it to save user data for mass-production...

secondly, as to the usage of fstorage function, 

currently I don't know which address I should set for start/end address....

I know that if using dfu, the memory map is the same as the following link....

https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v14.2.0%2Flib_bootloader_dfu_banks.html&cp=4_0_0_3_5_1_2_2&anchor=lib_bootloader_dfu_appdata

and I know that I should use the region of app data to save user data.. is it right ?

so I check the DFU_APP_DATA_RESERVED setting to confirm the size ....

currently I set it as 8, so 8 * 1024 => 8k => 0x2000 so... I can set start address as 0x7D000 - 0x2000 =7b000. and end address is 0x7d000 is it right ?

if right, when experimenting by updating dfu image and firstly writing data and after updating package file (only app), only trying to read the same address, the result is failed, why ?

please help to let me know what is wrong or missing in the overall process....I need earnestly your help... I update the code. please refer the following link...

and if possible, Could you please kindly provide the example code with the detailed guide(instruction) ?

devzone.nordicsemi.com/.../nrf_fstorage_def-address-defined-issue-with-14-1-0

thanks.

Related