[simulator] 解决simulator模拟器不能挂在sd卡的问题,并更新文档

This commit is contained in:
Meco Man 2022-04-08 23:33:34 -04:00 committed by guo
parent d664edd64e
commit 9b6bc0fcc7
6 changed files with 13 additions and 14 deletions

View File

@ -29,7 +29,7 @@ CONFIG_IDLE_THREAD_STACK_SIZE=256
# CONFIG_RT_KSERVICE_USING_STDLIB is not set # CONFIG_RT_KSERVICE_USING_STDLIB is not set
# CONFIG_RT_KSERVICE_USING_TINY_SIZE is not set # CONFIG_RT_KSERVICE_USING_TINY_SIZE is not set
# CONFIG_RT_USING_TINY_FFS is not set # CONFIG_RT_USING_TINY_FFS is not set
# CONFIG_RT_PRINTF_LONGLONG is not set # CONFIG_RT_KPRINTF_USING_LONGLONG is not set
CONFIG_RT_DEBUG=y CONFIG_RT_DEBUG=y
CONFIG_RT_DEBUG_COLOR=y CONFIG_RT_DEBUG_COLOR=y
# CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_INIT_CONFIG is not set
@ -108,9 +108,9 @@ CONFIG_FINSH_ARG_MAX=10
CONFIG_RT_USING_DFS=y CONFIG_RT_USING_DFS=y
CONFIG_DFS_USING_POSIX=y CONFIG_DFS_USING_POSIX=y
CONFIG_DFS_USING_WORKDIR=y CONFIG_DFS_USING_WORKDIR=y
CONFIG_DFS_FILESYSTEMS_MAX=2 CONFIG_DFS_FILESYSTEMS_MAX=8
CONFIG_DFS_FILESYSTEM_TYPES_MAX=4 CONFIG_DFS_FILESYSTEM_TYPES_MAX=8
CONFIG_DFS_FD_MAX=4 CONFIG_DFS_FD_MAX=32
# CONFIG_RT_USING_DFS_MNTTABLE is not set # CONFIG_RT_USING_DFS_MNTTABLE is not set
CONFIG_RT_USING_DFS_ELMFAT=y CONFIG_RT_USING_DFS_ELMFAT=y
@ -522,6 +522,7 @@ CONFIG_RT_USING_POSIX_FS=y
# CONFIG_PKG_USING_TINYUSB is not set # CONFIG_PKG_USING_TINYUSB is not set
# CONFIG_PKG_USING_CHERRYUSB is not set # CONFIG_PKG_USING_CHERRYUSB is not set
# CONFIG_PKG_USING_KMULTI_RTIMER is not set # CONFIG_PKG_USING_KMULTI_RTIMER is not set
# CONFIG_PKG_USING_TFDB is not set
# #
# peripheral libraries and drivers # peripheral libraries and drivers

View File

@ -52,5 +52,5 @@ int mnt_init(void)
return 0; return 0;
} }
INIT_COMPONENT_EXPORT(mnt_init); INIT_ENV_EXPORT(mnt_init);
#endif #endif

View File

@ -14,7 +14,7 @@
#include <dfs.h> #include <dfs.h>
#define DBG_TAG "sd.sim" #define DBG_TAG "sd.sim"
#define DBG_LVL DBG_INFO #define DBG_LVL DBG_WARNING
#include <rtdbg.h> #include <rtdbg.h>
#define SDCARD_SIM "sd.bin" #define SDCARD_SIM "sd.bin"

View File

@ -53,11 +53,9 @@ RTGUI的最新源码目前托管在github上https://github.com/RT-Thread/RTGU
sd.bin--模拟SD卡挂载fat大小为16M sd.bin--模拟SD卡挂载fat大小为16M
nand.bin-模拟nand flash挂载uffs参数page=2048+64bytesblock=64pages16M nand.bin-模拟nand flash挂载uffs参数page=2048+64bytesblock=64pages16M
nor.bin--模拟nor flash挂载jffs2型号为sst25vf2M nor.bin--模拟nor flash挂载jffs2型号为sst25vf2M
第一次启动时会看到fatfs挂在失败。 第一次启动时会看到fatfs挂在失败因为文件系统没有格式化需要键入以下命令
按下回车出现finsh然后输入`mkfs("elm", "sd0")`格式化SD卡如下所示 mkfs sd0
finsh>>mkfs("elm", "sd0") 重启运行程序可以正确挂载、使用FATFS文件系统。
0, 0x00000000
重启程序可以正确挂载fat文件系统。
2) 测试RTGUI 2) 测试RTGUI
打开RTGUI组件后编译启动在finsh中输入snake_main()并回车,可运行贪吃蛇程序 打开RTGUI组件后编译启动在finsh中输入snake_main()并回车,可运行贪吃蛇程序

View File

@ -68,9 +68,9 @@
#define RT_USING_DFS #define RT_USING_DFS
#define DFS_USING_POSIX #define DFS_USING_POSIX
#define DFS_USING_WORKDIR #define DFS_USING_WORKDIR
#define DFS_FILESYSTEMS_MAX 2 #define DFS_FILESYSTEMS_MAX 8
#define DFS_FILESYSTEM_TYPES_MAX 4 #define DFS_FILESYSTEM_TYPES_MAX 8
#define DFS_FD_MAX 4 #define DFS_FD_MAX 32
#define RT_USING_DFS_ELMFAT #define RT_USING_DFS_ELMFAT
/* elm-chan's FatFs, Generic FAT Filesystem Module */ /* elm-chan's FatFs, Generic FAT Filesystem Module */