-
Notifications
You must be signed in to change notification settings - Fork 1.5k
mtd/nvs: optimize nvs module #17829
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
mtd/nvs: optimize nvs module #17829
Conversation
|
fix check error: |
done |
|
Hi @zhaoxingyu12, please note this error. |
|
@zhaoxingyu12 please fix: |
c0e87e2
|
|
Error: mtd_config_fs_test_main.c:75:5: error: "CONFIG_MTD_WRITE_ALIGN_SIZE" is not defined, evaluates to 0 [-Werror=undef] pls help to retrigger CICT, these errors have already fixed in mtd_config_fs_test_main.c, thanks @xiaoxiang781216 |
|
@zhaoxingyu12 please rebase and push your change. |
remove CONFIG_MTD_WRITE_ALIGN_SIZE kconfig instead of using geo.blocksize directly Signed-off-by: zhaoxingyu1 <[email protected]>
add MTD_BREAD/MTD_BWRITE in nvs when CONFIG_MTD_BYTE_WRITE is n Signed-off-by: zhaoxingyu1 <[email protected]>
By obtaining the erase value to set the nvs special ID instead of using a fixed value Signed-off-by: zhaoxingyu1 <[email protected]>
and rename ret to rc for keeping the consistency with other macros Signed-off-by: Xiang Xiao <[email protected]>
rename MTD_BLOCKSIZE_MULTIPLE to CONFIG_MTD_CONFIG_BLOCKSIZE_MULTIPLE Signed-off-by: zhaoxingyu1 <[email protected]>
By obtaining the erase value to set the nvs special ID instead of using a fixed value Signed-off-by: zhaoxingyu1 <[email protected]>
got it, thanks |
Note: Please adhere to Contributing Guidelines.
Summary
make some optimizations to the NVS module, including specifying macro names and fixing bugs.
a. Add NVS_ prefix to ADDR_XXX
b. rename MTD_BLOCKSIZE_MULTIPLE to MTD_CONFIG_BLOCKSIZE_MULTIPLE
Impact
Scenarios for storing key value using nvs
Testing
This has been tested and passed in qemu, using NVS for KV read and write
testcases: apps/testing/mtd_config_fs/mtd_config_fs_test_main.c
test_nvs_mount: test begin
test_nvs_mount: success
test_nvs_write: test begin
test_nvs_write: success
test_nvs_corrupt_expire: test begin
test_nvs_corrupt_expire: success
test_nvs_corrupted_write: test begin
test_nvs_corrupted_write: success
test_nvs_gc: test begin
test_nvs_gc: success
test_nvs_gc_3sectors: test begin
test_nvs_gc_3sectors: success
test_nvs_corrupted_sector_close: test begin
test_nvs_corrupted_sector_close: success
test_nvs_full_sector: test begin
test_nvs_full_sector: success
test_nvs_gc_corrupt_close_ate: test begin
test_nvs_gc_corrupt_close_ate: success
test_nvs_gc_corrupt_ate: test begin
test_nvs_gc_corrupt_ate: success
test_nvs_gc_touched_deleted_ate: test begin
test_nvs_gc_touched_deleted_ate: success
test_nvs_gc_touched_expired_ate: test begin
test_nvs_gc_touched_expired_ate: success
test_nvs_gc_not_touched_expired_ate: test begin
test_nvs_gc_not_touched_expired_ate: success
Final memory usage:
VARIABLE BEFORE AFTER DELTA
arena 4294 4294 0
ordblks 1 1 0
mxordblk eb0 eb0 0
uordblks 33e4 33e4 0
fordblks eb0 eb0 0
nsh>