Skip to content

Refactoring and fixing some issues in KVStore configuration. #9237

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

Merged
merged 3 commits into from
Jan 8, 2019

Conversation

yossi2le
Copy link
Contributor

@yossi2le yossi2le commented Jan 3, 2019

Description

In this PR the kv_confoig is refactored by breaking some function, adding lots of remarks and fixing some bugs. Also, some changes in the config parameters are done. below is the list of changes:

  1. Adding default option to storage_type parameter which enables the system to set the best kvstore storage_type which fits the type of default block device enabled in target.json.

  2. The parameter of rbp_num_of_enteries has been remove from TDB_EXTERNAl and FILESYSTEM configuration files because its created confusion with the rbp_internal_size parameter and was not needed.

  3. 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.

  4. Fixing a bug in which FAT filesystem has been failed to mount after reset.

This PR is needed for mbed-os 5.11.2

Pull request type

[ ] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[X] Breaking change

Reviewers

Yossi Levy added 2 commits January 3, 2019 14:01
…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
@ciarmcom ciarmcom requested review from a team January 3, 2019 14:00
@ciarmcom
Copy link
Member

ciarmcom commented Jan 3, 2019

@yossi2le, thank you for your changes.
@ARMmbed/mbed-os-storage @ARMmbed/mbed-os-maintainers please review.

@0xc0170 0xc0170 requested review from bulislaw and a user January 3, 2019 15:15
@adbridge
Copy link
Contributor

adbridge commented Jan 3, 2019

@ChiefBureaucraticOfficer as this is requesting a breaking change for a patch release, it needs your specific approval

@bulislaw
Copy link
Member

bulislaw commented Jan 3, 2019

In Mbed OS we have policy of not breaking compatibility. Why does it need to break it? Is it to fix critical bug?

@dannybenor

@dannybenor
Copy link

@bulislaw The breaking change is in the configuration. The original setup included too much freedom and complexity, in a way that the PDMC and bootloader were not able to cope with.
No changes in API.

Copy link
Member

@bulislaw bulislaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't actually think it's a breaking change. Looks good, except the docs should be reworded as they are confusing.

@dannybenor please approve as TL for storage.

@@ -62,6 +62,8 @@ The following is a list of all storage parameters available and their descriptio
* `TDB_EXTERNAL_NO_RBP`.
* `FILESYSTEM`.
* `FILESYSTEM_NO_RBP`.
* `default`
If default is set, the system will choose the type of storage base on the block device component set in target.json. For QSPIF, SPIF and DATAFLASH block devices TDB_EXTERNAL will be used. If SD is set a FILESYSTEM storage is set and if only FLASHIAP exists as the only block device component, a TDB_INTERNAL will be used.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AnotherButler this addition to docs is confusing, could you help us reword it a bit to make it clearer?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As Amanda is not available this week, can this be addressed separately (@yossi2le can you make sure it will be updated )

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem, I will take for that next week,

@cmonr
Copy link
Contributor

cmonr commented Jan 4, 2019

CI started

@mbed-ci
Copy link

mbed-ci commented Jan 7, 2019

Test run: FAILED

Summary: 2 of 7 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_build-ARM
  • jenkins-ci/mbed-os-ci_build-GCC_ARM

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 7, 2019

We are experiencing CI node failures, few jobs were aborted. We are investigating, will restart the jobs once fixed.

cc @ARMmbed/mbed-os-test

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 7, 2019

Ci restarted

@mbed-ci
Copy link

mbed-ci commented Jan 7, 2019

Test run: FAILED

Summary: 1 of 7 test jobs failed
Build number : 2
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_build-ARM

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 7, 2019

Please review the build failure (kv_config.cpp does not compile for one target)

@yossi2le
Copy link
Contributor Author

yossi2le commented Jan 7, 2019

Found the issue. a return statement was missing in _storage_config_default when no component is defined.

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 7, 2019

CI restarted

@mbed-ci
Copy link

mbed-ci commented Jan 7, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 3
Build artifacts

@0xc0170 0xc0170 merged commit b833bbd into ARMmbed:master Jan 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants