Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ef_log: erase sector时发生复位或下电,重启时会丢失所有log #151

Open
CutClassH opened this issue Mar 12, 2023 · 1 comment

Comments

@CutClassH
Copy link

find_start_and_end_addr函数,358行和373行有如下的逻辑,发现setor status是错误,会调用ef_log_clean。

case SECTOR_STATUS_HEADER_ERROR:
EF_DEBUG("Error: Log sector header error! Now will clean all log area.\n");
ef_log_clean();
return;

如果在调用ef_log_write 写入log的过程中,刚好在ef_port_erase时复位或掉电,此时有一个sector的内容为全FFFF(或没擦完内容错误),再次上电时会吧整个log都清除了。
在log区域写满的情况下继续写入log(因为会经常erase setor),这个log全部丢失的问题出现的概率会很大。
是否考虑针对此场景,修改一下find_start_and_end_addr函数的逻辑?

@saviourxx
Copy link

我也遇到缓慢掉电,会丢失所有ENV数据。。。

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

No branches or pull requests

2 participants