当前位置:网站首页>Records on the use of easyflash v3.3
Records on the use of easyflash v3.3
2022-07-07 10:39:00 【Sky_ Lannister】
Open source address https://github.com/armink/EasyFlash
A post by an open source Author :https://www.amobbs.com/thread-5624863-1-1.html
It has reached V4 了 , But here's the thing ST Of L4 Series MCU , Cannot write in reverse order , So it's still used V3 edition
The space is full occasionally when using , It's especially hard to reproduce , Just go through the source code
About wear balance
Not a real wear balance , Just keep erasing and reading to a sector first , When this sector is broken , Translate another sector down , And as long as there is a write or erase failure in this sector, it will shift to the next sector ,V4 Implementation and V3 Totally differentAbout env Delete and reset :
/* remain ENV move forward */
memcpy(del_env, del_env + del_env_length, remain_env_length);
After deleting a key value pair , The cache data is uniformly shifted forward Then set the end address ;
The cache area after the currently used address (env_cache) Size erase , Then write the shifted data from the current address
save_cur_using_data_addr Is before writing 16 Byte lead data to the system area ;
When deleting, there will be a space to save a set of data that will be saved every time you resetAbout power failure protection :
Power failure protection is realized by software , It is not saved after detecting that the voltage of the single chip microcomputer is lower than a certain value , But the call ef_save_env_wt When , How many days after a write k Backup , Write the first few at a time k Really save , Back and forth twice , One is always the preservation of another , But this causes a waste of spaceAbout get_env_user_used_size(void) The understanding of the :
static size_t get_env_user_used_size(void) {
if (get_env_detail_end_addr() > get_cur_using_data_addr()) {
return get_env_detail_end_addr() - get_cur_using_data_addr();
} else {
return 0;
}
}
Why get the used size , Is to subtract the address in use from the end address , I can't understand the positive and reverse order ?
Actually, it should be understood as get_env_detail_end_addr() Is the end address used , It always changes according to the size of the write , and get_cur_using_data_addr(); Are two fixed values , That is, if it weren't for the backup area , If it weren't for the real storage areaAbout env Space allocation :
Power down and wear balance mode , The distribution of the front and rear memory areas is consistent :1 System area 、2 Data area
Pay attention to the cache RAM size 、 Environment variable area 、 The size of the minimum erased sectors and their relationshipAbout the size of the persistent data area :
default_env_set_size: Always saved KEY-VALUE When resetting, write it to the last area of the cache
Use set_env_detail_end_addr(get_env_detail_end_addr() + env_str_len); Set the stored content
边栏推荐
- 无法打开内核设备“\\.\VMCIDev\VMX”: 操作成功完成。是否在安装 VMware Workstation 后重新引导? 模块“DevicePowerOn”启动失败。 未能启动虚拟机。
- 移动端通过设置rem使页面内容及字体大小自动调整
- How embedded engineers improve work efficiency
- Adb 实用命令(网络包、日志、调优相关)
- BigDecimal数值比较
- IO model review
- 01 use function to approximate cosine function (15 points)
- Openinstall and Hupu have reached a cooperation to mine the data value of sports culture industry
- 基于HPC场景的集群任务调度系统LSF/SGE/Slurm/PBS
- 路由器开发知识汇总
猜你喜欢

ArrayList thread insecurity and Solutions

Review of the losers in the postgraduate entrance examination

Cluster task scheduling system lsf/sge/slurm/pbs based on HPC scenario

Socket通信原理和实践

中级软件评测师考什么

想考中级软考,一般需要多少复习时间?

How much review time does it usually take to take the intermediate soft exam?

【推荐系统 02】DeepFM、YoutubeDNN、DSSM、MMOE

软考一般什么时候出成绩呢?在线蹬?

Adb 实用命令(网络包、日志、调优相关)
随机推荐
Applet jump to H5, configure business domain name experience tutorial
如何顺利通过下半年的高级系统架构设计师?
中级网络工程师是什么?主要是考什么,有什么用?
使用Tansformer分割三维腹部多器官--UNETR实战
使用U2-Net深层网络实现——证件照生成程序
Monai version has been updated to 0.9. See what new functions it has
TypeScript 接口继承
China Southern Airlines pa3.1
How to prepare for the advanced soft test (network planning designer)?
Study summary of postgraduate entrance examination in November
MONAI版本更新到 0.9 啦,看看有什么新功能
中级软件评测师考什么
555电路详解
Multithreaded asynchronous orchestration
1323: [example 6.5] activity selection
Leetcode-303: region and retrieval - array immutable
0x0fa23729 (vcruntime140d.dll) (in classes and objects - encapsulation.Exe) exception thrown (resolved)
高级软考(网络规划设计师)该如何备考?
Trajectory planning for multi-robot systems: Methods and applications 综述阅读笔记
Deeply analyze the main contents of erc-4907 agreement and think about the significance of this agreement to NFT market liquidity!