Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
RT-Thread一般讨论
关于finsh shell中查根目录文件的问题
发布于 2014-09-20 17:25:30 浏览:2786
订阅该版
stm32f103ze +rtt1.2.1+片外SRAM+NAND FLASH 在这个平台上,正确写入文件,如"/test"、"/dabin2"、"/dabin3.dat"(新增) 1、依次重新烧写程序,分别写入上述3个文件,发现DIR 不增,FILE增加, 2、发现文件正确写入,但是在FINSH SHELL中 ls()命令,不显示新增文件, 3、cat()命令,cat("/test") ,shell中(平台,secureCRT)能显示文件内容。 怎样操作才能显示根目录的文件? [attach]0[/attach] 问题2,finsh shell中, finsh />help,还是finsh help() 都不对。前者Unknown symbol,后者Null node help是怎么用的? 各位大侠,解答一下小弟疑惑。 另除了手册外,还有finshshell命令的资料么? ![1.jpg](https://oss-club.rt-thread.org/uploads/6902_ba1221faab2d95dab6b287ba9a51b0af.jpg) ![ext_sram.jpg](https://oss-club.rt-thread.org/uploads/6902_3652e6c342014a60821c14c9001e624a.jpg) 下载附件 [uffs_config (2).h](https://oss-club.rt-thread.org/uploads/6902_4a59521399174a0c7860b44d4833b9cd.h)
查看更多
4
个回答
默认排序
按发布时间排序
bernard
2014-09-20
这家伙很懒,什么也没写!
pbuf:can't load page from flash 这个是uffs的?是否没内存了?uffs应该比较吃内存的
mickiy
2014-09-20
这家伙很懒,什么也没写!
我的情况如下。我每次程序挂载文件系统初始化,会pbuf:can't load page from flash, ls("/")根目录查文件节点,会pbuf:can't load page from flash。。 若是子目录再查文件节点,就是0, 0x00000000 是挂载的UFFS,片外sram 4M bytes [attach]2357[/attach] uffs page block 分配(用系统默认的),nandflash为128M bytes。 代码 ``` #ifndef _UFFS_CONFIG_H_ #define _UFFS_CONFIG_H_ #define UFFS_MAX_PAGE_SIZE 2048 /** * def UFFS_MAX_SPARE_SIZE */ #define UFFS_MAX_SPARE_SIZE ((UFFS_MAX_PAGE_SIZE / 256) * 8) /** * def UFFS_MAX_ECC_SIZE */ #define UFFS_MAX_ECC_SIZE ((UFFS_MAX_PAGE_SIZE / 256) * 5) /** * def MAX_CACHED_BLOCK_INFO * ote uffs cache the block info for opened directories and files, * a practical value is 5 ~ MAX_OBJECT_HANDLE */ #define MAX_CACHED_BLOCK_INFO 50 /** * def MAX_PAGE_BUFFERS * ote the bigger value will bring better read/write performance. * but few writing performance will be improved when this * value is become larger than 'max pages per block' */ #define MAX_PAGE_BUFFERS 40 /** * def CLONE_BUFFER_THRESHOLD * ote reserve buffers for clone. 1 or 2 should be enough. */ #define CLONE_BUFFERS_THRESHOLD 2 /** * def MAX_SPARE_BUFFERS * ote spare buffers are used for lower level flash operations, * 5 should be enough. */ #define MAX_SPARE_BUFFERS 5 /** * def MAX_DIRTY_PAGES_IN_A_BLOCK * ote this value should be between '2' and the lesser of * 'max pages per block' and (MAX_PAGE_BUFFERS - CLONE_BUFFERS_THRESHOLD - 1). * * the smaller the value the frequently the buffer will be flushed. */ #define MAX_DIRTY_PAGES_IN_A_BLOCK 32 /** * def MAX_DIRTY_BUF_GROUPS */ #define MAX_DIRTY_BUF_GROUPS 3 /** * def CONFIG_ENABLE_UFFS_DEBUG_MSG * ote Enable debug message output. You must call uffs_InitDebugMessageOutput() * to initialize debug apart from enable debug feature. */ #define CONFIG_ENABLE_UFFS_DEBUG_MSG /** * def CONFIG_USE_GLOBAL_FS_LOCK * ote use global lock instead of per-device lock. * this is required if you use fd APIs in multi-thread environment. */ #define CONFIG_USE_GLOBAL_FS_LOCK /** * def CONFIG_USE_PER_DEVICE_LOCK * ote use per-device lock. * this is required if you use fs APIs in multi-thread environment. */ //#define CONFIG_USE_PER_DEVICE_LOCK /** * def CONFIG_USE_STATIC_MEMORY_ALLOCATOR * ote uffs will use static memory allocator if this is defined. * to use static memory allocator, you need to provide memory * buffer when creating uffs_Device. * * use UFFS_STATIC_BUFF_SIZE() to calculate memory buffer size. */ #define CONFIG_USE_STATIC_MEMORY_ALLOCATOR 0 /** * def CONFIG_USE_SYSTEM_MEMORY_ALLOCATOR * ote using system platform's 'malloc' and 'free'. */ #define CONFIG_USE_SYSTEM_MEMORY_ALLOCATOR 1 /** * def CONFIG_FLUSH_BUF_AFTER_WRITE * ote UFFS will write all data directly into flash in * each 'write' call if you enable this option. * (which means lesser data lost when power failure but * poorer writing performance). * It's not recommended to open this define for normal applications. */ #define CONFIG_FLUSH_BUF_AFTER_WRITE /** * def CONFIG_UFFS_AUTO_LAYOUT_MTD_COMP * ote Use Linux MTD compatiable spare placement for UFFS_LAYOUT_AUTO, * only valid for page data size 512 or 2048. */ //#define CONFIG_UFFS_AUTO_LAYOUT_USE_MTD_SCHEME /** * def MAX_OBJECT_HANDLE * maximum number of object handle */ #define MAX_OBJECT_HANDLE 50 #define FD_SIGNATURE_SHIFT 6 /** * def MAX_DIR_HANDLE * maximum number of uffs_DIR */ #define MAX_DIR_HANDLE 10 /** * def MINIMUN_ERASED_BLOCK * UFFS will not allow appending or creating new files when the free/erased block * is lower then MINIMUN_ERASED_BLOCK. */ #define MINIMUN_ERASED_BLOCK 2 ``` [attach]2358[/attach]
mickiy
2014-09-20
这家伙很懒,什么也没写!
每次程序挂载文件系统初始化,会pbuf:can't load page from flash, 是因为我在程序里调用了 readdir(); 那为什么获取某地址下的所有FILES时,都会有上述错误。 FINSH /> ls() 时也有上述错误。 各位,读取根目录时,部分文件显示不出,但是文件确实存在。这根这句pbuf打印错误 有关联么? ``` void read_root_dir(char * dir) { int result; DIR *dirp; struct dirent *d; dirp = opendir(dir); if(dirp == RT_NULL) { rt_kprintf("open directory error! "); } else { while ((d = readdir(dirp)) != RT_NULL) { rt_kprintf("found %s ", d->d_name); } closedir(dirp); } } ```
撰写答案
登录
注册新账号
关注者
0
被浏览
2.8k
关于作者
mickiy
这家伙很懒,什么也没写!
提问
2
回答
2
被采纳
0
关注TA
发私信
相关问题
1
有关动态模块加载的一篇论文
2
最近的调程序总结
3
晕掉了,这么久都不见layer2的踪影啊
4
继续K9ii的历程
5
[GUI相关] FreeType 2
6
[GUI相关]嵌入式系统中文输入法的设计
7
20081101 RT-Thread开发者聚会总结
8
嵌入式系统基础
9
linux2.4.19在at91rm9200 上的寄存器设置
10
[转]基于嵌入式Linux的通用触摸屏校准程序
推荐文章
1
RT-Thread应用项目汇总
2
玩转RT-Thread系列教程
3
国产MCU移植系列教程汇总,欢迎查看!
4
机器人操作系统 (ROS2) 和 RT-Thread 通信
5
五分钟玩转RT-Thread新社区
6
【技术三千问】之《玩转ART-Pi》,看这篇就够了!干货汇总
7
关于STM32H7开发板上使用SDIO接口驱动SD卡挂载文件系统的问题总结
8
STM32的“GPU”——DMA2D实例详解
9
RT-Thread隐藏的宝藏之completion
10
【ART-PI】RT-Thread 开启RTC 与 Alarm组件
最新文章
1
【NXP-MCXA153】 定时器驱动移植
2
GD32F450 看门狗驱动适配
3
【NXP-MCXA153】看门狗驱动移植
4
RT-Thread Studio V2.2.9 Release Note
5
CherryUSB的bootuf2配置
热门标签
RT-Thread Studio
串口
Env
LWIP
SPI
AT
Bootloader
Hardfault
CAN总线
FinSH
ART-Pi
USB
DMA
文件系统
RT-Thread
SCons
RT-Thread Nano
线程
MQTT
STM32
RTC
FAL
rt-smart
ESP8266
I2C_IIC
UART
WIZnet_W5500
ota在线升级
PWM
freemodbus
flash
cubemx
packages_软件包
BSP
潘多拉开发板_Pandora
定时器
ADC
GD32
flashDB
socket
中断
编译报错
Debug
rt_mq_消息队列_msg_queue
SFUD
msh
keil_MDK
ulog
C++_cpp
MicroPython
本月问答贡献
踩姑娘的小蘑菇
7
个答案
2
次被采纳
a1012112796
16
个答案
1
次被采纳
Ryan_CW
5
个答案
1
次被采纳
红枫
4
个答案
1
次被采纳
张世争
4
个答案
1
次被采纳
本月文章贡献
YZRD
3
篇文章
6
次点赞
catcatbing
3
篇文章
6
次点赞
lizimu
2
篇文章
9
次点赞
qq1078249029
2
篇文章
2
次点赞
xnosky
2
篇文章
1
次点赞
回到
顶部
发布
问题
分享
好友
手机
浏览
扫码手机浏览
投诉
建议
回到
底部