Eggcar

Results 9 comments of Eggcar

> > > 16K 做 boot ,后面的 128K 粒度分区用作 env/log 请问如果是需要同时使用片外spi flash存储env,同时使用iap升级片内flash的firmware,可以实现吗?看了SFUD和EF的port文件,似乎目前没有直接例化多个flash对象的方法?或者是我看漏了吗?

都这么大容量了,直接fatfs littlefs不好吗

建议用单调时钟作为时间戳,不要直接用系统时间

看一下cur_kv->name_len,我记得fdb的key string好像不保证'/0'结尾 `rt_kprintf("%.*s :\r\n", cur_kv->name_len, cur_kv->name);`

realloc需要自己实现,网上可以找到很多例子

> For windows users, we prepared sdk_env for them, in which all dependencies have been included (cmake/python/toolchain/openocd/ninja). > > It can be downloaded from here http://hpmicro.com/resources/detail.html?id=a313eb8f-afbf-4d12-95a2-ce22bda8d3c0 ![image](https://user-images.githubusercontent.com/950852/250103208-11230b98-44da-41cc-b4e0-f304584db7d1.png) > > after...

> We didn't modify the official GNU toolchain, instead, we enabled multilib support and provided the widest range of arch and abi combinations. Actually, it is okay to use the...

遍历打印了一下sector的信息,发现大部分情况下一个sector并不会完全用满,也就不太好判断标记sector为GC的时机,绝大部分情况下即便一个sector里的kv全部删除也会剩下几十个bytes的空间,实际使用时很难完全写满一个sector 调整threshold也许可行,不过不同的应用场景需要权衡,空间大区块多的场景可以牺牲一些存储密度,空间小的场景就不太需要关注性能,但这个方法终究不太通用 换个思路,目前每次分配一个kv对象时,alloc_kv首先要做一次全sector遍历统计sector使用量信息,再做一次遍历找Using状态的sector,如果所有Using-sector空间都不足,需要再做一次sector遍历找到空sector。 ```c static uint32_t alloc_kv(fdb_kvdb_t db, kv_sec_info_t sector, size_t kv_size) { uint32_t empty_kv = FAILED_ADDR; size_t empty_sector = 0, using_sector = 0; struct alloc_kv_cb_args arg = {db, kv_size,...

> 其实也不是每次都会执行三次遍历的,绝大多数情况下是两次遍历,第三次只有第二次分配不出来才会执行的 是的,最坏情况是执行三次遍历,一般是两次,但是我跟踪了一下性能,前两次遍历已经耗时非常大了,而且两次耗时都很大,基本55开 我现在把fdb的读写做成独立线程的异步队列了,优先不要阻塞业务进程,过阵子有时间试一下这个地方可不可以优化