李家明

Results 14 comments of 李家明

写入两个数据还是正常的,当写入到第三个数据,fdb_tsl_iter_by_time就不会触发到回调函数。 ``` do { read_tsl(db, &tsl); if (tsl.status != FDB_TSL_UNUSED) { if ((from = from && tsl.time to && tsl.time = to)) { /* iterator is interrupted when callback return...

> 写入第三个,fdb_tsl_append 有返回错误嘛? 没有返回错误 ``` static bool storage_data_append(void *data, uint32_t len) { struct fdb_blob blob; if (fdb_tsl_append(&storage_db, fdb_blob_make(&blob, data, len)) != FDB_NO_ERR) { LOG_ERROR("storage data append failed"); return false; }...

> 要不你单步调试先分析一下? 我是用移远的opensdk移植的,没有在线debug的功能……; 刚刚测试发现:fdb_tsl_query_count、fdb_tsl_iter_by_time都是不行的,当数据大于三条的时候;但是fdb_tsl_iter这个函数就能把数据迭代出来,打印的tsl->time是正确的序号,tsl->status也都是2(FDB_TSL_WRITE)。 发现情况有点像:[https://github.com/armink/FlashDB/issues/10#issuecomment-653344273] 以前我用flashdb移植到华大的MCU的,也小批量过生产过的,只是以前的业务每条的数据比较小,现在的每条数据几K的大小。

我使用的版本是[4e56774](https://github.com/armink/FlashDB/commit/4e5677408256f82d47cd56a6b04605dcee35ed9a)

我把fdb_tsl_iter_by_time函数中: ``` /* search the first start TSL address */ tsl.addr.index = search_start_tsl_addr(db, start, end, from, to); /* search all TSL */ ``` 修改成以前的版本: ``` /* search the first start...

> 以前的版本是具体哪个版本? 1.1.2 [7062902](https://github.com/armink/FlashDB/commit/7062902a3e7b6b8a7e8f5886ae242271a0164e05)

> 你的分区大小是按照什么样配置的,我按照你的配置试试 fal_cfg.h: ``` #define FACTORY_KV_DB_ADDR 0 #define FACTORY_KV_DB_SIZE (32 * 1024) #define CONFIG_KV_DB_ADDR (FACTORY_KV_DB_ADDR + FACTORY_KV_DB_SIZE) #define CONFIG_KV_DB_SIZE (64 * 1024) #define FAULT_TS_DB_ADDR (CONFIG_KV_DB_ADDR + CONFIG_KV_DB_SIZE) #define FAULT_TS_DB_SIZE (512...

> 我尝试增加你的场景的测试用例,但是还是没有复现你的问题,帮忙确认下咱们用法是否完全一致 > > https://github.com/armink/FlashDBAutoTestBSP/blob/39b80bfc9c32c43cea9dee4175a28070f5b3e5e2/packages/FlashDB/tests/fdb_tsdb_tc.c#L409-L458 > > 另外,你也可以在 > > * 使用 `fdb_tsl_iter` 迭代时,把 TSL1: 700KB, TSL2: 800KB, TSL3: 900KB 信息 > * `fdb_tsl_query_count` 对应的使用条件补充一下 > > 大致如下: > >...

> 按照大的值,4字节对齐就行 如果按最大的值,SPI-FLash的的效率会不会受到影响的?

> 时序数据库,首次初始化,需要格式化,耗时比较久。我使用外部nor flash,给该时序数据库分配4M的空间,格式化时候要几十秒,这样正常吗?