-
Notifications
You must be signed in to change notification settings - Fork 0
Refactoring in kv_config, Add remarks documentation to kv_config and remove rbp_num_of_enteries #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, excluding some minor English fixes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you already changed it, please change to "Default is the size of the 2 last sectors of internal flash".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"There are less than two sectors - TDBStore will not work."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here - "Default is the size of the 2 last sectors of internal flash".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
eb91169 to
8991abb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont think size can be 0 here because its Non default configuration and here start_address==0, so size must be different.
If for any reason size is 0 , then when you calculate above:
start_address = flash_end_address - size;
aligned_start_address = align_down(start_address, flash.get_sector_size(start_address));
start_address will become flash_end_address and then
I think it should be flash.get_sector_size(start_address-1)
…efault values are use remove of rbp_number_of_entries from the kvstore configuration. Adding default option for storage_type allowing the system to choose TDB_INTERNAl, TDB_EXTERNAL or FILESYSTEM base on the blockdevice component set in the target board. Adding remarks to kv_config.cpp and break simplify the _get_blockdevice_FLASHIAP function
03d6f3d to
388da7f
Compare
Description
The function _get_blockdevice_FLASHIAP in kv_config.cpp has been refactored into 3 function. the first function will calculate the default start address and size for internal TDBStore in case of rbp when KVStore is configured as TDB_EXTERNAL or FILESYSTEM. a second function will calculate the default start address and size for the case we run in TDB_INTERNAL. and the last is _get_blockdevice_FLASHIAP which will check the validity of parameters and create the block device.
Also, lots of remarks have been added to the code in order to simplify the understanding of the complex configuration code.
Last thing, the parameter of rbp_num_of_enteries has been remove from TDB_EXTERNAl and FILESYSTEM configuration files.
Pull request type
Reviewers
@dannybenor , @davidsaada , @theamirocohen and @offirko
Please review. I will create a real PR after your review.