Skip to content
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

请教 KVDB 掉电异常后的恢复方法 #274

Open
honorx opened this issue Jan 4, 2024 · 0 comments
Open

请教 KVDB 掉电异常后的恢复方法 #274

honorx opened this issue Jan 4, 2024 · 0 comments

Comments

@honorx
Copy link

honorx commented Jan 4, 2024

FlashDB 掉电安全测试

FlashDB 版本:2.1.0
分区大小:1KB
擦除大小:256B
写入粒度:32BIT

测试方式:
以 fdb_kv_get_blob() 读取上电计数 bootCnt 自增后,用 fdb_kv_set_blob() 更新;只写入 bootCnt 一个键值
1,不掉电,正常运行,bootCnt 会 1,2,3,4 。。。不断自增,此时程序没有问题;
2,bootCnt 自增更新过程中,随机按复位键,触发 FLASH 写入失败,会有如下两种情况:

  • 提示 CRC 校验失败,无法读取到最后一次的 bootCnt;
  • 提示 CRC 校验失败,可以读取到最后一次的 bootCnt,再次更新提示 FDB_SAVED_FULL,且垃圾回收失败无法恢复

折腾好久没有进展,请教一下大家,是否有遇到这种情况,只能格式化 FLASH 恢复么,还是我少了什么处理步骤,感谢!

附部分测试日志

`[INFO]: System PowerUP Count:1
[FlashDB][kv]
[env][FlashDB]
Error: Read the KV (bo9▒9▒9@0x00000024) CRC32 check failed!

[FlashDB][kv]
[env][FlashDB]
Error: Read the KV (bootCnt@0x00000224) CRC32 check failed!

[FlashDB][kv]
[env][FlashDB]
Warning: Alloc an KV (size 52) failed when new KV. Now will GC then retry.

[FlashDB][kv]
[env][FlashDB]
Error: Alloc an KV (size 52) failed after GC. KV full.`

FlashDB CRC FULL 错误日志.txt
LOG

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant