完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
首先是FAL能正常启动,根目录的分区也挂载正常。 [D/FAL] (fal_flash_init:61) Flash device | coreboard | addr: 0x00000000 | len: 0x01000000 | blk_size: 0x00001000 |initialized finish. [D/FAL] (fal_flash_init:61) Flash device | norflash0 | addr: 0x00000000 | len: 0x01000000 | blk_size: 0x00001000 |initialized finish. [I/FAL] ==================== FAL partition table ==================== [I/FAL] | name | flash_dev | offset | length | [I/FAL] ------------------------------------------------------------- [I/FAL] | bootloader | coreboard | 0x00000000 | 0x00008000 | [I/FAL] | app | coreboard | 0x00008000 | 0x007f8000 | [I/FAL] | littlefs | coreboard | 0x00800000 | 0x00200000 | [I/FAL] | download | coreboard | 0x00a00000 | 0x00200000 | [I/FAL] | fatfs | coreboard | 0x00c00000 | 0x00300000 | [I/FAL] | easyflash | coreboard | 0x00f00000 | 0x00100000 | [I/FAL] | file | norflash0 | 0x00000000 | 0x01000000 | [I/FAL] ============================================================= [I/FAL] RT-Thread Flash Abstraction Layer (V0.5.0) initialize success. [I/FAL] The FAL MTD NOR device (littlefs) created successfully [I/littlefs.sample] para initialized! [I/FAL] The FAL MTD NOR device (download) created successfully [E/littlefs.sample] Failed to initialize download! [Flash] (packagesEasyFlash-v4.1.0srcef_env.c:1818) ENV start address is 0x00000000, size is 8192 bytes. [Flash] EasyFlash V4.1.0 is initialize success. [Flash] You can get the latest version on 挂载第一个分区后,新建目录,用于挂载download分区,但是挂载失败 int result = 0; #ifdef PKG_USING_FAL // 初始化 fal fal_init(); #else return; #endif #ifdef PKG_USING_LITTLEFS #define LITTLEFS_PARTITION_NAME "littlefs" struct rt_device *mtd_dev = RT_NULL; // 创建 mtd 设备 mtd_dev = fal_mtd_nor_device_create(LITTLEFS_PARTITION_NAME); if (!mtd_dev) { LOG_E("Can't create a mtd device on '%s' partition.", LITTLEFS_PARTITION_NAME); } else { // 挂载littlefs // 参数: 块设备名、文件系统挂载点路径,挂载文件系统类型,读写标志位,文件系统的私有数据 if (dfs_mount(LITTLEFS_PARTITION_NAME, "/", "lfs", 0, 0) == 0) { LOG_I("para initialized!"); } else { /* 格式化文件系统 */ dfs_mkfs("lfs", LITTLEFS_PARTITION_NAME); /* 挂载 littlefs */ if (dfs_mount(LITTLEFS_PARTITION_NAME, "/", "lfs", 0, 0) == 0) { LOG_I("%s initialized!",LITTLEFS_PARTITION_NAME); } else { LOG_E("Failed to initialize %s!",LITTLEFS_PARTITION_NAME); result = -1; } } } if(result == 0) { #define LITTLEFS_PARTITION_NAME2 "download" mtd_dev = fal_mtd_nor_device_create(LITTLEFS_PARTITION_NAME2); if (!mtd_dev) { LOG_E("Can't create a mtd device on '%s' partition.", LITTLEFS_PARTITION_NAME2); } else { if(opendir("/c") == RT_NULL) { mkdir("c",0); } if (dfs_mount(LITTLEFS_PARTITION_NAME2, "/c", "lfs", 0, 0) == 0) { LOG_I("%s Filesystem initialized!",LITTLEFS_PARTITION_NAME2); } else { dfs_mkfs("lfs", LITTLEFS_PARTITION_NAME2); if (dfs_mount(LITTLEFS_PARTITION_NAME2, "/c", "lfs", 0, 0) == 0) LOG_I("%s Filesystem initialized!",LITTLEFS_PARTITION_NAME2); else LOG_E("Failed to initialize %s!",LITTLEFS_PARTITION_NAME2); } } } #endif #ifdef PKG_USING_EASYFLASH /* easyflash init */ easyflash_init(); #endif mtd设备是正常创建的, device type ref count -------- -------------------- ---------- download MTD Device 0 littlefs MTD Device 1 norflash Block Device 0 adc1 Miscellaneous Device 0 pwm2 Miscellaneous Device 0 pwm1 Miscellaneous Device 0 刚开始使用文件系统,求大佬指导下,问题在哪。。 |
|
相关推荐
3个回答
|
|
|
|
|
|
先挂载download的话就可以,就是第二个挂不上去
|
|
|
|
原因找到了,是因为挂两个 lfs, RT_DEF_LFS_DRIVERS 的值为 1,导致挂两个 lfs 挂不上去。改成2就好了
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
786 浏览 0 评论
4210 浏览 0 评论
如何使用python调起UDE STK5.2进行下载自动化下载呢?
2520 浏览 0 评论
开启全新AI时代 智能嵌入式系统快速发展——“第六届国产嵌入式操作系统技术与产业发展论坛”圆满结束
2926 浏览 0 评论
获奖公布!2024 RT-Thread全球巡回线下培训火热来袭!报名提问有奖!
31442 浏览 11 评论
72901 浏览 21 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-22 06:42 , Processed in 0.642572 second(s), Total 74, Slave 57 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号