各位大佬,求助D133在挂载 rodata 失败,怎么解决。我是用的是mmc,以下是启动信息:
01-01 08:00:00 I/SDMC: SDMC1 BW 1, sclk 49500 KHz, clk expt 400 KHz(act 399 KHz), div 2-62
[I] aic_sdmc_probe()683 SDMC1 driver loaded
01-01 08:00:00 I/sensor: rt_sensor[temp_tsen_cpu] init success
01-01 08:00:00 I/sensor: rt_sensor[temp_tsen_gpai] init success
01-01 08:00:00 I/WDT: ArtInChip WDT loaded
01-01 08:00:00 E/DFS: mount fs[elm] on /rodata failed.
01-01 08:00:00 E/DFS: mount fs[elm] on /sdcard failed.
可以看到这个时候 sdcard 也挂载失败了。
然后在最后,启动lvgl 的时候 sdcard 竟然又挂载上了,测试过可以正常使用文件系统,而 rodata 还是不行。
01-01 08:00:00 I/LVGL: Success to create LVGL thread
D13x /> info: cmd ring buf size:1920
info: cmd ring buf size:1920
lvgl is occupying gt911 device
id = GT911
range_x = 1024
range_y = 600
point_num = 5
01-01 08:00:00 I/SDMC: SDMC1 BW 1, sclk 49500 KHz, clk expt 400 KHz(act 399 KHz), div 2-62
01-01 08:00:00 I/SDIO: SD card capacity 491520 KB.
01-01 08:00:00 I/SDMC: SDMC1 BW 1, sclk 49500 KHz, clk expt 50000 KHz(act 49500 KHz), div 1-0
01-01 08:00:00 I/DFS: mount fs[elm] device[sd0] to /sdcard ok.
跑 debug 看,挂载 rodata 失败是因为 (\kernel\rt-thread\components\dfs\src\dfs_fs.c) 中:
int dfs_mount(const char *device_name,
const char *path,
const char *filesystemtype,
unsigned long rwflag,
const void *data)
{
const struct dfs_filesystem_ops **ops;
struct dfs_filesystem *iter;
struct dfs_filesystem *fs = NULL;
char *fullpath = NULL;
rt_device_t dev_id;
/* open specific device */
if (device_name == NULL)
{
/* which is a non-device filesystem mount */
dev_id = NULL;
}
else if ((dev_id = rt_device_find(device_name)) == NULL)
{
/* no this device */
rt_set_errno(-ENODEV);
return -1;
}
在 rt_device_find 的时候失败了,在 board.c 中,挂载 rodata 的地方为:
{"blk_rodata", "/rodata", "elm", 0, 0, 0},
而正是因为前面没有找到 "blk_rodata" 相关的设备,就退出了挂载。而后面,经过我摸索,"blk_rodata" 在 env.txt 中有声明,
但是我使用的是 mmc,烧录程序的时候如果勾选上 env (配置按照文档正确操作)就会出现以下错误(D133串口输出):
CBW tag 0x1765
TRANS_LAYER_CMD_WRITE, data len 2048
[E] mmc_fwc_raw_write()413 not find env;env_r part info.
CPU Exception: NO.5
x1: 4020ae8c x2: 4022bbc4 x3: 40229000 x4: 00000000
x5: ffffffff x6: fffffffd x7: ffffffff x8: 00000000
x9: 00000004 x10: 00000039 x11: 00000000 x12: ffffffff
x13: ffffffff x14: 000f40e2 x15: 00000000 x16: 0000000a
x17: 4022b961 x18: 40294750 x19: 00000800 x20: 40294708
x21: 40295208 x22: 40284620 x23: 4021cc4c x24: 402247c4
x25: 4022475c x26: 4022479c x27: 00004001 x28: 0000000a
x29: 00000200 x30: 00000000 x31: 00000004
mcause : 30000005
mtval : 0000009c
mepc : 4020adce
mstatus: 00003800
这就很头大,更不理解的是,在后面 sdcard 设备又挂载上了,目前我还在找它是从什么地方挂载的.......
感谢各位大佬能提供解决思路!
最近编辑记录 LiuZiqian (2024-12-12 14:30:40)
离线