You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
断言失败代码: // check that block size is a multiple of cache size is a multiple // of prog and read sizes LFS_ASSERT(lfs->cfg->cache_size % lfs->cfg->read_size == 0); LFS_ASSERT(lfs->cfg->cache_size % lfs->cfg->prog_size == 0); LFS_ASSERT(lfs->cfg->block_size % lfs->cfg->cache_size == 0);
解决方案:
将lfs.h头文件struct lfs_config结构体中的如下代码,放到结构体最后
`#ifdef LFS_THREADSAFE
// Lock the underlying block device. Negative error codes
// are propagated to the user.
int (*lock)(const struct lfs_config *c);
// Unlock the underlying block device. Negative error codes
// are propagated to the user.
int (*unlock)(const struct lfs_config *c);
#endif`
The text was updated successfully, but these errors were encountered:
断言失败代码:
// check that block size is a multiple of cache size is a multiple // of prog and read sizes LFS_ASSERT(lfs->cfg->cache_size % lfs->cfg->read_size == 0); LFS_ASSERT(lfs->cfg->cache_size % lfs->cfg->prog_size == 0); LFS_ASSERT(lfs->cfg->block_size % lfs->cfg->cache_size == 0);
打印提示如下:
*** assertion failed: lfs->cfg->cache_size % lfs->cfg->read_size == 0, file packages\littlefs-latest\lfs.c, line 4184
SIGABRT: Abnormal termination
跟踪问题发现:
执行static int DFS_LFS_MKFS(rt_device_t dev_id, const char *fs_name)函数中的result = lfs_format(&dfs_lfs->lfs, &dfs_lfs->cfg);代码时,dfs_lfs->cfg和进入lfs_format函数之后的cfg数据不一致,具体说应该是数据出现偏移
解决方案:
将lfs.h头文件struct lfs_config结构体中的如下代码,放到结构体最后
`#ifdef LFS_THREADSAFE
// Lock the underlying block device. Negative error codes
// are propagated to the user.
int (*lock)(const struct lfs_config *c);
// Unlock the underlying block device. Negative error codes
// are propagated to the user.
int (*unlock)(const struct lfs_config *c);
#endif`
The text was updated successfully, but these errors were encountered: