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

自动更新问题 #25

Closed
outely opened this issue Aug 8, 2018 · 6 comments
Closed

自动更新问题 #25

outely opened this issue Aug 8, 2018 · 6 comments

Comments

@outely
Copy link
Contributor

outely commented Aug 8, 2018

在开启EF_ENV_AUTO_UPDATE后,每次重新开机都会擦写Flash。
是否是缺少在ef_env_init()-->result = ef_load_env()中加载Flash中的EF_ENV_VER_NUMenv_cache[ENV_PARAM_INDEX_VER_NUM]
还是我配置或使用方式不对:smiley:

@armink
Copy link
Owner

armink commented Aug 8, 2018

在开启EF_ENV_AUTO_UPDATE后,每次重新开机都会擦写Flash。
正常是只有你修改了EF_ENV_VER_NUM 才会更新 env。

怀疑你是不是用的 demo 中的那个 boot counts 功能,那个是每次开机都自动加一,然后存储的。

@outely
Copy link
Contributor Author

outely commented Aug 8, 2018

我不是使用demo.
我尝试在EfErrCode ef_load_env(void)中增加
ef_port_read(get_env_system_addr() + ENV_PARAM_INDEX_VER_NUM * 4, &env_cache[ENV_PARAM_INDEX_VER_NUM] , 4);后,就不会出现每次重新开机都会擦写Flash了。因为我找不到其它地方有开机加载Flash中的EF_ENV_VER_NUM到env_cache[ENV_PARAM_INDEX_VER_NUM]。

@armink
Copy link
Owner

armink commented Aug 8, 2018

好像确实有问题。方便提一个 pr 吗?

@armink
Copy link
Owner

armink commented Aug 8, 2018

在 env_auto_update 里加感觉就可以了

@outely
Copy link
Contributor Author

outely commented Aug 8, 2018

嗯,在env_auto_update()中添加更方便。😃

@armink
Copy link
Owner

armink commented Aug 8, 2018

fixed in #26

@armink armink closed this as completed Aug 8, 2018
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

2 participants