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

移植出现的部分问题 #4

Closed
JesseGuoX opened this issue Aug 27, 2015 · 4 comments
Closed

移植出现的部分问题 #4

JesseGuoX opened this issue Aug 27, 2015 · 4 comments

Comments

@JesseGuoX
Copy link

  • flash_enveasyflash\port\ef_port.c Line32 出现,但是源码中并没有flash_env的定义,参考demo得知应该为ef_env
  • easyflash\port\ef_port.c中应该增加#include <stdarg.h>防止开了PRINT_DEBUG 编译出错。
@armink
Copy link
Owner

armink commented Aug 27, 2015

之前做过一次重构,所以部分细节有些遗漏,多谢反馈哈~

@armink
Copy link
Owner

armink commented Aug 27, 2015

@JGINGIT 现在已经移植成功了吗?

@JesseGuoX
Copy link
Author

@armink 还没,代码还没仔细研究,理解不了EF_ERASE_MIN_SIZEENV_USER_SETTING_SIZE。例如我是W25Q16最小擦除单位是4KB,所以EF_ERASE_MIN_SIZE = (4 * 1024)

ENV_USER_SETTING_SIZE是用户设置的数据环境变量的空间大小么?

    /* check capacity of ENV  */
    if (env_str_len + get_env_data_size() >= ENV_USER_SETTING_SIZE) {
        return EF_ENV_FULL;
    }

但是又为什么有ENV_AREA_SIZE的定义,用户数据环境变量空间大小又等于ENV_AREA_SIZE - ENV_SYSTEM_SIZE?

@armink
Copy link
Owner

armink commented Aug 27, 2015

@JGINGIT

  • 1、W25Q16EF_ERASE_MIN_SIZE = (4 * 1024) 这个是没问题的
  • 2、对于ENV_AREA_SIZEENV_USER_SETTING_SIZE的区别,点击这里有解释
  • 2、由于EasyFlash对所有的环境变量都会使用RAM缓存,但是在更多时候用户使用的环境变量大小会比EF_ERASE_MIN_SIZE小,所以需要再定义ENV_USER_SETTING_SIZE来指定用户设定的环境变量大小。
  • 3、环境变量区总容量在不同的模式下会有差异
    • 1、常规模式:没有差异;
    • 2、擦写平衡模式:系统区将会占用1个EF_ERASE_MIN_SIZE大小,数据区至少等使用2个以上Flash扇区;
    • 3、掉电保护模式:环境变量区将会被备份,所以总容量是常规模式的2倍;
    • 4、擦写平衡+掉电保护模式:系统区将会占用1个EF_ERASE_MIN_SIZE大小,数据区将会是擦写平衡模式下的数据区总容量的2倍。

所以,你先看下这里的解释能不能理解?

armink added a commit that referenced this issue Sep 11, 2015
Signed-off-by: armink <armink.ztl@gmail.com>
@armink armink closed this as completed Sep 11, 2015
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