完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
硬件:STM32F429IGT6核心板 操作系统:RTT V4.1.0 FLASHDB 使用文件模式 保存参数至 片外FLASH W25Q128时间过长 fal bench 和 SFUD测试结果如下 msh /flash/logs>fal bench 4096 DANGER: It will erase full chip or partition! Please run 'fal bench 4096 yes'. msh /flash/logs>fal bench 4096 yes Erasing 1048576 bytes data, waiting... Erase benchmark success, total time: 3.548S. Writing 1048576 bytes data, waiting... Write benchmark success, total time: 4.097S. Reading 1048576 bytes data, waiting... Read benchmark success, total time: 1.546S. Erase benchmark success, total time: 33.946S. Writing the sf_cmd 16777216 bytes data, waiting... Write benchmark success, total time: 65.537S. Reading the sf_cmd 16777216 bytes data, waiting... Read benchmark success, total time: 26.302S. 使用KVDB bench msh />kvdb ben msh />kvdb bench msh />kvdb bench [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:1155) Trigger a GC check after created KV. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:1051) The remain empty sector is 1, GC threshold is 1. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (boot_count) from 0x000006D1 to 0x00001014. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (save flag) from 0x000006F9 to 0x0000103C. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (MBH501) from 0x00000720 to 0x00001063. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (MBH502) from 0x00000744 to 0x00001087. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (MBH503) from 0x00000768 to 0x000010AB. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (MBH504) from 0x0000078C to 0x000010CF. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (MBH505) from 0x000007B0 to 0x000010F3. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (MBH506) from 0x000007D4 to 0x00001117. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (MBH507) from 0x000007F8 to 0x0000113B. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (MBH508) from 0x0000081C to 0x0000115F. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (MBH509) from 0x00000840 to 0x00001183. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (MBH510) from 0x00000864 to 0x000011A7. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (MBH511) from 0x00000888 to 0x000011CB. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (MBH521) from 0x000008AC to 0x000011EF. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (MBH522) from 0x000008D0 to 0x00001213. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (MBH523) from 0x000008F4 to 0x00001237. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (MBH524) from 0x00000918 to 0x0000125B. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (MBH525) from 0x0000093C to 0x0000127F. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (MBH526) from 0x00000960 to 0x000012A3. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (MBH527) from 0x00000984 to 0x000012C7. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (MBH699) from 0x000009A8 to 0x000012EB. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV ( ver_num ) from 0x000009F0 to 0x0000130F. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (MBH700) from 0x00000A1B to 0x0000133A. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:0) from 0x00000A41 to 0x00001360. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:1) from 0x00000A69 to 0x00001388. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:2) from 0x00000A91 to 0x000013B0. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:3) from 0x00000AB9 to 0x000013D8. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:4) from 0x00000AE1 to 0x00001400. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:5) from 0x00000B09 to 0x00001428. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:6) from 0x00000B31 to 0x00001450. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:7) from 0x00000B59 to 0x00001478. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:8) from 0x00000B81 to 0x000014A0. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:9) from 0x00000BA9 to 0x000014C8. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:10) from 0x00000BD1 to 0x000014F0. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:11) from 0x00000BFB to 0x0000151A. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:12) from 0x00000C25 to 0x00001544. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:13) from 0x00000C4F to 0x0000156E. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:14) from 0x00000C79 to 0x00001598. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:15) from 0x00000CA3 to 0x000015C2. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:16) from 0x00000CCD to 0x000015EC. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:17) from 0x00000CF7 to 0x00001616. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:18) from 0x00000D21 to 0x00001640. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:19) from 0x00000D4B to 0x0000166A. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:20) from 0x00000D75 to 0x00001694. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:21) from 0x00000D9F to 0x000016BE. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:22) from 0x00000DC9 to 0x000016E8. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:23) from 0x00000DF3 to 0x00001712. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:24) from 0x00000E1D to 0x0000173C. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:25) from 0x00000E47 to 0x00001766. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:26) from 0x00000E71 to 0x00001790. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:27) from 0x00000E9B to 0x000017BA. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:28) from 0x00000EC5 to 0x000017E4. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:29) from 0x00000EEF to 0x0000180E. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:30) from 0x00000F19 to 0x00001838. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:31) from 0x00000F43 to 0x00001862. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:32) from 0x00000F6D to 0x0000188C. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:33) from 0x00000F97 to 0x000018B6. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:1031) Collect a sector @0x00000000 48 KVs has been added , total 307066 tick, avg 6397 tick/per 48 KVs has been queried, total 3951 tick, avg 82 tick/per 48 KVs has been deleted, total 30367 tick, avg 632 tick/per #define RT_TICK_PER_SECOND 1000 这样就是 平均 添加一个参数 6秒? 查询一个参数 0.082s 删除一个参数 0.632s 这效率太低了吧。正常吗? 准备换成在片内flash存储了 |
|
相关推荐
11个回答
|
|
可以了解下qparam组件,支持快速存取
|
|
|
|
现在主要是SPIFLASH保存过慢的问题。
用片内flash,应该就快多了。 现在想搞片内搞文件系统搭上去,用文件模式保存参数。qparam支持文件模式吗? 虽然用文件模式也没啥必要就是。 片内文件系统尝试过littlefs文件系统。因为片内flash只有128kb的扇区,而且少,失败了。 片内flash搭载什么文件系统合适呢?我这只能分配128kb 6个扇区的情况 |
|
|
|
elm文件系统存取比较快。片内flash读取速度快,但擦除时间较长,保存其实并不快。
|
|
|
|
应该还是比片外快不少吧
|
|
|
|
benchmark只是跑个测试程序测一下极限场景下的flash读写速度罢了,正常应用场景下哪会这么用的。
|
|
|
|
但是我实际保存参数耗时确实很长。读取参数没有感知这么严重
|
|
|
|
我是一次性保存所有参数的。
如下代码。大概22个参数保存 for(uint8_t i = 0; i < sizeof(default_kv_table) / sizeof(struct fdb_default_kv_node);i++) { temp = (const uint16_t *)default_kv_table[i].value; //构造 blob 对象 fdb_kv_set_blob(&mb_param,default_kv_table[i].key, fdb_blob_make(&blob,temp,default_kv_table[i].value_len)); } |
|
|
|
|
|
|
|
这是SPI测试数据 Erase benchmark success, total time: 33.946S. Writing the sf_cmd 16777216 bytes data, waiting... Write benchmark success, total time: 65.537S. Reading the sf_cmd 16777216 bytes data, waiting... Read benchmark success, total time: 26.302S. 这是配置 ![]() |
|
|
|
使用片内flash搭载littlefs文件系统不好使。
给W25Q128重新搭载elm-fatfs文件系统。这个重新搭载的测试数据 [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:1155) Trigger a GC check after created KV. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:1051) The remain empty sector is 1, GC threshold is 1. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (boot_count) from 0x000009C6 to 0x00001014. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (save flag) from 0x000009EE to 0x0000103C. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (MBH501) from 0x00000A15 to 0x00001063. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (MBH502) from 0x00000A39 to 0x00001087. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (MBH503) from 0x00000A5D to 0x000010AB. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (MBH504) from 0x00000A81 to 0x000010CF. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (MBH505) from 0x00000AA5 to 0x000010F3. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (MBH506) from 0x00000AC9 to 0x00001117. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (MBH507) from 0x00000AED to 0x0000113B. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (MBH508) from 0x00000B11 to 0x0000115F. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (MBH509) from 0x00000B35 to 0x00001183. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (MBH510) from 0x00000B59 to 0x000011A7. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (MBH511) from 0x00000B7D to 0x000011CB. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (MBH521) from 0x00000BA1 to 0x000011EF. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (MBH522) from 0x00000BC5 to 0x00001213. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (MBH523) from 0x00000BE9 to 0x00001237. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (MBH524) from 0x00000C0D to 0x0000125B. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (MBH525) from 0x00000C31 to 0x0000127F. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (MBH526) from 0x00000C55 to 0x000012A3. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (MBH527) from 0x00000C79 to 0x000012C7. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (MBH699) from 0x00000C9D to 0x000012EB. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (MBH700) from 0x00000CC1 to 0x0000130F. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (__ver_num__) from 0x00000CE5 to 0x00001333. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:0) from 0x00000D10 to 0x0000135E. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:1) from 0x00000D38 to 0x00001386. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:2) from 0x00000D60 to 0x000013AE. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:3) from 0x00000D88 to 0x000013D6. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:4) from 0x00000DB0 to 0x000013FE. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:5) from 0x00000DD8 to 0x00001426. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:6) from 0x00000E00 to 0x0000144E. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:7) from 0x00000E28 to 0x00001476. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:8) from 0x00000E50 to 0x0000149E. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:9) from 0x00000E78 to 0x000014C6. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:10) from 0x00000EA0 to 0x000014EE. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:11) from 0x00000ECA to 0x00001518. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:12) from 0x00000EF4 to 0x00001542. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:13) from 0x00000F1E to 0x0000156C. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:14) from 0x00000F48 to 0x00001596. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:15) from 0x00000F72 to 0x000015C0. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:961) Moved the KV (key:16) from 0x00000F9C to 0x000015EA. [FlashDB][kv][env] (packages/FlashDB-latest/src/fdb_kvdb.c:1031) Collect a sector @0x00000000 48 KVs has been added , total 53175 tick, avg 1107 tick/per 48 KVs has been queried, total 827 tick, avg 17 tick/per 48 KVs has been deleted, total 7334 tick, avg 152 tick/per |
|
|
|
SPI没有开启DMA,慢了点。
这是开了DMA的 48 KVs has been added , total 34034 tick, avg 709 tick/per 48 KVs has been queried, total 116 tick, avg 2 tick/per 48 KVs has been deleted, total 7747 tick, avg 161 tick/per |
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
开启全新AI时代 智能嵌入式系统快速发展——“第六届国产嵌入式操作系统技术与产业发展论坛”圆满结束
1031 浏览 0 评论
2024 RT-Thread全球巡回线下培训火热来袭!报名提问有奖!
3537 浏览 10 评论
1642 浏览 0 评论
IaaS+on+DPU(IoD)+下一代高性能算力底座技术白皮书
2925 浏览 0 评论
飞凌嵌入式-ELFBOARD 常用的USB接口及其不同版本介绍第1期
1168 浏览 0 评论
67132 浏览 21 评论
嵌入式热门DIY项目:智能机器人开源资料合集(原理图、代码、论文)
68342 浏览 22 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-9-4 18:09 , Processed in 1.244511 second(s), Total 92, Slave 73 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191