使用flashDB软件包 使用tsdb例程 提示写flash 失败,但实际上是能存储的, 使用的是GD32F303片上flash,编程环境使用rt-thread studio软件,错误如图下红色部分提示
![](//file.elecfans.com/web2/M00/55/85/poYBAGLeDHuAXoeIAAOs-qjvxRw915.jpg)
这个问题应该是什么解决呢,麻烦老师们指导一下。
以下是例程的代码:
#ifdef FDB_USING_TSDB
{ /* TSDB Sample /
/ set the lock and unlock function if you want */
fdb_tsdb_control(&tsdb, FDB_TSDB_CTRL_SET_LOCK, (void *)lock);
fdb_tsdb_control(&tsdb, FDB_TSDB_CTRL_SET_UNLOCK, (void )unlock);
/ Time series database initialization
*
- &tsdb: database object
- "log": database name
- "fdb_tsdb1": The flash partition name base on FAL. Please make sure it's in FAL partition table.
- Please change to YOUR partition name.
- get_time: The get current timestamp function.
- 128: maximum length of each log
- NULL: The user data if you need, now is empty.
/
result = fdb_tsdb_init(&tsdb, "my", "name", get_time, 128, NULL);
/ read last saved time for simulated timestamp /
fdb_tsdb_control(&tsdb, FDB_TSDB_CTRL_GET_LAST_TIME, &counts);
if (result != FDB_NO_ERR) {
return -1;
}
/ run TSDB sample /
tsdb_sample(&tsdb);
}
#endif / FDB_USING_TSDB */