当前位置:网站首页>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
边栏推荐
- Deeply analyze the main contents of erc-4907 agreement and think about the significance of this agreement to NFT market liquidity!
- leetcode-303:区域和检索 - 数组不可变
- Leetcode-304: two dimensional area and retrieval - matrix immutable
- 深入分析ERC-4907协议的主要内容,思考此协议对NFT市场流动性意义!
- 深入理解Apache Hudi异步索引机制
- 想考中级软考,一般需要多少复习时间?
- 软考中级有用吗??
- Some properties of leetcode139 Yang Hui triangle
- BigDecimal value comparison
- Some superficial understanding of word2vec
猜你喜欢
南航 PA3.1
ADB utility commands (network package, log, tuning related)
Elegant controller layer code
Trajectory planning for multi robot systems: methods and Applications Overview reading notes
IIC基本知识
Deeply analyze the main contents of erc-4907 agreement and think about the significance of this agreement to NFT market liquidity!
What are the test preparation materials and methods for soft exam information processing technicians?
求最大公约数与最小公倍数(C语言)
Leetcode-560: subarray with sum K
成为优秀的TS体操高手 之 TS 类型体操前置知识储备
随机推荐
Some superficial understanding of word2vec
软考中级电子商务师含金量高嘛?
求方程ax^2+bx+c=0的根(C语言)
【推荐系统 02】DeepFM、YoutubeDNN、DSSM、MMOE
软考中级有用吗??
Summary of router development knowledge
Multisim -- software related skills
Schnuka: machine vision positioning technology machine vision positioning principle
P2788 数学1(math1)- 加减算式
[actual combat] transformer architecture of the major medical segmentation challenges on the list --nnformer
1323:【例6.5】活动选择
Use the fetch statement to obtain the repetition of the last row of cursor data
2022年上半年5月网络工程师试题及答案
leetcode-303:区域和检索 - 数组不可变
1324: [example 6.6] integer interval
施努卡:机器人视觉抓取工作原理 机器视觉抓取
openinstall与虎扑达成合作,挖掘体育文化产业数据价值
Find the greatest common divisor and the least common multiple (C language)
Use load_ decathlon_ Datalist (Monai) fast loading JSON data
Socket communication principle and Practice