1.KV数据库存放在外部SPIflash中。
rt-thread 系统版本V4.1.0 ;
flashDB 版本V1.1.2;
使用rt-thread studio ;
2.flash做了分区。分区表如下:
#define FAL_PART_TABLE
{
{FAL_PART_MAGIC_WORD, "app", "onchip_flash", 0, 5121024, 0},
{FAL_PART_MAGIC_WORD, "download", NOR_FLASH_DEV_NAME, 0, 2564096, 0},
{FAL_PART_MAGIC_WORD, "kvdbflash", NOR_FLASH_DEV_NAME, 2564096, 2564096, 0},
{FAL_PART_MAGIC_WORD, "tsdbflash", NOR_FLASH_DEV_NAME, 5124096, 10244096, 0},
{FAL_PART_MAGIC_WORD, "ulogflash", NOR_FLASH_DEV_NAME, 15364096, 2564096, 0},
{FAL_PART_MAGIC_WORD, "fileflash", NOR_FLASH_DEV_NAME, 17924096, 23044096, 0},
}
3.使用官方例程的初始化,初始化kvdb没有问题,但是初始化tsdb的时候就会出现断言;调试信息如下:
[32;22m[I/FAL] RT-Thread Flash Abstraction Layer initialize success.[0m
[32;22m[I/FAL] The FAL block device (fileflash) created successfully[0m
onchip elm filesystem mount to '/' success
[FlashDB][kv][env] (../packages/FlashDB-v1.1.2/src/fdb_kvdb.c:1638) KVDB size is 524288 bytes.
[FlashDB] FlashDB V1.1.2 is initialize success.
[FlashDB] You can get the latest version on https://github.com/armink/FlashDB .
<=====================================================><
get the 'boot_count' value is 7
set the 'boot_count' value to 8
[FlashDB][tsl][tsflash] (../packages/FlashDB-v1.1.2/src/fdb_tsdb.c:192) (0) has assert failed at read_sector_info.
在fdb_tsdb.c的第192行:
//TODO There is no valid end node info on this sector, need impl fast query this sector by fdb_tsl_iter_by_time
FDB_ASSERT(0);
注释说明,扇区上没有有效的结束节点信息,请使用fdb_tsl_iter_by_time函数查询。
这是什么原因呢???
初始化函数内容如下:
{
fdb_err_t result1;
fdb_tsdb_control(&tsdb_flash, FDB_TSDB_CTRL_SET_LOCK, lock);
fdb_tsdb_control(&tsdb_flash, FDB_TSDB_CTRL_SET_UNLOCK, unlock);
result1 = fdb_tsdb_init(&tsdb_flash,"tsenv","tsdbflash",get_time,128,NULL);
fdb_tsdb_control(&tsdb_flash, FDB_TSDB_CTRL_GET_LAST_TIME, &counts);
if (result1 != FDB_NO_ERR) {
return -1;
}
tsdb_sample(&tsdb_flash);
}
以上问题不知有没有人遇到过??这个要怎么解决呢?
更多回帖